Jump to content

Emby exits with System.NullReferenceException and Zero Byte Log Files


Kolomona

Recommended Posts

Kolomona

Are there any mitigation options available?

I can get the server to run just fine with the following command:
 

$ sudo /opt/emby-server/bin/emby-server -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb

I just can't get the service to start, so I have to keep my terminal open :(

Link to comment
Share on other sites

That's actually the best workaround i've seen so far. The problem is we have never reproduced this ourselves, it's only been about five users and we believe the issue is tied to the .net core ticket I linked to above.

Link to comment
Share on other sites

Kolomona

HA! I believe I fixed it!

 

I was on the right track when I set my local to en_US.UTF-8

But for some reason I didn't set the LANG env variable

I got the idea for this fix from this URL https://github.com/dotnet/corefx/issues/37630

 

TLDR: Make sure LANG is set to en_US.UTF-8 (If you have a different local, make sure it's not set to C.UTF-8)

$ locale
LANG=C.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8

Notice that the LANG=C.UTF-8 NOT en_US.UTF-8

 

So I did the following:

$ sudo update-locale LANG=en_US.UTF-8

$ sudo reboot

$ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8

~$ sudo service emby-server status
● 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: active (running) since Sun 2019-05-19 21:58:25 UTC; 43s ago
 Main PID: 908 (EmbyServer)
    Tasks: 15 (limit: 2361)
   CGroup: /system.slice/emby-server.service
           └─908 /opt/emby-server/system/EmbyServer -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-serv

May 19 21:58:33 KmCreations emby-server[908]: Info App: SyncRepository Initialize write lock taken
May 19 21:58:33 KmCreations emby-server[908]: Info App: Entry point completed: Emby.Server.Sync.SyncManagerEntryPoint. Duration: 0.0149967 seconds
May 19 21:58:33 KmCreations emby-server[908]: Info App: Starting entry point Emby.Server.Sync.SyncNotificationEntryPoint
May 19 21:58:33 KmCreations emby-server[908]: Info App: Entry point completed: Emby.Server.Sync.SyncNotificationEntryPoint. Duration: 0.0055851 seconds
May 19 21:58:33 KmCreations emby-server[908]: Info App: Starting entry point EmbyServer.Windows.LoopUtilEntryPoint
May 19 21:58:33 KmCreations emby-server[908]: Info App: Entry point completed: EmbyServer.Windows.LoopUtilEntryPoint. Duration: 0.0004747 seconds
May 19 21:58:33 KmCreations emby-server[908]: Info App: All entry points have started
May 19 21:58:33 KmCreations emby-server[908]: Application started. Press Ctrl+C to shut down.
May 19 21:58:33 KmCreations emby-server[908]: Hosting environment: Production
May 19 21:58:33 KmCreations emby-server[908]: Content root path: /opt/emby-server/system/

SUCCESS!

 

The server loaded on reboot and appears to functioning.

 

It also seems to have fixed my zero byte log files issue!

$ ls -al /var/lib/emby/logs/
total 180
drwxr-xr-x  2 emby emby   4096 May 19 21:59 .
drwxr-xr-x 10 emby emby   4096 May  7 15:18 ..
-rw-r--r--  1 emby emby  49271 May 19 22:00 embyserver.txt
-rw-r--r--  1 emby emby 117113 May 19 21:58 hardware_detection-63693899913.txt

I don't have time right now to fully test. If I run into any other issues I'll post them

 

Thanks @@Luke for trying to help me with this. Your questioning me about my locale was key to figuring it out.

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...