ninthwalker / NowShowing

Generates an email and web page of Plex recently added content
MIT License
73 stars 8 forks source link

lighthttpd not starting in container #75

Closed jpezzulli closed 6 years ago

jpezzulli commented 6 years ago

Hey - I am relearning linux again after a 10 year hiatus so please forgive me if this is something simple.

I am running centos 7. have a few other containers up and running. I tried with both mainline v2 and v2-dev and got the same errors. the command I used to start was (dev):

docker run -d --name=nowshowingv2dev --net=bridge -e TZ="America/New_York" -p 6879:6879/tcp -v "/opt/nowshowing":"/config":rw ninthwalker/nowshowing:v2-dev

However the container keeps stopping. The log is below. [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] 10-apply-perms: applying... , [fix-attrs.d] 10-apply-perms: exited 0., [fix-attrs.d] done., [cont-init.d] executing container initialization scripts..., [cont-init.d] 10-set-uidgid: executing... , usermod: no changes, chown: /run/lighttpd: No such file or directory, -----------------------------------------, NowShowing, -----------------------------------------, Brought to you by:, , Ninthwalker/GroxyPod/Limen75, -----------------------------------------, User xyz set to: 99, Group xyz set to: 100, -----------------------------------------, [cont-init.d] 10-set-uidgid: exited 0., [cont-init.d] 20-setup: executing... , Advanced config file detected. Checking version .., Latest 2.0.2 release found. Nothing to update., Sever ready Please go to http://hostIP:hostPort/admin to configure settings [cont-init.d] 20-setup: exited 0. [cont-init.d] done. [services.d] starting services [services.d] done. 2018-04-16 22:41:16: (log.c.217) server started 2018-04-16 22:41:16: (mod_fastcgi.c.1026) bind failed for: unix:/run/lighttpd/lighttpd-fastcgi-php-1205.socket-0 No such file or directory 2018-04-16 22:41:16: (mod_fastcgi.c.1518) [ERROR]: spawning fcgi failed. 2018-04-16 22:41:16: (server.c.1269) Configuration of plugins failed. Going down. lighttpd exited 255 [cont-finish.d] executing container finish scripts... [cont-finish.d] done. [s6-finish] syncing disks. [s6-finish] sending all processes the TERM signal. [s6-finish] sending all processes the KILL signal and exiting.

I looked through you issues threads and I saw one that looked similar but fixed in dev on March 18th due to crond. That is why I moved to dev but the issue persists. Let me know if I can add anything else. Thanks.

ninthwalker commented 6 years ago

The first thing that looks like it is causing your issue is your Docker run command. Your port mapping is off. The internal port is 6878. Most dockers internal ports are set. You can then map it to an external port of your choosing, but it has to go to the internal one of 6878. Take a look at the wiki for a couple exsmples. Let me know if that makes it work for you. Thanks.

https://github.com/ninthwalker/NowShowing/wiki/Other-Docker-Platforms

jpezzulli commented 6 years ago

Damn. That was a typo when I was running the v2dev to test if it would help. Completely understand that the internal port couldnt be changed and you can map it externally. It was late having spent about 3 hours trying to get this up from CLI,, DockerUI, and Portainer. All the same, even if you put the wrong port, I wouldnt expect that to stop the httpd server from starting. I would think you simply wouldnt be able to access it due to a mismatched port forwarding/mapping. this is the normal command.

docker run -d --name=nowshowingv2 --net=bridge -e TZ="America/New_York" -p 6878:6878/tcp -v "/opt/nowshowing":"/config":rw ninthwalker/nowshowing:v2

exact same errors in log chown: /run/lighttpd: No such file or directory ... 2018-04-17 07:05:35: (mod_fastcgi.c.1026) bind failed for: unix:/run/lighttpd/lighttpd-fastcgi-php-1205.socket-0 No such file or directory 2018-04-17 07:05:35: (mod_fastcgi.c.1518) [ERROR]: spawning fcgi failed. 2018-04-17 07:05:35: (server.c.1269) Configuration of plugins failed. Going down. lighttpd exited 255

Tried with v2-dev again this morning.

docker run -d --name=nowshowingv2dev --net=bridge -e TZ="America/New_York" -p 6878:6878/tcp -v "/opt/nowshowing":"/config":rw ninthwalker/nowshowing:v2-dev

Same issue.
Thanks again and dont kill yourself over this. There is no rush on my end. Just seemed like you made a really cool tool and was testing it out before I make my final build in a few months.

ninthwalker commented 6 years ago

Not exactly sure. Although I would start again and do a fresh pull and install from v2.

v2-Dev is for my testing of things before pushing to v2. So I wouldn’t call v2-Dev stable as I break things or change things in there.

Let me know after a fresh v2 install. Thanks.

ninthwalker commented 6 years ago

Oh, also try a fresh volume mapping. Or delete what’s in /opt/nowshowing. Make sure Docker daemon itself if it’s not running as root also has permissions to that /opt/nowshowing path you are mapping to.

jpezzulli commented 6 years ago

I did all that but the docker daemon is required to run as root.

from https://docs.docker.com/engine/security/security/#control-groups Running containers (and applications) with Docker implies running the Docker daemon. This daemon currently requires root privileges, and you should therefore be aware of some important details.

[root@blackhouse opt]# rm -rf nowshowing/ [root@blackhouse opt]# mkdir nowshowingv2 [root@blackhouse opt]# chmod 666 nowshowingv2 [root@blackhouse opt]# docker run -d --name=nowshowingv2 --net=bridge -e TZ="America/New_York" -p 6878:6878/tcp -v "/opt/nowshowingv2":"/config":rw ninthwalker/nowshowing:v2 Unable to find image 'ninthwalker/nowshowing:v2' locally Trying to pull repository docker.io/ninthwalker/nowshowing ... v2: Pulling from docker.io/ninthwalker/nowshowing 550fe1bea624: Pull complete 01778236fdc4: Pull complete 7becac5f8e8d: Pull complete Digest: sha256:50122adb403674bae1f1e1a46abfa295523be91ccf7955809c510ccc9bdb55af Status: Downloaded newer image for docker.io/ninthwalker/nowshowing:v2 7b740bbb18597a2309e374edfcffae76dadd864cccefb03e5f5f0b39748ddd00 [root@blackhouse opt]#

Same log as before.
Volume gets files [root@blackhouse nowshowingv2]# ls announcement_body.html cfg email_body.erb logs web_body.erb www [root@blackhouse nowshowingv2]#

It just cant seem to find lighttpd in the container. Very bizarre [root@blackhouse nowshowingv2]# docker inspect nowshowingv2 [ { "Id": "7b740bbb18597a2309e374edfcffae76dadd864cccefb03e5f5f0b39748ddd00", "Created": "2018-04-17T23:33:18.059565061Z", "Path": "/init", "Args": [ "lighttpd", "-D", "-f", "/etc/lighttpd/lighttpd.conf" ], "State": { "Status": "exited", "Running": false, "Paused": false, "Restarting": false, "OOMKilled": false, "Dead": false, "Pid": 0, "ExitCode": 255, "Error": "", "StartedAt": "2018-04-17T23:46:01.227014007Z", "FinishedAt": "2018-04-17T23:46:07.292046519Z" }, "Image": "sha256:37fc68e00a5ab06bbb56df964d537dac510f7284a3e20d66bf7d83f8ce56f902", "ResolvConfPath": "/var/lib/docker/containers/7b740bbb18597a2309e374edfcffae76dadd864cccefb03e5f5f0b39748ddd00/resolv.conf", "HostnamePath": "/var/lib/docker/containers/7b740bbb18597a2309e374edfcffae76dadd864cccefb03e5f5f0b39748ddd00/hostname", "HostsPath": "/var/lib/docker/containers/7b740bbb18597a2309e374edfcffae76dadd864cccefb03e5f5f0b39748ddd00/hosts", "LogPath": "", "Name": "/nowshowingv2", "RestartCount": 0, "Driver": "overlay2", "MountLabel": "", "ProcessLabel": "", "AppArmorProfile": "", "ExecIDs": null, "HostConfig": { "Binds": [ "/opt/nowshowingv2:/config:rw" ], "ContainerIDFile": "", "LogConfig": { "Type": "journald", "Config": {} }, "NetworkMode": "bridge", "PortBindings": { "6878/tcp": [ { "HostIp": "", "HostPort": "6878" } ] }, "RestartPolicy": { "Name": "no", "MaximumRetryCount": 0 }, "AutoRemove": false, "VolumeDriver": "", "VolumesFrom": null, "CapAdd": null, "CapDrop": null, "Dns": [], "DnsOptions": [], "DnsSearch": [], "ExtraHosts": null, "GroupAdd": null, "IpcMode": "", "Cgroup": "", "Links": null, "OomScoreAdj": 0, "PidMode": "", "Privileged": false, "PublishAllPorts": false, "ReadonlyRootfs": false, "SecurityOpt": null, "UTSMode": "", "UsernsMode": "", "ShmSize": 67108864, "Runtime": "docker-runc", "ConsoleSize": [ 0, 0 ], "Isolation": "", "CpuShares": 0, "Memory": 0, "NanoCpus": 0, "CgroupParent": "", "BlkioWeight": 0, "BlkioWeightDevice": null, "BlkioDeviceReadBps": null, "BlkioDeviceWriteBps": null, "BlkioDeviceReadIOps": null, "BlkioDeviceWriteIOps": null, "CpuPeriod": 0, "CpuQuota": 0, "CpuRealtimePeriod": 0, "CpuRealtimeRuntime": 0, "CpusetCpus": "", "CpusetMems": "", "Devices": [], "DiskQuota": 0, "KernelMemory": 0, "MemoryReservation": 0, "MemorySwap": 0, "MemorySwappiness": -1, "OomKillDisable": false, "PidsLimit": 0, "Ulimits": null, "CpuCount": 0, "CpuPercent": 0, "IOMaximumIOps": 0, "IOMaximumBandwidth": 0 }, "GraphDriver": { "Name": "overlay2", "Data": { "LowerDir": "/var/lib/docker/overlay2/708cfe3da113cf1fbf283889dc5c8f3e41dbe7c55e3bae02fa6eaffb19a97a9c-init/diff:/var/lib/docker/overlay2/7cb2410eeee6ebccc3e47ac390ea56d4f1d8a8d06eea6f452991196650e0b489/diff:/var/lib/docker/overlay2/45b17ae93769545f796ddd68a95b312cdda482f14f392aceda5309a8fceda2a3/diff:/var/lib/docker/overlay2/b481ab7739109b1d4bfeffcd16ce6ad61eecf98b04a8302b2e44d835bfe8ad45/diff", "MergedDir": "/var/lib/docker/overlay2/708cfe3da113cf1fbf283889dc5c8f3e41dbe7c55e3bae02fa6eaffb19a97a9c/merged", "UpperDir": "/var/lib/docker/overlay2/708cfe3da113cf1fbf283889dc5c8f3e41dbe7c55e3bae02fa6eaffb19a97a9c/diff", "WorkDir": "/var/lib/docker/overlay2/708cfe3da113cf1fbf283889dc5c8f3e41dbe7c55e3bae02fa6eaffb19a97a9c/work" } }, "Mounts": [ { "Type": "bind", "Source": "/opt/nowshowingv2", "Destination": "/config", "Mode": "rw", "RW": true, "Propagation": "rprivate" } ], "Config": { "Hostname": "7b740bbb1859", "Domainname": "", "User": "", "AttachStdin": false, "AttachStdout": false, "AttachStderr": false, "ExposedPorts": { "6878/tcp": {} }, "Tty": false, "OpenStdin": false, "StdinOnce": false, "Env": [ "TZ=America/New_York", "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "UPDATED_ON=13APR2018", "NOWSHOWING_VERSION=2.0.2" ], "Cmd": [ "lighttpd", "-D", "-f", "/etc/lighttpd/lighttpd.conf" ], "ArgsEscaped": true, "Image": "ninthwalker/nowshowing:v2", "Volumes": { "/config": {} }, "WorkingDir": "", "Entrypoint": [ "/init" ], "OnBuild": null, "Labels": {} }, "NetworkSettings": { "Bridge": "", "SandboxID": "fc47a990c3c23c81727e1b0e2159b53159aafd42871fca3bc4a0a39dc531a226", "HairpinMode": false, "LinkLocalIPv6Address": "", "LinkLocalIPv6PrefixLen": 0, "Ports": null, "SandboxKey": "/var/run/docker/netns/fc47a990c3c2", "SecondaryIPAddresses": null, "SecondaryIPv6Addresses": null, "EndpointID": "", "Gateway": "", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "IPAddress": "", "IPPrefixLen": 0, "IPv6Gateway": "", "MacAddress": "", "Networks": { "bridge": { "IPAMConfig": null, "Links": null, "Aliases": null, "NetworkID": "feddfdb4f585a1a46ad477a18e112f9880223eeaecdf39d05fef19755f47f22a", "EndpointID": "", "Gateway": "", "IPAddress": "", "IPPrefixLen": 0, "IPv6Gateway": "", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "MacAddress": "" } } } } ] [root@blackhouse nowshowingv2]# docker version Client: Version: 1.13.1 API version: 1.26 Package version: Go version: go1.8.3 Git commit: 774336d/1.13.1 Built: Wed Mar 7 17:06:16 2018 OS/Arch: linux/amd64

Server: Version: 1.13.1 API version: 1.26 (minimum version 1.12) Package version: Go version: go1.8.3 Git commit: 774336d/1.13.1 Built: Wed Mar 7 17:06:16 2018 OS/Arch: linux/amd64 Experimental: false

Thanks. .

ninthwalker commented 6 years ago

So I don't know why/how, but it seems like the dockerfile that creates the docker originally for you during pull is doing something funky.

The one error you get of 'chown: /run/lighttpd: No such file or directory,' is because that path doesn't exist. That path if you look in the dockerfile is created there. So it is failing to create the path, and with no path it can't chown and lighttpd can't write there for what it needs.

I don't know how to fix that for you though. =/ The only other suggestion I have is for you to try to manually build it so youcan watch the process and see if that mkdir /run/lighttpd part fails.

Steps for that would be something like this:

mkdir /tmp/nowshowing_test
cd /tmp/nowshowing_test
git clone https://github.com/ninthwalker/NowShowing.git --branch v2
docker build .
ninthwalker commented 6 years ago

Hi, did you happen to check anything else on your end for this issue yet?

ninthwalker commented 6 years ago

Closing for now. Re-open if it's still an issue. Thanks.