Jump to content

Docker


Luke

Recommended Posts

Hi,

 

I've been using Emby Docker on Unraid for nearly two years, and for the last 18 - 20 months all has worked superbly (a minor issue on the Live TV M3U, but other than that it has worked flawlessly).

 

However for the past 2 months I have been getting random crashes in Emby Docker (twice today, unhandled exception logs attached). Anyone have any idea why this is happening as its spoiling what is a great product.

 

Is this happening to anyone else, is it really unique to me (usually is). What can I do to fix it?

 

Im running Emby Docker Version 3.5.3.0 on Unraid Version: 6.6.3 and I believe this started when I updated Emby Docker to the latest version. I don't believe it happened on the previous version, but equally, I could be wrong.

 

I remember reading about disabling a plug-in (audiodb) from this link:

 

https://emby.media/community/index.php?/topic/62313-bug-systemnetsocketssocketexception-since-352/

 

Which I've done, but as you can see from the logs, It's still happening.

 

Cheers

 

Hi there, try removing your music library, then running a complete library scan, and then adding the music library back. Thanks.

Link to comment
Share on other sites

sluggo45

You should update UnRaid to the latest stable, 6.6.6. As I recall there have  been several Docker bugs fixed over the last few releases including one http timeout problem that was in 6.6.3. No guarantee that will fix your problem but it's the first place I would start, good to do regardless.

Link to comment
Share on other sites

I have no issues on my emby unraid.  I wish I did it years ago (the unraid thing).  Its fantastic.

  • Like 1
Link to comment
Share on other sites

I have now updated Unraid to v.6.6.6. Rather than nuking the music folder and re-scanning it (as mentioned above, I have already done this once before) I am following this post to update the database manually:

 

https://emby.media/community/index.php?/topic/61373-emby-server-crashes-when-using-search/

 

However, the issue is changing the permissions on the \appdata\EmbyServer\data folder in order to delete the Library.db file (and I assume the .db-shm and .db-wal files as well), then copy over the modified Library files after updating the database through DB Browser for SQLite.

 

Anyone know how to change permissions on the EmbyServer folder within Unraid so that I can delete the files from Windows (I am afterall a Windows Man at heart), I just can't seem to find how to do it.

 

I know, someone is going to come back and say ask on the Unraid forum, but I thought I'd try here first.

Edited by apefray
Link to comment
Share on other sites

sluggo45

If you have Unraid's docker service set up with the defaults then the persistent data folders for containers are in /mnt/user/appdata/<name_of_container>

 

So for example, if your container is called EmbyServer (if you are using the beta it's probably EmbyServerBeta) then you just go to /mnt/user/appdata/EmbyServer.

 

You can open a console shell in Unraid easily, it's built in to the UI, the menu item "Terminal".

 

Open that and cd to /mnt/user/appdata/EmbyServer (or whatever your path is). Then just change the permissions you need. In Linux it's chmod i.e. "chmod 777 library.db". "rm" will delete it.

 

Make sure this is what you need to do first, obviously. Seems strange but if that is how the other thread specifies fixing the problem....

Link to comment
Share on other sites

Thanks sluggo45.

 

I have a backup of the database, and a modified database according to those instructions. I just need to delete what is there, then copy the modified database which hopefully will fix the audiodb problem.

 

If all goes belly up, I can just copy the original database back :)

Link to comment
Share on other sites

Im Back, no surprise there

 

I have accessed the terminal in Unraid, and have changed the permissions as per sluggo45's post. That was the easy part (well it was once I figured the correct path to the data folder on my cache drive for embyserver).

 

I copied all 3 library files (.db .db-shm & .db-wal) to my Windows directory andI can rename the library.db file to library.db_old through the terminal, no problem there (I do this as a safeguard in case I need to restore). I then do the update on the database as per the above link and write the changes back to the database.

 

The issue comes, when I try to copy the library files back to the data folder, when I paste to the folder its coming up with:

 

You need permission to preform this action.

 

You require permission from Unix User\daemon to make changes to this file

 

How do I grant permission from the daemon user in windows? I currently have a mapped drive to the cache disk, so clicking on the mapped drive allows me access in Windows, and indeed I can copy files from the cache drive to windows, but cannot copy them back? So close it seems, yet so far..............

 

Cheers

Link to comment
Share on other sites

Sorry Luke, forget the above I realised my stupidity trying to copy between Windows and the data folder.

 

All I needed to do was copy the library.db files to windows (as a backup), then open the library database in sqlite from the data folder, run the update command then write the changes back.

 

Its as simple as that, grrrrrr.

 

Well, Emby is back up and running, lets see if this fixes the netsocket errors once and for-all.

 

(note to oneself, must change the permissions back)

Edited by apefray
Link to comment
Share on other sites

Yeah, it is really weird. It seems to happen always right around that same point when LibraryMonitor tasks start going. And docker doesn't restart the container either which is odd.

Are you still running into this?

Link to comment
Share on other sites

NikeSwe

You could do it like this:

 

Open terminal to Unraid server

cd /mnt/user/appdata/EmbyServerBeta <- could be different if not running beta.

chmod -R 777 *

This will change all permissions for the files to rw-rw-rw as Unraid does when we transfer files using Samba. The problem is that when Emby creates new files, they will not have the rw-rw-rw-permissions.

Edited by NikeSwe
Link to comment
Share on other sites

AppleSeed

Hi !

 

I try to use the docker image with HW trancoding (Nvidia), but I don't know how to do. I see pmalek has the same problem few pages ago.

 

The docker image doesn't include Nvidia driver, so do you plan to include them, or do we must build an other one ? It's pretty hard to build docker image with nvidia driver included, if you have some clues ?

 

Thanks !

Link to comment
Share on other sites

sluggo45

Hi !

 

I try to use the docker image with HW trancoding (Nvidia), but I don't know how to do. I see pmalek has the same problem few pages ago.

 

The docker image doesn't include Nvidia driver, so do you plan to include them, or do we must build an other one ? It's pretty hard to build docker image with nvidia driver included, if you have some clues ?

 

Thanks !

 

It's not going to work. Docker has access to the underlying hardware of the host OS, not drivers installed in the container - that isn't how containers work, they aren't VMs - and Unraid doesn't include Nvidia drivers. Support for the latter via Unraid has been an open request for some time.

 

Even with the driver present accessing the hardware via a Docker container is still problematic.

 

If you really want Nvidia hw support - and don't forget, consumer GeForce cards are limited to 2 streams, you need a Quattro card for more - you are best served by creating a VM and passing the card through to it. Then install Plex/Emby in the VM. That will work.

Edited by sluggo45
Link to comment
Share on other sites

AppleSeed

Ok thanks ! I admit I have some trouble to understand how docker works with drivers :) 

 

The problem with the passthrough it's that only one VM can use the graphic card.

 

For the limitation, there are some patch on github to remove it.

Link to comment
Share on other sites

sluggo45

Ok thanks ! I admit I have some trouble to understand how docker works with drivers :)

 

The problem with the passthrough it's that only one VM can use the graphic card.

 

For the limitation, there are some patch on github to remove it.

 

If you're talking about the Ubuntu kernel patch (the only one I'm aware of) that is also going to lock you in to using a VM. And not the most reliable method in the world though some folks seem ok with it.

 

The overly-simple explanation: Containers separate binaries/libraries - userspace, essentially - from each other but run on top of a common OS. Device drivers are part of the OS, in kernel-land. The upshot is your Docker containers are only going to support whatever hardware Unraid OS supports, and the latter doesn't support Nvidia.

A Virtual Machine is its own OS and if you can pass hardware through to it and the OS you've virtualized supports it, you can use it, though as you've noted you can't share passed-through hardware like this.

 

There a particular reason you need a GPU for transcoding? Weak CPU? I've never found hardware accelerated decoding/encoding to be as good as software, quality-wise, though granted some stuff like HEVC cries out for it.

Link to comment
Share on other sites

AppleSeed

I don't think it's the same workaround about the limitation, in my case it's just replace some instructions into libnvidia-encode.so

 

Thanks for the explanation :) I will do other tests !

 

About the GPU, I have some 4k stuff and low CPU (Pentium D1508). Moreover, I use the GPU with tensorflow.

 

Edit: after some tests, I understand how to do, and it's preatty easy !

Just need nvidia-docker2 on the system, and set up the default runtime to nvidia in the configuration of the docker's daemon. After that, start the docker with env variable "-e NVIDIA_VISIBLE_DEVICES=all -e NVIDIA_DRIVER_CAPABILITIES=compute,utility,video"

Edited by AppleSeed
Link to comment
Share on other sites

  • 2 weeks later...

Hi all,

 

I've just updated my CUDA drivers to version 10 and I cannot get transcoding to work. I'm running emby (currently version 4.0.0.1) in Docker with the following Dockerfile 

FROM alpine:latest AS builder

ARG VERSION=3.6.0.46

RUN apk update \
 && apk add wget ca-certificates \
 && wget --progress=bar:force -O /emby.deb \
   https://github.com/MediaBrowser/Emby.Releases/releases/download/${VERSION}/emby-server-deb_${VERSION}_amd64.deb

FROM nvidia/video-codec-sdk:8.2-ubuntu18.04
COPY --from=builder /emby.deb /emby.deb
RUN (dpkg -i /emby.deb ; true) \
 && echo /opt/emby-server/lib/ >> /etc/ld.so.conf \
 && echo /opt/emby-server/lib/samba >> /etc/ld.so.conf \
 && ldconfig

ENTRYPOINT ["/opt/emby-server/bin/emby-server"]

Logs

embyserver.txt https://pastebin.com/8KTsdNUB

hardware_detection.txt https://pastebin.com/xT52f9F1

ffmpeg-transcode https://pastebin.com/5wCQ9D6s

 

Any clues why this might not work?

 

executing ffmpeg in containers returns the following:

root@259f4dbd38a3:/# /opt/emby-server/bin/ffmpeg
ffmpeg version 4.0.2-emby_2018_12_09 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 6.3.0 (crosstool-NG crosstool-ng-1.23.0)
  configuration: --cc=x86_64-pc-linux-gnu-gcc --arch=x86_64 --prefix=/home/embybuilder/Buildbot/x64/ffmpeg-x64/staging --pkg-config=pkg-config --disable-doc --disable-ffplay --disable-vdpau --disable-xlib --enable-fontconfig --enable-gnutls --enable-gpl --enable-iconv --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libwebp --enable-libx264 --enable-libzvbi --enable-version3 --enable-libsmbclient --enable-cuda --enable-cuvid --enable-libmfx --enable-nvenc --enable-vaapi --enable-cross-compile --cross-prefix=x86_64-pc-linux-gnu- --extra-libs='-lexpat -lfreetype -lfribidi -lfontconfig -liconv -lpng -lz -lvorbis -logg -lnettle -lhogweed -lgmp -laddns-samba4 -lasn1util-samba4 -lauthkrb5-samba4 -lCHARSET3-samba4 -lcliauth-samba4 -lcli-cldap-samba4 -lcli-ldap-common-samba4 -lcli-nbt-samba4 -lcli-smb-common-samba4 -lcom_err -lcommon-auth-samba4 -ldbwrap-samba4 -ldcerpc-binding -ldcerpc-samba-samba4 -ldl -lflag-mapping-samba4 -lgenrand-samba4 -lgensec-samba4 -lgse-samba4 -lgssapi_krb5 -llibcli-lsa3-samba4 -llibsmb-samba4 -linterfaces-samba4 -liov-buf-samba4 -lk5crypto -lkrb5 -lkrb5samba-samba4
-lkrb5support -lldb -lldbsamba-samba4 -lmessages-dgm-samba4 -lmessages-util-samba4 -lmsghdr-samba4 -lmsrpc3-samba4 -lndr -lndr-krb5pac -lndr-nbt -lndr-samba-samba4 -lndr-standard -lreplace-samba4 -lsamba-cluster-support-samba4 -lsamba-credentials -lsamba-debug-samba4 -lsamba-errors -lsamba-hostconfig -lsamba-modules-samba4 -lsamba-security-samba4 -lsamba-sockets-samba4 -lsamba-util -lsamba3-util-samba4 -lsamdb -lsamdb-common-samba4 -lsecrets3-samba4 -lserver-id-db-samba4 -lserver-role-samba4 -lsmbconf -lsmbd-shim-samba4 -lsmb-transport-samba4 -lsocket-blocking-samba4 -lsys-rw-samba4 -ltalloc -ltalloc-report-samba4 -ltdb -ltdb-wrap-samba4 -ltevent -ltevent-util -ltime-basic-samba4 -lutil-cmdline-samba4 -lutil-reg-samba4 -lutil-setid-samba4 -lutil-tdb-samba4 -luuid -lwbclient -lwinbind-client-samba4 -ldrm' --target-os=linux --enable-shared --disable-static
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'

I'm 100% certain hardware acceleration is not working since that's easy to verify with e.g. nvidia-smi (when I launch ffmpeg with hw accel on host it spikes to 100% whereas it doesn't budge when I launch a movie with specified quality different than the original)

Link to comment
Share on other sites

Hi all,

 

I've just updated my CUDA drivers to version 10 and I cannot get transcoding to work. I'm running emby (currently version 4.0.0.1) in Docker with the following Dockerfile 

FROM alpine:latest AS builder

ARG VERSION=3.6.0.46

RUN apk update \
 && apk add wget ca-certificates \
 && wget --progress=bar:force -O /emby.deb \
   https://github.com/MediaBrowser/Emby.Releases/releases/download/${VERSION}/emby-server-deb_${VERSION}_amd64.deb

FROM nvidia/video-codec-sdk:8.2-ubuntu18.04
COPY --from=builder /emby.deb /emby.deb
RUN (dpkg -i /emby.deb ; true) \
 && echo /opt/emby-server/lib/ >> /etc/ld.so.conf \
 && echo /opt/emby-server/lib/samba >> /etc/ld.so.conf \
 && ldconfig

ENTRYPOINT ["/opt/emby-server/bin/emby-server"]

 

@@pmalek

 

Version 3.6.0.46 ?

 

Do you have Emby Premiere?

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