Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compose options are not being obeyed #1000

Closed
3 of 6 tasks
ProjectVRD opened this issue Feb 12, 2022 · 6 comments
Closed
3 of 6 tasks

Compose options are not being obeyed #1000

ProjectVRD opened this issue Feb 12, 2022 · 6 comments
Labels

Comments

@ProjectVRD
Copy link

ProjectVRD commented Feb 12, 2022

This is a: Bug

Details

WEBPASSWORD and volumes entries in the docker compose script are not being implemented. No data is placed in to the existing directories that are entered as volume options as seen below, WEBPASSWORD entry is not being set as entered into option when the container has been created.

Related Issues

  • I have searched this repository/Pi-hole forums for existing issues and pull requests that look similar

How to reproduce the issue

  1. Environment data
  • Operating System: DSM 7
  • Hardware: Synology DS220+
  • Kernel Architecture:
  • Docker Install Info and version:
    • Software source: OS provided package
    • Supplimentary Software: portainer - latest
  • Hardware architecture:
  1. docker-compose.yml contents, docker run shell command, or paste a screenshot of any UI based configuration of containers here
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 # Only required if you are using Pi-hole as your DHCP server
      - 34567:80/tcp
    environment:
      - PUID=1026
      - PGID=101
      - TZ=Europe/London
      - WEBPASSWORD=passwordplacedhere
    # Volumes store your data between container upgrades
    volumes:
      - /volume1/docker/pihole:/pihole
      - /volume1/docker/dnsmasq.d:/dnsmasq.d
    #   https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
    cap_add:
      - NET_ADMIN # Recommended but not required (DHCP needs NET_ADMIN)      
    restart: unless-stopped
  1. any additional info to help reproduce

These common fixes didn't work for my issue

  • I have tried removing/destroying my container, and re-creating a new container
  • I have tried fresh volume data by backing up and moving/removing the old volume data
  • I have tried running the stock docker run example(s) in the readme (removing any customizations I added)
  • I have tried a newer or older version of Docker Pi-hole (depending what version the issue started in for me)
  • I have tried running without my volume data mounts to eliminate volumes as the cause

If the above debugging / fixes revealed any new information note it here.
Add any other debugging steps you've taken or theories on root cause that may help.

@PromoFaux
Copy link
Member

      - PUID=1026
      - PGID=101

These are invalid variables, they're not mentioned anywhere in the readme In the next release we will have experimental support for this (See #982)


Do those directories exist on your system? If I just run your compose file as it is (with the path slightly changed to reflect my filesystem) on mine (also Synology DSM7):

admin@syno:/volume1/docker/playground$ docker-compose up
Creating network "playground_default" with the default driver
Creating pihole ... error

ERROR: for pihole  Cannot start service pihole: Bind mount failed: '/volume1/docker/playground/pihole' does not exists

ERROR: for pihole  Cannot start service pihole: Bind mount failed: '/volume1/docker/playground/pihole' does not exists
ERROR: Encountered errors while bringing up the project.

So, after creating those directories:

admin@syno:/volume1/docker/playground$ mkdir pihole
admin@syno:/volume1/docker/playground$ mkdir dnsmasq.d
admin@syno:/volume1/docker/playground$ docker-compose up
Starting pihole ... done
Attaching to pihole
pihole    | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
pihole    | [s6-init] ensuring user provided files have correct perms...exited 0.
pihole    | [fix-attrs.d] applying ownership & permissions fixes...
pihole    | [fix-attrs.d] 01-resolver-resolv: applying...
pihole    | [fix-attrs.d] 01-resolver-resolv: exited 1.
pihole    | [fix-attrs.d] done.
pihole    | [cont-init.d] executing container initialization scripts...
pihole    | [cont-init.d] 20-start.sh: executing...
pihole    |  ::: Starting docker specific checks & setup for docker pihole/pihole
pihole    |
pihole    |   [i] Installing configs from /etc/.pihole...
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
pihole    | chmod: cannot access '/etc/pihole/pihole-FTL.db': No such file or directory
pihole    | Existing DNS servers detected in setupVars.conf. Leaving them alone
pihole    |   [✓] New password set
pihole    | DNSMasq binding to default interface: eth0
pihole    | Added ENV to php:
pihole    |                     "PIHOLE_DOCKER_TAG" => "2022.01.1",
pihole    |                     "PHP_ERROR_LOG" => "/var/log/lighttpd/error.log",
pihole    |                     "ServerIP" => "0.0.0.0",
pihole    |                     "CORS_HOSTS" => "",
pihole    |                     "VIRTUAL_HOST" => "0.0.0.0",
pihole    | Using IPv4 and IPv6
pihole    | ::: setup_blocklists now setting default blocklists up:
pihole    | ::: TIP: Use a docker volume for /etc/pihole/adlists.list if you want to customize for first boot
pihole    | ::: Blocklists (/etc/pihole/adlists.list) now set to:
pihole    | https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
pihole    | ::: Testing pihole-FTL DNS: FTL started!
pihole    | ::: Testing lighttpd config: Syntax OK
pihole    | ::: All config checks passed, cleared for startup ...
pihole    | ::: Enabling Query Logging
pihole    |   [i] Enabling logging...
  [✓] Logging has been enabled!
pihole    |  ::: Docker start setup complete
pihole    |   Checking if custom gravity.db is set in /etc/pihole/pihole-FTL.conf
pihole    |   Pi-hole version is v5.8.1 (Latest: v5.8.1)
pihole    |   AdminLTE version is v5.10.1 (Latest: v5.10.1)
pihole    |   FTL version is v5.13 (Latest: v5.13)
pihole    |   Container tag is: 2022.01.1
pihole    | [cont-init.d] 20-start.sh: exited 0.
pihole    | [cont-init.d] done.
pihole    | [services.d] starting services
pihole    | Starting crond
pihole    | Starting lighttpd
pihole    | Starting pihole-FTL (no-daemon) as pihole
pihole    | [services.d] done.

And as we can see from the below gif, the password is being set correctly:

works

So I'm not so sure there is a bug in the container here...

@ProjectVRD
Copy link
Author

You can ignore me regarding the directory mapping, that was my stupidity with no including /etc/ in the mount paths.

But the password issue remains. If I could find a way to see what the password is that is being used I might get some insight so I will keep looking. Recreating the container says a password is already set, deleting the content from the (now correctly set) volumes states a new password has been set. So I have some investigation to do and I think it should with seeing what the password actually is when the container is created.

@PromoFaux
Copy link
Member

Set the environment variable PH_VERBOSE to 1, which should give some more detailed output during startup

@github-actions
Copy link

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.

@github-actions github-actions bot added the stale label Mar 14, 2022
@PromoFaux
Copy link
Member

@ProjectVRD if you set the password with pihole -a -p, does it work as expected?

Also, if you never got to the bottom of this, does the /etc/pihole/setupVars.conf contain a key/value pair for the password?

@github-actions github-actions bot removed the stale label Mar 16, 2022
@github-actions
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants