jellyfin / jellyfin-packaging

Jellyfin Packaging and Build Workflows
GNU General Public License v3.0
16 stars 16 forks source link

New Debian install does not have permissions to /etc/jellyfin #37

Closed NickPaul41 closed 3 weeks ago

NickPaul41 commented 3 weeks ago

I did a new install on debian bookworm. I used the auto installer script and the jellyfin.service does not start. Journalctl -u jellyfin shows the following.

Aug 25 21:08:12 jellyfin jellyfin[3864]: Unhandled exception. System.UnauthorizedAccessException: Access to the path '/etc/jellyfin/logging.default.json' is denied.
Aug 25 21:08:12 jellyfin jellyfin[3864]:  ---> System.IO.IOException: Permission denied
Aug 25 21:08:12 jellyfin jellyfin[3864]:    --- End of inner exception stack trace ---
Aug 25 21:08:12 jellyfin jellyfin[3864]:    at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError)
Aug 25 21:08:12 jellyfin jellyfin[3864]:    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode, Boolean failForSymlink, Boolean& w>
Aug 25 21:08:12 jellyfin jellyfin[3864]:    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOpti>
Aug 25 21:08:12 jellyfin jellyfin[3864]:    at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions >
Aug 25 21:08:12 jellyfin jellyfin[3864]:    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions opt>
Aug 25 21:08:12 jellyfin jellyfin[3864]:    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions opt>
Aug 25 21:08:12 jellyfin jellyfin[3864]:    at Jellyfin.Server.Helpers.StartupHelpers.InitLoggingConfigFile(IApplicationPaths appPaths)
Aug 25 21:08:12 jellyfin jellyfin[3864]:    at Jellyfin.Server.Helpers.StartupHelpers.InitLoggingConfigFile(IApplicationPaths appPaths)
Aug 25 21:08:12 jellyfin jellyfin[3864]:    at Jellyfin.Server.Program.StartApp(StartupOptions options)
Aug 25 21:08:12 jellyfin jellyfin[3864]:    at Jellyfin.Server.Program.<Main>(String[] args)
Aug 25 21:08:12 jellyfin systemd[1]: jellyfin.service: Main process exited, code=killed, status=6/ABRT
Aug 25 21:08:12 jellyfin systemd[1]: jellyfin.service: Failed with result 'signal'.
Aug 25 21:08:13 jellyfin systemd[1]: jellyfin.service: Scheduled restart job, restart counter is at 2.
Aug 25 21:08:13 jellyfin systemd[1]: Stopped jellyfin.service - Jellyfin Media Server.
Aug 25 21:08:13 jellyfin systemd[1]: Started jellyfin.service - Jellyfin Media Server.

It looks like the permissions update in debian/jellyfin-server.postinst never ran. I new to this repo but I'm expecting that /etc/jellyfin to be created before the postinstall executes. After running

chown -R ${JELLYFIN_USER} $PROGRAMDATA $CONFIGDATA $LOGDATA $CACHEDATA
chgrp adm $PROGRAMDATA $CONFIGDATA $LOGDATA $CACHEDATA
chmod 0750 $PROGRAMDATA $CONFIGDATA $LOGDATA $CACHEDATA

Everything is up and running again.

joshuaboniface commented 3 weeks ago

Hm, looks like the bugfix to #32 actually caused this breakage. The conditional we're using for /etc/jellyfin won't work because that directory will exist when it runs.

Should be a relatively easy fix to look for a particular file instead.

joshuaboniface commented 3 weeks ago

It's a pretty annoying breakage, but I think we'll be doing another point release very soon so I'm going to just include this there. For now I've added a quick little hack into install-debuntu.sh that should hopefully fix it during install. Edit: Quick test and it does.

joshuaboniface commented 3 weeks ago

@WSA1k I'm sorry what is this for?