Skip to content

[Bug]: Relative path in MusicFolder breaks DB migrations #3763

@ptrcnull

Description

@ptrcnull

I confirm that:

  • I have searched the existing open AND closed issues to see if an issue already exists for the bug I've encountered
  • I'm using the latest version (your issue may have been fixed already)

Version

latest master (0c4c223)

Current Behavior

When MusicFolder is set to a relative path, trying to make media files relative against / turns them into empty strings:

path, _ = filepath.Rel("/", path)

In result, fsys contains only a single entry, and the migration fails with error populating folder table: open : file does not exist because root gets the same treatment and is also an empty string.

Expected Behavior

the database migration passing successfully, i suppose

Steps To Reproduce

  1. Set up a new Navidrome instance on the stable version, with MusicFolder set to a relative path
  2. Add some music, and make sure it ends up in the database
  3. Build latest Navidrome and try to migrate the database

Environment

- OS: Linux
- Browser: n/a
- Client: n/a

Configuration

Relevant log output

time="2025-02-21T07:56:45Z" level=info msg="Upgrading DB Schema to latest version"
time="2025-02-21T07:56:45Z" level=fatal msg="Failed to apply new migrations" error="ERROR go migration: \"20241026183640_support_new_scanner.go\": failed to run go migration: error populating folder table: open : file does not exist"

Anything else?

No response

Code of Conduct

  • I agree to follow Navidrome's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions