Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't start emby-server on ubuntu #3806

Open
ralyodio opened this issue Jan 14, 2024 · 4 comments
Open

can't start emby-server on ubuntu #3806

ralyodio opened this issue Jan 14, 2024 · 4 comments

Comments

@ralyodio
Copy link

$ sudo systemctl restart emby-server
[ubuntu@s1035]:➜  transmission-daemon 
$ sudo systemctl status emby-server 
○ emby-server.service - Emby Server is a personal media server with apps on just about every device
     Loaded: loaded (/lib/systemd/system/emby-server.service; enabled; vendor preset: enabled)
     Active: inactive (dead) since Sun 2024-01-14 05:13:53 EST; 1s ago
    Process: 1792283 ExecStart=/opt/emby-server/bin/emby-server (code=exited, status=0/SUCCESS)
   Main PID: 1792283 (code=exited, status=0/SUCCESS)
        CPU: 167ms

Jan 14 05:13:53 s1035 emby-server[1792283]: Source: System.Private.CoreLib
Jan 14 05:13:53 s1035 emby-server[1792283]: TargetSite: Void CreateDirectory(System.String)
Jan 14 05:13:53 s1035 emby-server[1792283]:    at System.IO.FileSystem.CreateDirectory(String fullPath)
Jan 14 05:13:53 s1035 emby-server[1792283]:    at System.IO.Directory.CreateDirectory(String path)
Jan 14 05:13:53 s1035 emby-server[1792283]:    at Emby.Server.Implementations.Logging.FileLogger..ctor(String path)
Jan 14 05:13:53 s1035 emby-server[1792283]:    at Emby.Server.Implementations.Logging.SimpleLogManager.ReloadLogger(LogSeverity severity, CancellationToken cancell>
Jan 14 05:13:53 s1035 emby-server[1792283]: InnerException: System.IO.IOException: Permission denied
Jan 14 05:13:53 s1035 emby-server[1792283]: Source:
Jan 14 05:13:53 s1035 emby-server[1792283]: TargetSite:
Jan 14 05:13:53 s1035 systemd[1]: emby-server.service: Deactivated successfully.
@ralyodio
Copy link
Author

if i run the command by itself it starts fine.

@matiasw
Copy link

matiasw commented Jan 27, 2024

I have the same problem on Debian 11 Bullseye.

After systemctl restart emby-server, it is briefly up and shown as "running", but then exits with exit code "0/SUCCESS":

sudo systemctl status emby-server
● emby-server.service - Emby Server is a personal media server with apps on just about every device
     Loaded: loaded (/usr/lib/systemd/system/emby-server.service; enabled; vendor preset: enabled)
     Active: inactive (dead) since Sat 2024-01-27 12:53:01 EET; 2min 32s ago
    Process: 64074 ExecStart=/opt/emby-server/bin/emby-server (code=exited, status=0/SUCCESS)
   Main PID: 64074 (code=exited, status=0/SUCCESS)
        CPU: 292ms

Here is the relevant info from journalctl -u emby-server -S today:

-- Journal begins at Sun 2024-01-14 04:04:35 EET, ends at Sat 2024-01-27 12:55:22 EET. --
Jan 27 12:47:55 rubi systemd[1]: Started Emby Server is a personal media server with apps on just about every device.
Jan 27 12:48:01 rubi emby-server[63942]: Error GlobalExceptionHandler: UnhandledException
Jan 27 12:48:01 rubi emby-server[63942]:         System.AggregateException: System.AggregateException: One or more errors occurred. (Access to the path '/var/lib/emby/logs/embyserver-1.txt' is denied.)
Jan 27 12:48:01 rubi emby-server[63942]:          ---> System.UnauthorizedAccessException: Access to the path '/var/lib/emby/logs/embyserver-1.txt' is denied.
Jan 27 12:48:01 rubi emby-server[63942]:          ---> System.IO.IOException: Permission denied
Jan 27 12:48:01 rubi emby-server[63942]:            --- End of inner exception stack trace ---
Jan 27 12:48:01 rubi emby-server[63942]:            at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
Jan 27 12:48:01 rubi emby-server[63942]:            at Interop.CheckIo(Error error, String path, Boolean isDirectory, Func`2 errorRewriter)
Jan 27 12:48:01 rubi emby-server[63942]:            at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
Jan 27 12:48:01 rubi emby-server[63942]:            at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
Jan 27 12:48:01 rubi emby-server[63942]:            at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
Jan 27 12:48:01 rubi emby-server[63942]:            at System.IO.Strategies.FileStreamHelpers.ChooseStrategy(FileStream fileStream, String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize)
Jan 27 12:48:01 rubi emby-server[63942]:            at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
Jan 27 12:48:01 rubi emby-server[63942]:            at Emby.Server.Implementations.Logging.FileLogger..ctor(String path)
Jan 27 12:48:01 rubi emby-server[63942]:            at Emby.Server.Implementations.Logging.SimpleLogManager.ReloadLogger(LogSeverity severity, CancellationToken cancellationToken)
Jan 27 12:48:01 rubi emby-server[63942]:            --- End of inner exception stack trace ---
Jan 27 12:48:01 rubi emby-server[63942]:            at System.Threading.Tasks.Task.WaitAllCore(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken)
Jan 27 12:48:01 rubi emby-server[63942]:            at System.Threading.Tasks.Task.WaitAll(Task[] tasks)
Jan 27 12:48:01 rubi emby-server[63942]:            at EmbyServer.Program.Main(String[] args)
Jan 27 12:48:01 rubi emby-server[63942]:         Source: System.Private.CoreLib
Jan 27 12:48:01 rubi emby-server[63942]:         TargetSite: Void ThrowAggregateException(System.Collections.Generic.List`1[System.Exception])
Jan 27 12:48:01 rubi emby-server[63942]:         InnerException: System.UnauthorizedAccessException: Access to the path '/var/lib/emby/logs/embyserver-1.txt' is denied.
Jan 27 12:48:01 rubi emby-server[63942]:         Source: System.Private.CoreLib
Jan 27 12:48:01 rubi emby-server[63942]:         TargetSite: Void ThrowExceptionForIoErrno(ErrorInfo, System.String, Boolean, System.Func`2[Interop+ErrorInfo,Interop+ErrorInfo])
Jan 27 12:48:01 rubi emby-server[63942]:            at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
Jan 27 12:48:01 rubi emby-server[63942]:            at Interop.CheckIo(Error error, String path, Boolean isDirectory, Func`2 errorRewriter)
Jan 27 12:48:01 rubi emby-server[63942]:            at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
Jan 27 12:48:01 rubi emby-server[63942]:            at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
Jan 27 12:48:01 rubi emby-server[63942]:            at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
Jan 27 12:48:01 rubi emby-server[63942]:            at System.IO.Strategies.FileStreamHelpers.ChooseStrategy(FileStream fileStream, String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize)
Jan 27 12:48:01 rubi emby-server[63942]:            at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
Jan 27 12:48:01 rubi emby-server[63942]:            at Emby.Server.Implementations.Logging.FileLogger..ctor(String path)
Jan 27 12:48:01 rubi emby-server[63942]:            at Emby.Server.Implementations.Logging.SimpleLogManager.ReloadLogger(LogSeverity severity, CancellationToken cancellationToken)
Jan 27 12:48:01 rubi emby-server[63942]:         InnerException: System.IO.IOException: Permission denied
Jan 27 12:48:01 rubi emby-server[63942]:         Source:
Jan 27 12:48:01 rubi emby-server[63942]:         TargetSite:
Jan 27 12:48:01 rubi emby-server[63942]:         
Jan 27 12:48:01 rubi emby-server[63942]: UnhandledException
Jan 27 12:48:01 rubi emby-server[63942]: System.AggregateException: System.AggregateException: One or more errors occurred. (Access to the path '/var/lib/emby/logs/embyserver-1.txt' is denied.)
Jan 27 12:48:01 rubi emby-server[63942]:  ---> System.UnauthorizedAccessException: Access to the path '/var/lib/emby/logs/embyserver-1.txt' is denied.
Jan 27 12:48:01 rubi emby-server[63942]:  ---> System.IO.IOException: Permission denied
Jan 27 12:48:01 rubi emby-server[63942]:    --- End of inner exception stack trace ---
Jan 27 12:48:01 rubi emby-server[63942]:    at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
Jan 27 12:48:01 rubi emby-server[63942]:    at Interop.CheckIo(Error error, String path, Boolean isDirectory, Func`2 errorRewriter)
Jan 27 12:48:01 rubi emby-server[63942]:    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
Jan 27 12:48:01 rubi emby-server[63942]:    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
Jan 27 12:48:01 rubi emby-server[63942]:    at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
Jan 27 12:48:01 rubi emby-server[63942]:    at System.IO.Strategies.FileStreamHelpers.ChooseStrategy(FileStream fileStream, String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize)
Jan 27 12:48:01 rubi emby-server[63942]:    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
Jan 27 12:48:01 rubi emby-server[63942]:    at Emby.Server.Implementations.Logging.FileLogger..ctor(String path)
Jan 27 12:48:01 rubi emby-server[63942]:    at Emby.Server.Implementations.Logging.SimpleLogManager.ReloadLogger(LogSeverity severity, CancellationToken cancellationToken)
Jan 27 12:48:01 rubi emby-server[63942]:    --- End of inner exception stack trace ---
Jan 27 12:48:01 rubi emby-server[63942]:    at System.Threading.Tasks.Task.WaitAllCore(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken)
Jan 27 12:48:01 rubi emby-server[63942]:    at System.Threading.Tasks.Task.WaitAll(Task[] tasks)
Jan 27 12:48:01 rubi emby-server[63942]:    at EmbyServer.Program.Main(String[] args)
Jan 27 12:48:01 rubi emby-server[63942]: Source: System.Private.CoreLib
Jan 27 12:48:01 rubi emby-server[63942]: TargetSite: Void ThrowAggregateException(System.Collections.Generic.List`1[System.Exception])
Jan 27 12:48:01 rubi emby-server[63942]: InnerException: System.UnauthorizedAccessException: Access to the path '/var/lib/emby/logs/embyserver-1.txt' is denied.
Jan 27 12:48:01 rubi emby-server[63942]: Source: System.Private.CoreLib
Jan 27 12:48:01 rubi emby-server[63942]: TargetSite: Void ThrowExceptionForIoErrno(ErrorInfo, System.String, Boolean, System.Func`2[Interop+ErrorInfo,Interop+ErrorInfo])
Jan 27 12:48:01 rubi emby-server[63942]:    at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
Jan 27 12:48:01 rubi emby-server[63942]:    at Interop.CheckIo(Error error, String path, Boolean isDirectory, Func`2 errorRewriter)
Jan 27 12:48:01 rubi emby-server[63942]:    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
Jan 27 12:48:01 rubi emby-server[63942]:    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
Jan 27 12:48:01 rubi emby-server[63942]:    at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
Jan 27 12:48:01 rubi emby-server[63942]:    at System.IO.Strategies.FileStreamHelpers.ChooseStrategy(FileStream fileStream, String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize)
Jan 27 12:48:01 rubi emby-server[63942]:    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
Jan 27 12:48:01 rubi emby-server[63942]:    at Emby.Server.Implementations.Logging.FileLogger..ctor(String path)
Jan 27 12:48:01 rubi emby-server[63942]:    at Emby.Server.Implementations.Logging.SimpleLogManager.ReloadLogger(LogSeverity severity, CancellationToken cancellationToken)
Jan 27 12:48:01 rubi emby-server[63942]: InnerException: System.IO.IOException: Permission denied
Jan 27 12:48:01 rubi emby-server[63942]: Source:
Jan 27 12:48:01 rubi emby-server[63942]: TargetSite:
Jan 27 12:48:01 rubi systemd[1]: emby-server.service: Succeeded.

It seems the cause of the error is Access to the path '/var/lib/emby/logs/embyserver-1.txt' is denied, which causes an unhadled exception. I temporarily "fixed" this with the "big hammer" approach of chmod -R 777 /var/lib/emby/, but the open issues now are:

  • Why doesn't emby have access to its own log directory?
  • The exception from this event should be handled properly.

@ralyodio
Copy link
Author

i think i had a similar issue with permissions.

@LukePulverenti
Copy link
Member

  • Why doesn't emby have access to its own log directory?
  • The exception from this event should be handled properly.

It is handled properly. If the server can't write to it's own data folder then there is no point in trying to continue further so at this point it should just shut down.

As to why it doesn't have access in the first place, that's the real question. Obviously this is not a common problem, but every once in a while, on trickier setups, something like this might come up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants