Closed PromoFaux closed 2 years ago
Question from @PromoFaux to @ryancastro
@ryancastro likely a different issue in your case.
Inside your running pihole container, what is the value of the
server.port
setting in/etc/lighttpd/lighttpd.conf
?
Reply:
server.port = 80
A nice, static port 80.
If it's unrelated, I'll hope not to muddy this original issue up. Maybe I jumped the gun and assumed it was just the same, since it was on :latest with presumably same symptoms. Thoughts? I appreciate the quick help, @PromoFaux !
The other issue is a network configuration issue by the looks of things, this may actually be a bug.. though might take me a while to get to the bottom of it
It's not something I have come across before because I don't use HOST mode for my network (rather, macvlan)
Relevant code:
Do you see Custom WEB_PORT set to
in the startup log of you container?
That said - It is working OK for me.. 🙃
Edit:
And the same using your compose file above:
So I just checked - I had a pihole image pulled from 4 weeks ago (whatever that was), and that was my :latest. I just pulled down the latest image and tried again... works!
Adam - sorry for the trouble. I'm not new to pihole but I'm very new to docker. I really appreciate your amazingly fast responses. It looks like I am in good shape now. Thank you very, very much for taking the time.
That whole section of code has not been touched for 5 years, so... who knows?! Computers do weird stuff sometimes ;)
To anyone searching this in the future: if the basic_install.sh fails during the container's startup then the WEB_HOST code will never be reached.
In my case I was seeing Operation not permitted
(rootless podman)
$ podman logs pihole
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service cron: starting
s6-rc: info: service cron successfully started
s6-rc: info: service _uid-gid-changer: starting
s6-rc: info: service _uid-gid-changer successfully started
s6-rc: info: service _startup: starting
[i] Starting docker specific checks & setup for docker pihole/pihole
[i] Setting capabilities on pihole-FTL where possible
[i] Applying the following caps to pihole-FTL:
* CAP_CHOWN
* CAP_NET_BIND_SERVICE
[i] Ensuring basic configuration by re-running select functions from basic-install.sh
[i] Installing configs from /etc/.pihole...
[i] Existing dnsmasq.conf found... it is not a Pi-hole file, leaving alone!
[✓] Installed /etc/dnsmasq.d/01-pihole.conf
[✓] Installed /etc/dnsmasq.d/06-rfc6761.conf
/etc/.pihole/automated install/basic-install.sh: line 1362: /etc/pihole/dns-servers.conf: Permission denied
s6-rc: info: service _startup successfully started
s6-rc: info: service pihole-FTL: starting
s6-rc: info: service pihole-FTL successfully started
s6-rc: info: service lighttpd: starting
s6-rc: info: service lighttpd successfully started
s6-rc: info: service _postFTL: starting
s6-rc: info: service _postFTL successfully started
s6-rc: info: service legacy-services: starting
Checking if custom gravity.db is set in /etc/pihole/pihole-FTL.conf
s6-rc: info: service legacy-services successfully started
chown: changing ownership of '/etc/pihole/dhcp.leases': Operation not permitted
chown: changing ownership of '/etc/pihole': Operation not permitted
chmod: changing permissions of '/etc/pihole/dhcp.leases': Operation not permitted
2024-04-28 20:11:23: network.c.369) can't bind to socket: 0.0.0.0:80: Address already in use
Stopping lighttpd
lighttpd: no process found
Notice how the permission error was about https://github.com/pi-hole/pi-hole/blob/master/automated%20install/basic-install.sh#L1362 ...
Unfortunately everything else seems fine - this doesn't crash the container. I wish it would have.
Anyway somehow the -v ./path/to/pihole:/etc/pihole/
permissions were wrong. Doing chown $USER:$USER -R ./path/to/pihole
and a restart fixed it.
Hope this helps someone else!
I'm actually experiencing something very similar. here's my docker-compose:
In this configuration, I'm forwarding through CloudFlared, I'm also running in host network mode because I'm doing DHCP and that was easiest.
I did create a static IP address through piholenet for CloudFlared, but pihole isn't using it, so I don't think it's related. WEB_PORT appears to be completely ignored, no matter what I set that value to, Pihole listens on port 80.
Originally posted by @ryancastro in https://github.com/pi-hole/docker-pi-hole/issues/1134#issuecomment-1179623714