Jump to content

Crashing emby server on Ubuntu 18.04


el_Pedr0

Recommended Posts

el_Pedr0

Hi,

 

Just tried to watch emby after a few days only to find that it is crashing a few seconds after starting up. Since the last successful start of emby, I've added a movie and a new TV series to my media library. Originally the directory for that particular movie didn't allow the emby user write access and so emby couldn't write the nfo file. I didn't think that was the critical issue, but as it was flagged as an error in the logs, I've changed the permissions on that directory. Now I can't work out what's causing the problem.

 

Log file attached.

System Ubuntu 18.04.

I originally installed emby using:

wget https://github.com/MediaBrowser/Emby.Releases/releases/download/4.4.2.0/emby-server-deb_4.4.2.0_amd64.deb
dpkg -i emby-server-deb_4.4.2.0_amd64.deb

Full disclosure: I run emby as a different user, having followed these instructions (because I use freeipa as a central user management system and my media directories are owned by users and groups within freeipa)

 

Any advice much appreciated.

 

*Edit: Log file now attached.

embyserver.txt

Edited by el_Pedr0
Link to comment
Share on other sites

mastrmind11

Hi,

 

Just tried to watch emby after a few days only to find that it is crashing a few seconds after starting up. Since the last successful start of emby, I've added a movie and a new TV series to my media library. Originally the directory for that particular movie didn't allow the emby user write access and so emby couldn't write the nfo file. I didn't think that was the critical issue, but as it was flagged as an error in the logs, I've changed the permissions on that directory. Now I can't work out what's causing the problem.

 

Log file attached.

System Ubuntu 18.04.

I originally installed emby using:

wget https://github.com/MediaBrowser/Emby.Releases/releases/download/4.4.2.0/emby-server-deb_4.4.2.0_amd64.deb
dpkg -i emby-server-deb_4.4.2.0_amd64.deb

Full disclosure: I run emby as a different user, having followed these instructions (because I use freeipa as a central user management system and my media directories are owned by users and groups within freeipa)

 

Any advice much appreciated.

 

*Edit: Log file now attached.

nothing really stands out in that log.  are you sure thats the whole thing?  it crashes randomly or when you try to play something?  if the latter and you have HA enabled, try disabling it and trying without.

Link to comment
Share on other sites

el_Pedr0

Thanks for your replies.

 

I've updated to 4.4.3 and encounter the same behaviour.

 

Increasingly though I'm starting to think this has something to do with the way I'm running emby as a different user. If I run my two commands:

systemctl disable emby-server@emby --now
systemctl enable emby-server@[member="embyuser"] --now

emby is accessible via a browser on a different machine even though systemctl reports that emby-server has failed!:

# 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: failed (Result: signal) since Wed 2020-06-10 10:27:38 BST; 10min ago
 Main PID: 478 (code=killed, signal=ABRT)

Jun 10 10:27:38 emby emby-server[478]:    at System.IO.FileStream..ctor(String path, FileMode mode, FileAc
Jun 10 10:27:38 emby emby-server[478]:    at System.IO.FileStream..ctor(String path, FileMode mode, FileAc
Jun 10 10:27:38 emby emby-server[478]:    at Emby.Server.Implementations.Logging.FileLogger..ctor(String p
Jun 10 10:27:38 emby emby-server[478]:    at Emby.Server.Implementations.Logging.SimpleLogManager.ReloadLo
Jun 10 10:27:38 emby emby-server[478]:    --- End of inner exception stack trace ---
Jun 10 10:27:38 emby emby-server[478]:    at System.Threading.Tasks.Task.WaitAllCore(Task[] tasks, Int32 m
Jun 10 10:27:38 emby emby-server[478]:    at System.Threading.Tasks.Task.WaitAll(Task[] tasks)
Jun 10 10:27:38 emby emby-server[478]:    at EmbyServer.Program.Main(String[] args)
Jun 10 10:27:38 emby systemd[1]: emby-server.service: Main process exited, code=killed, status=6/ABRT
Jun 10 10:27:38 emby systemd[1]: emby-server.service: Failed with result 'signal'.

I previously concluded that emby was crashing because systemctl status reported that the service had failed and because I couldn't access emby from another device. So now I can't be sure that was the right conclusion because I can see that systemctl status reports failed even when emby server is accessible from another machine.

 

To get access to emby, I have to issue those systemctl commands above after every reboot.

 

 

So, the problems that I need to solve are:

* How do I avoid having to enter those two commands after every reboot?

* What command do I use to get the true status of emby-server (i.e. when it's running as my 'embyuser')?

 

 

P.S. I copied the whole log file, unedited. Now that I look at the logs directory, I can see that there are some other files 'embyserver-637......txt' etc and 'hardware-detection-637.....txt'. Should I have also posted those? I thought it was crashing on booting the server or within seconds of restarting the service (i.e. nothing to do with watching media). But now I'm not sure if that's right - because I don't fully understand systemctl status (see below)

Link to comment
Share on other sites

mastrmind11

Thanks for your replies.

 

I've updated to 4.4.3 and encounter the same behaviour.

 

Increasingly though I'm starting to think this has something to do with the way I'm running emby as a different user. If I run my two commands:

systemctl disable emby-server@emby --now
systemctl enable emby-server@[member="embyuser"] --now

emby is accessible via a browser on a different machine even though systemctl reports that emby-server has failed!:

# 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: failed (Result: signal) since Wed 2020-06-10 10:27:38 BST; 10min ago
 Main PID: 478 (code=killed, signal=ABRT)

Jun 10 10:27:38 emby emby-server[478]:    at System.IO.FileStream..ctor(String path, FileMode mode, FileAc
Jun 10 10:27:38 emby emby-server[478]:    at System.IO.FileStream..ctor(String path, FileMode mode, FileAc
Jun 10 10:27:38 emby emby-server[478]:    at Emby.Server.Implementations.Logging.FileLogger..ctor(String p
Jun 10 10:27:38 emby emby-server[478]:    at Emby.Server.Implementations.Logging.SimpleLogManager.ReloadLo
Jun 10 10:27:38 emby emby-server[478]:    --- End of inner exception stack trace ---
Jun 10 10:27:38 emby emby-server[478]:    at System.Threading.Tasks.Task.WaitAllCore(Task[] tasks, Int32 m
Jun 10 10:27:38 emby emby-server[478]:    at System.Threading.Tasks.Task.WaitAll(Task[] tasks)
Jun 10 10:27:38 emby emby-server[478]:    at EmbyServer.Program.Main(String[] args)
Jun 10 10:27:38 emby systemd[1]: emby-server.service: Main process exited, code=killed, status=6/ABRT
Jun 10 10:27:38 emby systemd[1]: emby-server.service: Failed with result 'signal'.

I previously concluded that emby was crashing because systemctl status reported that the service had failed and because I couldn't access emby from another device. So now I can't be sure that was the right conclusion because I can see that systemctl status reports failed even when emby server is accessible from another machine.

 

To get access to emby, I have to issue those systemctl commands above after every reboot.

 

 

So, the problems that I need to solve are:

* How do I avoid having to enter those two commands after every reboot?

* What command do I use to get the true status of emby-server (i.e. when it's running as my 'embyuser')?

 

 

P.S. I copied the whole log file, unedited. Now that I look at the logs directory, I can see that there are some other files 'embyserver-637......txt' etc and 'hardware-detection-637.....txt'. Should I have also posted those? I thought it was crashing on booting the server or within seconds of restarting the service (i.e. nothing to do with watching media). But now I'm not sure if that's right - because I don't fully understand systemctl status (see below)

have you tried this?  https://emby.media/community/index.php?/topic/78581-how-to-change-the-user-emby-runs-as/?p=869101

Link to comment
Share on other sites

Q-Droid

 

It looks like that's part of what the OP is doing. The other recommendation to modify the systemd unit file directly has a problem in that the next Emby update installed can overwrite the changes. The proper permanent way to change this is with a unit file override that is preserved across updates.

 

systemctl edit emby-server.service

 

Add the service options you want to override using the same format with [service] and [unit] blocks, save and restart. Some of the options append values and some (User,Group) replace them. And you still have to make sure the ownership and permissions in the Emby home and libraries are correct for the runtime user.

Link to comment
Share on other sites

el_Pedr0

 

The proper permanent way to change this is with a unit file override that is preserved across updates.

 

systemctl edit emby-server.service

 

Ooh - that sounds like a new lead. I'll investigate. Thank you

Link to comment
Share on other sites

el_Pedr0

So - I think things are looking good with that change @Q-Droid. Thank you.

Answering some of my own question above for anyone else stumbling across this post:

When running emby as another user, the usual 'systemctl status emby-server' command can report that the service has failed or is inactive, even when emby is up and running. In order to get a true picture, first find out if there is any emby-server instance running by using:

ps -fe | grep emby-server

This will output some text if emby server is running. The first item is the user's name under which the service is running, and the second is the PID of the process.

Now you can use that pid to get the service status:

systemctl status <PID>

Note also then that you can't stop emby-server just using systemctl stop emby-service, because again you need to use the pid instead of the service name to stop it.

Edited by el_Pedr0
Hit enter too soon.
Link to comment
Share on other sites

Q-Droid

What you were likely seeing were the journal entries for the failed service that was using the default user and why PID was needed for the non - default one.  Going forward and with the unit override in place things go back to normal. You should be able to start, stop and get status without having to specify user or PID. 

  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...