linuxserver / docker-plex

GNU General Public License v3.0
1.12k stars 199 forks source link

Plex container created and run OK but web UI never shows up #113

Closed moshemarciano closed 6 years ago

moshemarciano commented 6 years ago

installed docker image on a centos 7 host (VirtualBox vm), with 5 other active containers (all from linuxserver, all working well and accessible from other computers on the lan), container starts, logs looks good, but web UI says connection refused and no preferences.xml file generated and no real application logs run

I tried many types of forms of the create command, one typical variant is:

docker create \
--name=plex \
--net=host \
-e VERSION=latest \
-v /media/sf_docker/plex/config:/config \
-v /media/sf_movies:/movies \
-v /media/sf_external:/external \
-v /media/sf_movies:/data/tvshows \
-v /media/sf_movies:/data/movies \
-v /media/sf_movies/transcode:/transcode \
-e TZ=Europe/London \
-e PGID=1000 -e PUID=1000 \
--restart=always \
linuxserver/plex

Note I used UID=1000 (actual user) , when I tried with root UID=0 I got the "Starting Plex Media Server." loop endlessly in the log

[root@server ~]# docker logs -f plex
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 10-adduser: executing... 
usermod: no changes

-------------------------------------
          _     _ _
         | |___| (_) ___
         | / __| | |/ _ \ 
         | \__ \ | | (_) |
         |_|___/ |_|\___/
               |_|

Brought to you by linuxserver.io
We gratefully accept donations at:
https://www.linuxserver.io/donations/
-------------------------------------
GID/UID
-------------------------------------
User uid:    911
User gid:    911
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-dbus: executing... 
[cont-init.d] 30-dbus: exited 0.
[cont-init.d] 40-chown-files: executing... 
Change in ownership detected, please be patient while we chown existing files
This could take some time
[cont-init.d] 40-chown-files: exited 0.
[cont-init.d] 50-plex-update: executing... 

#####################################################
#   Login via the webui at http://<ip>:32400/web    #
#   and restart the docker, because there was no    #
#   preference file found, possibly first startup.  #
#####################################################

[cont-init.d] 50-plex-update: exited 0.
[cont-init.d] done.
[services.d] starting services
Starting dbus-daemon
Starting Plex Media Server.
[services.d] done.
Starting Avahi daemon
Found user 'avahi' (UID 106) and group 'avahi' (GID 107).
Successfully dropped root privileges.
avahi-daemon 0.6.32-rc starting up.
No service file found in /etc/avahi/services.
Joining mDNS multicast group on interface eth0.IPv4 with address 172.17.0.7.
New relevant interface eth0.IPv4 for mDNS.
Network interface enumeration completed.
Registering new address record for 172.17.0.7 on eth0.IPv4.
Server startup complete. Host name is 25538db58496.local. Local service cookie is 3125834757.

Still, Plex isn't coming up. I get connection refused even while doing docker exec -i -t plex /bin/bash curl http://172.17.0.1:32400/web

or

curl http://127.0.0.1:32400/web

getting

curl: (7) Failed to connect to 127.0.0.1 port 32400: Connection refused

I also tried the host IP and external IP

also netstat -l from within the container doesn't show the port 32400 as listening

ps -ef shows the server is running

UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 12:20 ?        00:00:00 s6-svscan -t0 /var/run/s6/services
root        32     1  0 12:20 ?        00:00:00 s6-supervise s6-fdholderd
root       258     1  0 12:20 ?        00:00:00 s6-supervise avahi
root       259     1  0 12:20 ?        00:00:00 s6-supervise plex
root       260     1  0 12:20 ?        00:00:00 s6-supervise dbus
avahi      261   258  0 12:20 ?        00:00:00 avahi-daemon: running [25538db58496.local]
abc        263   259  0 12:20 ?        00:00:00 /usr/lib/plexmediaserver/Plex Media Server
message+   265   260  0 12:20 ?        00:00:00 dbus-daemon --system --nofork
root       286     0  0 12:25 pts/0    00:00:00 /bin/bash
root       299   286  0 12:26 pts/0    00:00:00 ps -ef

UPDATE: found out that the culprit is the plex docker image and virtualbox, I setup the config and media folders to be one mounted by virtualbox from the hosting OSX machine.

turns out if I start the container with root user 0:0, it will send plex into loop of starting plex server... log lines

if I use virtualbox mounted folder it will start ok but never listen on port 32400.

I tried to fix it using chmod and even add the user to the docker group or virtualbox group, it had no affect on the filesystem for some reason.

the only way to make it work is keep the config local, in my case inside the virtualbox VM which kind of sucks backup wise, I would prefer it to be on my OSX machine filesystem too

SConaway commented 6 years ago

You might be able to put it on a disk image. (Preferably ext4)

matthewdias commented 6 years ago

@moshemarciano did you ever find a solution to this?

billd100 commented 4 years ago

I was having a similar issue except my fix involved adding an entry to UFW. Not sure if this is the ideal solution but what I did was : sudo ufw allow from <CLIENT_IP> to any port 32400

I got here by checking the ufw logs at /var/log/ufw.log and also that I was able to proxy via ssh port 32400 on the host: ssh <USER>@<HOST_IP> -L 32400:<HOST_IP>:32400 -N