Web Interface not starting after fresh docker install

Hi Everyone!

I'm having some trouble installing Pi-Hole as a docker container. I'm using Portainer for the deployment, but after the container comes up, the WebUI is not available, because of some trouble with lighttpd. Please see the logs below:

Environment information:
Host system is OpenMediaVault 6.0.30-1 (Shaitan) based on Debian 11. Kernel: Linux 5.16.0-0.bpo.4-amd64 x86_64

Docker version:

Client: Docker Engine - Community
 Version:           20.10.21
 API version:       1.41
 Go version:        go1.18.7
 Git commit:        baeda1f
 Built:             Tue Oct 25 18:02:28 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.21
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.18.7
  Git commit:       3056208
  Built:            Tue Oct 25 18:00:19 2022
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.9
  GitCommit:        1c90a442489720eec95342e1789ee8a5e1b9536f
 runc:
  Version:          1.1.4
  GitCommit:        v1.1.4-0-g5fd4c4d
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Portainer version: Standalone 20.10.21

Compose file:

version: "3"

services:
  pihole:
    container_name: pihole
    image: pihole/pihole:latest
    # For DHCP it is recommended to remove these ports and instead add: network_mode: "host"
    ports:
      - "53:53/tcp"
      - "53:53/udp"
     # - "67:67/udp"  Only required if you are using Pi-hole as your DHCP server
      - "80:80/tcp"
    environment:
      TZ: 'Europe/Budapest'
      # WEBPASSWORD: 'set a secure password here or it will be random'
    # Volumes store your data between container upgrades
    volumes:
      - '/srv/dev-disk-by-uuid-1acdc048-0104-4950-ad77-b2ce1eb6df8c/dockerfiles/appdata/pihole/etc-pihole:/etc/pihole'
      - '/srv/dev-disk-by-uuid-1acdc048-0104-4950-ad77-b2ce1eb6df8c/dockerfiles/appdata/pihole/etc-dnsmasq.d:/etc/dnsmasq.d'
    #   https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
    restart: unless-stopped

Container Logs:

[i] All config checks passed, cleared for startup ...
  [i] Docker start setup complete
  [i] pihole-FTL (no-daemon) will be started as pihole
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
  Checking if custom gravity.db is set in /etc/pihole/pihole-FTL.conf
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
Stopping lighttpd
lighttpd: no process found
  [i] Creating new gravity database
  [i] Migrating content of /etc/pihole/adlists.list into new database
  [i] Neutrino emissions detected...

  [✓] Pulling blocklist source list into range
  [i] Preparing new gravity database...
  [✓] Preparing new gravity database
  [i] Using libz compression
  [i] Target: https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
  [i] Status: Pending...Stopping lighttpd
lighttpd: no process found

  [✓] Status: Retrieval successful
  [i] Analyzed 158531 domains
  [i] Creating new gravity databases...
  [✓] Creating new gravity databases
  [i] Storing downloaded domains in new gravity database...Stopping lighttpd
lighttpd: no process found

  [✓] Storing downloaded domains in new gravity database
  [i] Building tree...
  [✓] Building tree
  [i] Swapping databases...
  [✓] Swapping databases
  [✓] The old database remains available.
Stopping lighttpd
lighttpd: no process found
  [i] Number of gravity domains: 158531 (158531 unique domains)
  [i] Number of exact blacklisted domains: 0
  [i] Number of regex blacklist filters: 0
  [i] Number of exact whitelisted domains: 0
  [i] Number of regex whitelist filters: 0
  [i] Cleaning up stray matter...
  [✓] Cleaning up stray matter
  [✗] DNS service is NOT running
Stopping lighttpd
lighttpd: no process found
Stopping lighttpd
lighttpd: no process found
  Pi-hole version is v5.14.1 (Latest: v5.14.1)
  AdminLTE version is v5.17 (Latest: v5.17)
  FTL version is v5.19.1 (Latest: v5.19.1)
  Container tag is: 2022.11
Stopping lighttpd
lighttpd: no process found
Stopping lighttpd
lighttpd: no process found
Stopping lighttpd
lighttpd: no process found
Stopping lighttpd

The last two lines iterates further.

Lighttpd error log:

2022-11-17 09:54:02: server.c.1513) server started (lighttpd/1.4.59)
2022-11-17 09:54:02: gw_backend.c.475) unlink /run/lighttpd/php.socket-0 after connect failed: Permission denied
2022-11-17 09:54:02: gw_backend.c.503) bind failed for: unix:/run/lighttpd/php.socket-0: Permission denied
2022-11-17 09:54:02: gw_backend.c.1655) [ERROR]: spawning gw failed.
2022-11-17 09:54:02: server.c.1517) Configuration of plugins failed. Going down.

I've tried to check the php.socket-0 file permissions, but wasn't able to locate the file in that directory:

root@5b18455728d9:/run/lighttpd# ls -la
total 16
drwxr-xr-x+ 1 www-data www-data 4096 Nov 14 23:36 .
drwxr-----+ 1 root     root     4096 Nov 17 10:09 ..
root@5b18455728d9:/run/lighttpd#

I created a debug file and uploaded to you, token is: https://tricorder.pi-hole.net/QrmXyldX/

Honestly this is the farthest where my basic Linux skill took me, so I would like to kindly ask for your help what could be the possible cause of this issue.

Thank you very much in advance!

You are using "80:80/tcp".

This tells docker to use port 80 on your container and forward it to port 80 on the host, but your host is already using this port (OpenMediaVault uses port 80).

You need to use a different port. Try "8080:80/tcp".
Then, try to access the pi-hole web interface using this port: http://your_server_IP:8080

Thanks for your reply rdwebdesign!

I moved OMV to 8080 after installation, so I intendedly used 80 for Pi-Hole. I forgot to mention in the original post, but I have tried it with different ports from 8081 to 8085, but I observed the same behaviour every time. I removed the stack, container images, data on the volumes with every try, so I started from scratch.

My last iteration - from where I collected logs - is still running, so I could provide information requested by the community.

Your web server (lighttpd) is starting, but it is failing with "Permission denied":

   2022-11-17 10:36:07: server.c.1513) server started (lighttpd/1.4.59)
   2022-11-17 10:36:07: gw_backend.c.475) unlink /run/lighttpd/php.socket-0 after connect failed: Permission denied
   2022-11-17 10:36:07: gw_backend.c.503) bind failed for: unix:/run/lighttpd/php.socket-0: Permission denied
   2022-11-17 10:36:07: gw_backend.c.1655) [ERROR]: spawning gw failed.
   2022-11-17 10:36:07: server.c.1517) Configuration of plugins failed. Going down.

Did you change any user permissions?

No, not that I know of. I haven't used any parameters like that in the compose, and all the logs are coming from right after the container stood up. Haven't changed anything inside the container.

I'm not sure if in any other way I could have done that, but I'm only using "monitoring" commands not to accidentally break something.

Do you run lighttpd as the standard user/group? See lighttpd.init which creates that dir with $owner and $group permissions. Check that /run/lighttpd/ exists and has the expected ownership.

Probably has change network adaptor name

  1. Try to remove network for pihone on docker.
  2. Run ifconfig to see your network adaptor name
  3. Make again docker network for pihole