jellyfin / jellyfin-server-windows

The Windows tray app and installer for Jellyfin Server on Windows.
https://jellyfin.org
MIT License
79 stars 26 forks source link

[Issue]: Data folder permissions issue with upgrading from 10.9.1/10.9.2/10.9.3 on Windows #127

Closed mattish91 closed 2 months ago

mattish91 commented 2 months ago

Please describe your bug

I just found out that there is an issue with "LOCAL SERVICE" account when setting data that should be included in the setup to set permissions for the data dir.

When standard install on Windows data dir is set to "C:\ProgramData\Jellyfin\" with "LOCAL SERVICE" as the account, i need to manually set the permissions for LOCAL SERVICE to that directory. I figured this was an odd issue the first time, but it actually removed all my data (Luckily i had a somewhat recent backup).

The issue started with 10.9.1 update and is still present to 10.9.3

Possible solution is to set permissions to data dir in the installer for the "LOCAL SERVICE" account.

See the error message i get in Event Viewer below

Basically tells me LOCAL SERVICE account doesn't have permissions to read the files, none of them.

The setup should probably also make a copy of the data when it feels that there is an installation present in future versions.

(Sorry for any doubble lettering if any, my keyboard is like that since a few days)

~~ As this bug also provides a solution, i hope this might help some one else running in to this issue on Windows 10/11 maybe others too.~~

Actually not solved at all, had to move the data directory entirely to another drive in order to solve this.

Reproduction Steps

  1. In this environment (Windows 10/11) make sure you have version 10.9.1 - 10.9.2 installed.
  2. Run the updated 10.9.2/10.9.3 setup just to find that the setup fail and that your data folders gets deleted along with the setup not being able to continue the install process followed by "You need to stop the Jellyfin Server service before installin" (if the service is running) "the service Jellyfin Server can not be stopped" (If the service is stopped).
  3. Proceed to refresh the services.msc window to find that the service "Jellyfin Server" is actually gone the second time around and finish installing the update with all config being from scratch.

Jellyfin Version

10.9.0

if other:

10.9.1 - 10.9.3

Environment

- OS: Windows 10/11 (tried both)
- Linux Kernel: KERNELBASE.dll 10.0.19041.4355 
- Virtualization: No
- Clients: *
- Browser: *
- FFmpeg Version: 6.0.1-Jellyfin
- Playback Method: *
- Hardware Acceleration: Yes
- GPU Model: Nvidia RTX 2070 Super
- Plugins: Any
- Reverse Proxy: Yes, NPM
- Base URL: my.domain
- Networking: Yes :D
- Storage: NTFS 8TB x2

Jellyfin logs

-- As the service stops before jellyfin can proceed with logs, there is none.

FFmpeg logs

-- Not applicable

Please attach any browser or client logs here

Event viewer:

Application: jellyfin.exe CoreCLR Version: 8.0.524.21615 .NET Version: 8.0.5 Description: The process was terminated due to an unhandled exception. Exception Info: System.UnauthorizedAccessException: Access to the path 'C:\ProgramData\Jellyfin\Server\plugins\configurations\Jellyfin.Plugin.MusicBrainz.xml' is denied. at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode) at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode) at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync) at System.Xml.XmlWriterSettings.CreateWriter(String outputFileName) at Jellyfin.Server.Migrations.PreStartupRoutines.MigrateMusicBrainzTimeout.WriteNew(String path, PluginConfiguration newPluginConfiguration) at Jellyfin.Server.Migrations.PreStartupRoutines.MigrateMusicBrainzTimeout.Perform() at Jellyfin.Server.Migrations.MigrationRunner.PerformMigrations(IMigrationRoutine[] migrations, MigrationOptions migrationOptions, Action`1 saveConfiguration, ILogger logger) at Jellyfin.Server.Migrations.MigrationRunner.RunPreStartup(ServerApplicationPaths appPaths, ILoggerFactory loggerFactory) at Jellyfin.Server.Program.StartApp(StartupOptions options) at Jellyfin.Server.Program.<Main>(String[] args) 

Please attach any screenshots here

image

Code of Conduct

jellyfin-bot commented 2 months ago

Hi, it seems like your issue report has the following item(s) that need to be addressed:

This is an automated message, currently under testing. Please file an issue here if you encounter any problems.

anthonylavado commented 2 months ago

I think this might be the same as #123?

Basically, if you had a Service Install, we lost track of that due to a logic bug introduced by the "Jellyfin is running" check. I just need to move that to only run if you're using the regular install, then everything should stay.

mattish91 commented 2 months ago

I think this might be the same as #123?

Basically, if you had a Service Install, we lost track of that due to a logic bug introduced by the "Jellyfin is running" check. I just need to move that to only run if you're using the regular install, then everything should stay.

Yes, that is correct.