Unable to start server with systemctl #40

Closed
opened 2026-02-06 19:13:23 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @TN-1 on GitHub (Dec 12, 2018).

Unhandled Exception: System.AggregateException: One or more errors occurred. (Access to the path '/var/lib/emby/logs/server.txt' is denied.) ---> System.UnauthorizedAccessException: Access to the path '/var/lib/emby/logs/server.txt' is denied. ---> System.IO.IOException: Permission denied
   --- End of inner exception stack trace ---
   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at Emby.Server.Implementations.Logging.FileLogger..ctor(String path) in /var/home/joshua/Projects/Emby/jellyfin/Emby.Server.Implementations/Logging/SimpleLogManager.cs:line 172
   at Emby.Server.Implementations.Logging.SimpleLogManager.ReloadLogger(LogSeverity severity, CancellationToken cancellationToken) in /var/home/joshua/Projects/Emby/jellyfin/Emby.Server.Implementations/Logging/SimpleLogManager.cs:line 52
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.WaitAllCore(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at MediaBrowser.Server.Mono.MainClass.Main(String[] args)
[1]    3169 abort (core dumped)  dotnet /usr/lib/jellyfin/bin/EmbyServer.dll

Temporary workaround is to start server manually with sudo dotnet /usr/lib/jellyfin/bin/EmbyServer.dll
Ubuntu 18.04 using the apt package, dotnet version 2.1.5

Originally created by @TN-1 on GitHub (Dec 12, 2018). ``` Unhandled Exception: System.AggregateException: One or more errors occurred. (Access to the path '/var/lib/emby/logs/server.txt' is denied.) ---> System.UnauthorizedAccessException: Access to the path '/var/lib/emby/logs/server.txt' is denied. ---> System.IO.IOException: Permission denied --- End of inner exception stack trace --- at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at Emby.Server.Implementations.Logging.FileLogger..ctor(String path) in /var/home/joshua/Projects/Emby/jellyfin/Emby.Server.Implementations/Logging/SimpleLogManager.cs:line 172 at Emby.Server.Implementations.Logging.SimpleLogManager.ReloadLogger(LogSeverity severity, CancellationToken cancellationToken) in /var/home/joshua/Projects/Emby/jellyfin/Emby.Server.Implementations/Logging/SimpleLogManager.cs:line 52 --- End of inner exception stack trace --- at System.Threading.Tasks.Task.WaitAllCore(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken) at MediaBrowser.Server.Mono.MainClass.Main(String[] args) [1] 3169 abort (core dumped) dotnet /usr/lib/jellyfin/bin/EmbyServer.dll ``` Temporary workaround is to start server manually with `sudo dotnet /usr/lib/jellyfin/bin/EmbyServer.dll` Ubuntu 18.04 using the apt package, dotnet version 2.1.5
OVERLORD added the bug label 2026-02-06 19:13:23 +03:00
Author
Owner

@joshuaboniface commented on GitHub (Dec 12, 2018):

Access to the path '/var/lib/emby/logs/server.txt' is denied.

The Jellyfin process runs as the jellyfin user. If this is an upgrade, you'll need to move your /var/lib/emby to /var/lib/jellyfin, symlink the old path to the new path, and then ensure the whole directory is recursively owned by jellyfin.

@joshuaboniface commented on GitHub (Dec 12, 2018): >Access to the path '/var/lib/emby/logs/server.txt' is denied. The Jellyfin process runs as the `jellyfin` user. If this is an upgrade, you'll need to move your `/var/lib/emby` to `/var/lib/jellyfin`, symlink the old path to the new path, and then ensure the whole directory is recursively owned by `jellyfin`.
Author
Owner

@TN-1 commented on GitHub (Dec 12, 2018):

Thankyou, that solved the problem.
For future people with this problem, commands are:

sudo mv /var/lib/emby /var/lib/jellyfin
sudo ln -s /var/lib/jellyfin /var/lib/emby
sudo chown -R jellyfin /var/lib/jellyfin

Is this something that could be automated during the installation process?

@TN-1 commented on GitHub (Dec 12, 2018): Thankyou, that solved the problem. For future people with this problem, commands are: ``` sudo mv /var/lib/emby /var/lib/jellyfin sudo ln -s /var/lib/jellyfin /var/lib/emby sudo chown -R jellyfin /var/lib/jellyfin ``` Is this something that could be automated during the installation process?
Author
Owner

@joshuaboniface commented on GitHub (Dec 12, 2018):

The Debian package postinst script should be doing steps 2 and 3, but it won't move the contents of /var/lib/emby due to the potential for problems there (e.g. keeping that data as a backup), though it does try to force through the symlink. If you're upgrading it's best to move that directory /var/lib/emby somewhere safe first, then install jellyfin, then move and chown the contents.

@joshuaboniface commented on GitHub (Dec 12, 2018): The Debian package `postinst` script should be doing steps 2 and 3, but it won't move the contents of `/var/lib/emby` due to the potential for problems there (e.g. keeping that data as a backup), though it does try to force through the symlink. If you're upgrading it's best to move that directory `/var/lib/emby` somewhere safe first, then install `jellyfin`, then move and chown the contents.
Author
Owner

@JustAMan commented on GitHub (Dec 12, 2018):

This needs to be documented somewhere.

@JustAMan commented on GitHub (Dec 12, 2018): This needs to be documented somewhere.
Author
Owner

@joshuaboniface commented on GitHub (Dec 12, 2018):

Will add an upgrading section to the README shortly!

@joshuaboniface commented on GitHub (Dec 12, 2018): Will add an upgrading section to the README shortly!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#40