pi-hole / docker-pi-hole

Pi-hole in a docker container
https://pi-hole.net
Other
8.51k stars 1.13k forks source link

404 on ServerIP #559

Closed kaihendry closed 2 years ago

kaihendry commented 4 years ago

Description

[hendry@t480s ~]$ curl http://192.168.1.4/admin/
404 page not found
[hendry@t480s ~]$ ssh pi@192.168.1.4
Last login: Wed Jan 29 13:37:13 2020 from 192.168.1.25
pi@four:~$  curl http://192.168.1.4/admin/
404 page not found
pi@four:~$  curl -I http://localhost/admin/
HTTP/1.1 200 OK
X-Pi-hole: The Pi-hole Web interface is working!
X-Frame-Options: DENY
Set-Cookie: PHPSESSID=et4rkegfsq14m6h24gq0imu8h6; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Content-type: text/html; charset=UTF-8
Date: Wed, 29 Jan 2020 13:38:03 GMT
Server: lighttpd/1.4.45

One day http://192.168.1.4/admin/ stopped working. How can I get it working again? I'm running the latest image.

version: "3"

# More info at https://github.com/pi-hole/docker-pi-hole/ and https://docs.pi-hole.net/
services:
  pihole:
    container_name: pihole
    image: pihole/pihole:latest
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "67:67/udp"
      - "80:80/tcp"
      - "443:443/tcp"
    environment:
      - TZ=Asia/Singapore
    volumes:
       - './etc-pihole/:/etc/pihole/'
       - './etc-dnsmasq.d/:/etc/dnsmasq.d/'
    dns:
      - 127.0.0.1
      - 1.1.1.1
    restart: unless-stopped
NazarKosteckij commented 4 years ago

This should help you

    environment:
      - TZ=Asia/Singapore
      - ServerIP=192.168.1.4
kaihendry commented 4 years ago

Thanks, but it doesn't appear to work: https://s.natalian.org/2020-02-05/pihole.txt

NazarKosteckij commented 4 years ago

This docker-compose.yml config definetly works

version: "3"

# More info at https://github.com/pi-hole/docker-pi-hole/ and https://docs.pi-hole.net/
services:
  pihole:
    container_name: pihole
    image: pihole/pihole:latest
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "67:67/udp"
      - "80:80/tcp"
      - "443:443/tcp"
    environment:
      - TZ=Asia/Singapore
      - ServerIP=172.27.131.141
    volumes:
       - './etc-pihole/:/etc/pihole/'
       - './etc-dnsmasq.d/:/etc/dnsmasq.d/'
    dns:
      - 127.0.0.1
      - 1.1.1.1
    restart: unless-stopped

image

PromoFaux commented 4 years ago

@kaihendry Saw your comment on HN.. is this still an issue with the v5.0 container?

I've been running my main Pi-hole install under docker for some time now and have not seen this issue myself. FWIW, my compose file:

version: '3.5'
services:

  pihole:
    container_name: pihole
    depends_on:
      - unbound
    image: pihole/pihole:v5.0
    environment:
      - TZ=Europe/London
      - ServerIP=192.168.1.253
      - DNS1=192.168.1.254#53
      - DNS2=no
      - HOST_IP=192.168.1.253
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ./pihole/resolv.conf:/etc/resolv.conf
      - ./pihole/configs/pihole/:/etc/pihole/
      - ./pihole/configs/dnsmasq.d:/etc/dnsmasq.d/
    ports:
      - "53:53/tcp"
      - "67:67/udp" # Uncomment if you want to use Pi-Hole for DHCP
      - "53:53/udp"
    expose:
      - "80"
    mac_address: d0:ca:ab:cd:ef:fe
    networks:
      home:
        ipv4_address: 192.168.1.253
    dns:
      - 127.0.0.1
    cap_add:
      - NET_ADMIN
    restart: always
kaihendry commented 4 years ago

Don't quite understand the unbound dependency and the mac_address line.

You bind localtime and ipv4_address, and then that's duplicated in the env?

This sucks quite a bit.

PromoFaux commented 4 years ago

Oh, sorry, yes I'm also running an unbound container (ETA - That's what DNS1 is pointed at), but I left it out for brevity.

I may or may not be doing some non-standard stuff in my compose file, I'm a total novice when it comes to docker. This was hobbled together after reading several subjects on the matter.

The mac address is because I'm using macvlan for all of my docker containers.

There is probably room for improvement, but it works, and I'm happy with that. Point is, I don't have any issues with the web interface. Per my original question, do you still have the same problem when using the v5.0 tag?

kaihendry commented 4 years ago

I did a Docker compose pull and the log says I'm using v5, still the same problem.

https://s.natalian.org/2020-05-11/docker-compose.yml

PromoFaux commented 4 years ago

On the host system, what is the output of netstat -tulpn | grep 80

I'm now wondering if you have something else listening on port 80 on the host (though, I know that makes no sense because the container should have complained if there was...)

kaihendry commented 4 years ago

Nope, nothing run on port 80. Can you try my docker-compose.yml?

PromoFaux commented 4 years ago

Just span up a fresh debian droplet on Digitalocean, installed docker, installed docker-compose, used your compose file and I am able to access the web interface with no issues.

I don't currently have a raspberry pi to test this on.

Only difference is the headers I get on the curl request, not entirely sure what the reason for that is

image

image

diginc commented 4 years ago

What Pi hardware is this on?

And these questions might require uploading a pastbin or other text site doc with all the output since its a lot.

sbkg0002 commented 3 years ago

I have the same issue on the x86 image.

sbkg0002 commented 3 years ago

Fixed it by upgrading containerd

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Please comment or update this issue or it will be closed in 5 days.

PromoFaux commented 2 years ago

Closing as this is likely an issue with an older container. I See one commenter said they fixed it by upgrading containerd. As this was last commented on over a year ago, I will close for now. Please feel free to reopen if it is still a probelm