Skip to content

Attempts to write file in read-only library during upgrade migration #13048

Closed
@kg333

Description

This issue respects the following points:

  • This is a bug, not a question or a configuration issue; Please visit our forum or chat rooms first to troubleshoot with volunteers, before creating a report. The links can be found here.
  • This issue is not already reported on GitHub (I've searched it).
  • I'm using an up to date version of Jellyfin Server stable, unstable or master; We generally do not support previous older versions. If possible, please update to the latest version before opening an issue.
  • I agree to follow Jellyfin's Code of Conduct.
  • This report addresses only a single issue; If you encounter multiple issues, kindly create separate reports for each one.

Description of the bug

After installing the latest 10.10.2 package of Jellyfin on Ubuntu 22.04.5 LTS (10.10.2+ubu2204), Jellyfin fails to start with a bug attempting to access an m3u playlist in a read-only library. Based on the migration description, it appears to be trying to delete it during migration RemoveDuplicatePlaylistChildren - however, this is a read-only library and Jellyfin shouldn't be attempting to modify any files. Jellyfin is able to read the file via sudo -u jellyfin cat <path to m3u>, so it does have correct read-only access.

Reproduction steps

  1. Set up Jellyfin 10.9.11.0 instance with read-only music library containing m3u playlists. (ex. /home/matthew/Music)
  2. Install the updated Jellyfin package on Ubuntu 22.04.5 for version 10.10.2.
  3. Attempt to start Jellyfin and observe failure to start when it attempts to access m3u files.

What is the current bug behavior?

Jellyfin fails to complete migration 'RemoveDuplicatePlaylistChildren" while attempting to delete an m3u it doesn't have write access to, and fails to start.

What is the expected correct behavior?

Jellyfin should not attempt cleanup or deletion of files in read-only libraries and should start.

Jellyfin Server version

10.10.0+

Specify commit id

Not known

Specify unstable release number

Not known

Specify version number

10.10.2+ubu2204

Specify the build version

Unable to access dashboard, failure to start

Environment

- OS: Ubuntu 22.04.5 LTS Jammy
- Linux Kernel: 5.15.0-125-generic #135-Ubuntu SMP Fri Sep 27 13:53:58 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
- Virtualization: Proxmox VM
- Clients: N/A
- Browser: N/A
- FFmpeg Version: N/A
- Playback Method: N/A
- Hardware Acceleration: None
- GPU Model: None
- Plugins: None
- Reverse Proxy: Apache
- Base URL: none
- Networking: NFS share
- Storage: NFS

Jellyfin logs

Nov 16 16:00:44 jellyfin jellyfin[2000]: [16:00:44] [WRN] Unable to find linked item at path ..\Hotline Miami\TurfIntro.ogg
Nov 16 16:00:44 jellyfin jellyfin[2000]: [16:00:44] [WRN] Unable to find linked item at path ..\Hotline Miami\TurfMain.ogg
Nov 16 16:00:44 jellyfin jellyfin[2000]: [16:00:44] [WRN] Unable to find linked item at path ..\Iron Maiden\(2000) Brave New World\01 - The Wickerman.mp3
Nov 16 16:00:44 jellyfin jellyfin[2000]: [16:00:44] [WRN] Unable to find linked item at path ..\Sonata Arctica\SONATA_A.MP3
Nov 16 16:00:44 jellyfin jellyfin[2000]: [16:00:44] [WRN] Unable to find linked item at path ..\Edguy\Edguy - 06 - The Asylum.mp3
Nov 16 16:00:44 jellyfin jellyfin[2000]: [16:00:44] [WRN] Unable to find linked item at path ..\Eisbrecher\Eisbrecher - This Is Deutsch.mp3
Nov 16 16:00:44 jellyfin jellyfin[2000]: [16:00:44] [WRN] Unable to find linked item at path ..\Gamma Ray\Gamma_Ray-Land_Of_The_Free_II-Promo-2007-QTXMp3\07-empress-qtxmp3.mp3
Nov 16 16:00:44 jellyfin jellyfin[2000]: [16:00:44] [WRN] Unable to find linked item at path ..\Gamma Ray\Gamma Ray - Fight.mp3
Nov 16 16:00:44 jellyfin jellyfin[2000]: [16:00:44] [WRN] Unable to find linked item at path ..\Kamelot\08 - The Black Halo - 2005\02 - When The Lights Are Down (Feat. Jens Johannson).mp3
Nov 16 16:00:44 jellyfin jellyfin[2000]: [16:00:44] [WRN] Unable to find linked item at path ..\Within Temptation\THE_SILE\ANGELS__.MP3
Nov 16 16:00:44 jellyfin jellyfin[2000]: [16:00:44] [WRN] Unable to find linked item at path ..\Sonata Arctica\PAID_IN_\SONAT001.MP3
Nov 16 16:00:44 jellyfin jellyfin[2000]: [16:00:44] [ERR] Could not apply migration 'RemoveDuplicatePlaylistChildren'
Nov 16 16:00:44 jellyfin jellyfin[2000]: System.UnauthorizedAccessException: Access to the path '/home/matthew/Music/Playlists/Wakeup - Copy.m3u' is denied.
Nov 16 16:00:44 jellyfin jellyfin[2000]:  ---> System.IO.IOException: Permission denied
Nov 16 16:00:44 jellyfin jellyfin[2000]:    --- End of inner exception stack trace ---
Nov 16 16:00:44 jellyfin jellyfin[2000]:    at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError)
Nov 16 16:00:44 jellyfin jellyfin[2000]:    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException)
Nov 16 16:00:44 jellyfin jellyfin[2000]:    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException)
Nov 16 16:00:44 jellyfin jellyfin[2000]:    at System.IO.File.OpenHandle(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
Nov 16 16:00:44 jellyfin jellyfin[2000]:    at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
Nov 16 16:00:44 jellyfin jellyfin[2000]:    at Emby.Server.Implementations.Playlists.PlaylistManager.SavePlaylistFile(Playlist item)
Nov 16 16:00:44 jellyfin jellyfin[2000]:    at Jellyfin.Server.Migrations.Routines.RemoveDuplicatePlaylistChildren.Perform()
Nov 16 16:00:44 jellyfin jellyfin[2000]:    at Jellyfin.Server.Migrations.MigrationRunner.PerformMigrations(IMigrationRoutine[] migrations, MigrationOptions migrationOptions, Action`1 saveConfiguration, ILogger logger)
Nov 16 16:00:44 jellyfin jellyfin[2000]: [16:00:44] [FTL] Error while starting server
Nov 16 16:00:44 jellyfin jellyfin[2000]: System.UnauthorizedAccessException: Access to the path '/home/matthew/Music/Playlists/Wakeup - Copy.m3u' is denied.
Nov 16 16:00:44 jellyfin jellyfin[2000]:  ---> System.IO.IOException: Permission denied
Nov 16 16:00:44 jellyfin jellyfin[2000]:    --- End of inner exception stack trace ---
Nov 16 16:00:44 jellyfin jellyfin[2000]:    at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError)
Nov 16 16:00:44 jellyfin jellyfin[2000]:    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException)
Nov 16 16:00:44 jellyfin jellyfin[2000]:    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException)
Nov 16 16:00:44 jellyfin jellyfin[2000]:    at System.IO.File.OpenHandle(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
Nov 16 16:00:44 jellyfin jellyfin[2000]:    at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
Nov 16 16:00:44 jellyfin jellyfin[2000]:    at Emby.Server.Implementations.Playlists.PlaylistManager.SavePlaylistFile(Playlist item)
Nov 16 16:00:44 jellyfin jellyfin[2000]:    at Jellyfin.Server.Migrations.Routines.RemoveDuplicatePlaylistChildren.Perform()
Nov 16 16:00:44 jellyfin jellyfin[2000]:    at Jellyfin.Server.Migrations.MigrationRunner.PerformMigrations(IMigrationRoutine[] migrations, MigrationOptions migrationOptions, Action`1 saveConfiguration, ILogger logger)
Nov 16 16:00:44 jellyfin jellyfin[2000]:    at Jellyfin.Server.Migrations.MigrationRunner.Run(CoreAppHost host, ILoggerFactory loggerFactory)
Nov 16 16:00:44 jellyfin jellyfin[2000]:    at Jellyfin.Server.Program.StartServer(IServerApplicationPaths appPaths, StartupOptions options, IConfiguration startupConfig)
Nov 16 16:00:44 jellyfin jellyfin[2000]: [16:00:44] [INF] Running query planner optimizations in the database... This might take a while
Nov 16 16:00:44 jellyfin jellyfin[2000]: [16:00:44] [INF] Disposing CoreAppHost
Nov 16 16:00:44 jellyfin jellyfin[2000]: [16:00:44] [INF] Disposing MusicBrainzArtistProvider
Nov 16 16:00:44 jellyfin jellyfin[2000]: [16:00:44] [INF] Disposing MusicBrainzAlbumProvider
Nov 16 16:00:44 jellyfin jellyfin[2000]: [16:00:44] [INF] Disposing PluginManager
Nov 16 16:00:44 jellyfin systemd[1]: jellyfin.service: Deactivated successfully.
Nov 16 16:00:44 jellyfin systemd[1]: jellyfin.service: Consumed 6.338s CPU time.

FFmpeg logs

N/A, not transcoding related

Client / Browser logs

N/A, failure to start

Relevant screenshots or videos

No response

Additional information

Permissions on file in question:

-rw-r--r-- 1 matthew matthew    831 Nov 21  2012 'Wakeup - Copy.m3u'

I've rolled back to 10.9.11+ubu2204 for now and would be interested in workarounds to disable the RemoveDuplicatePlaylistChildren migration. Can I edit something in migrations.xml to force that migration to be skipped?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingconfirmedThis issue has been reviewed and confirmed

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions