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

pihole-unbound does not start with unbound volume mount #26

Closed
jhomen368 opened this issue Feb 26, 2024 · 7 comments
Closed

pihole-unbound does not start with unbound volume mount #26

jhomen368 opened this issue Feb 26, 2024 · 7 comments

Comments

@jhomen368
Copy link

This is a: Run Issue

Details with Docker log

/opt/unbound/etc/unbound/unbound.conf:345: error: cannot open include file '/opt/unbound/etc/unbound/a-records.conf': No such file or directory
/opt/unbound/etc/unbound/unbound.conf:346: error: cannot open include file '/opt/unbound/etc/unbound/srv-records.conf': No such file or directory
read /opt/unbound/etc/unbound/unbound.conf failed: 2 errors in configuration file
[1708986613] unbound[239:0] fatal error: Could not read config file: /opt/unbound/etc/unbound/unbound.conf. Maybe try unbound -dd, it stays on the commandline to see more errors, or

Related Issues

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

N/A

How to reproduce the issue

  1. Environment data
  • Operating System: Ubunutu (WSL)
  • Hardware: Personal Desktop
  • Kernel Architecture: x86/amd6
  • Docker Install Info and version:
    • Software source: Docker
    • Supplimentary Software: Docker Desktop
  • Hardware architecture: x86
  • Docker Image Tag: latest
  1. Troubleshooting Logs

Works:

docker run -d \
  --name pihole-unbound \
  -e TZ=Europe/London `#optional` \
  -p 53:53/tcp -p 53:53/udp \
  -p 80:80/tcp `#Pi-hole web interface port` \
  -e WEBPASSWORD='pihole' `#better to use single quotes` \
  -v "${PWD}/etc-pihole:/etc/pihole" \
  --restart=always \
  rlabinc/pihole-unbound:latest
CONTAINER ID   IMAGE                           COMMAND                  CREATED          STATUS                    PORTS                                                                NAMES
631fb3cec5ec   rlabinc/pihole-unbound:latest   "/s6-init /unbound.sh"   55 seconds ago   Up 49 seconds (healthy)   0.0.0.0:53->53/tcp, 0.0.0.0:80->80/tcp, 0.0.0.0:53->53/udp, 67/udp   pihole-unbound

Doesn't Work:

Leaves container in a reboot loop

docker run -d \
  --name pihole-unbound \
  -e TZ=Europe/London `#optional` \
  -p 53:53/tcp -p 53:53/udp \
  -p 80:80/tcp `#Pi-hole web interface port` \
  -e WEBPASSWORD='pihole' `#better to use single quotes` \
  -v "${PWD}/etc-pihole:/etc/pihole" \
  -v "${PWD}/opt/unbound/etc/unbound:/opt/unbound/etc/unbound" \
  --restart=always \
  rlabinc/pihole-unbound:latest
CONTAINER ID   IMAGE                           COMMAND                  CREATED              STATUS                          PORTS     NAMES
90667cb7268c   rlabinc/pihole-unbound:latest   "/s6-init /unbound.sh"   About a minute ago   Restarting (1) 10 seconds ago             pihole-unbound

Upload the unbound log file

unbound.log is a 0 byte file with no content

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.

Files seem to exist:

tree -p -u ${PWD}
[drwxr-xr-x jahomen ]  /home/jahomen/unbound-test
├── [drwxrwxr-x 999     ]  etc-pihole
│   ├── [-rw-r--r-- root    ]  adlists.list
│   ├── [-rw-r--r-- root    ]  custom.list
│   ├── [-rw-r--r-- 999     ]  dhcp.leases
│   ├── [-rw-r--r-- root    ]  dns-servers.conf
│   ├── [-rw-rw-r-- 999     ]  gravity.db
│   ├── [-rw-rw-r-- 999     ]  gravity_old.db
│   ├── [-rw-r--r-- root    ]  list.1.raw.githubusercontent.com.domains
│   ├── [-rw-r--r-- root    ]  list.1.raw.githubusercontent.com.domains.sha1
│   ├── [-rw-r--r-- root    ]  local.list
│   ├── [-rw-r--r-- root    ]  logrotate
│   ├── [drwxr-xr-x root    ]  migration_backup
│   │   └── [-rw-r--r-- root    ]  adlists.list
│   ├── [-rw-rw-r-- 999     ]  pihole-FTL.conf
│   ├── [-rw-rw-r-- 999     ]  pihole-FTL.db
│   ├── [-rw-r--r-- root    ]  setupVars.conf
│   ├── [-rw-r--r-- root    ]  setupVars.conf.update.bak
│   └── [-rw-r--r-- root    ]  versions
└── [drwxr-xr-x root    ]  opt
    └── [drwxr-xr-x root    ]  unbound
        └── [drwxr-xr-x root    ]  etc
            └── [drwxr-xr-x root    ]  unbound
                ├── [drwxr-xr-x root    ]  dev
                │   ├── [crw-rw-rw- root    ]  null
                │   ├── [crw-rw-rw- root    ]  random
                │   └── [crw-rw-rw- root    ]  urandom
                ├── [-rw-r--r-- root    ]  unbound.conf
                ├── [-rw-r--r-- jahomen ]  unbound.log
                └── [drwx------ jahomen ]  var
                    ├── [-rw-r--r-- root    ]  root.hints
                    └── [-rw-r--r-- root    ]  root.key

8 directories, 23 files

I also noticed this when I was trying to deploy the container into a Kubernetes cluster, at first I thought it was an issue with my manifests but when I tried it locally it gave me the same behavior. Once I defined the volume for unbound per the readme it starting rebooting and wouldn't come up. Am I missing something?

@jhomen368 jhomen368 changed the title pihole-unbound does not start with custom pihole-unbound does not start with custom unbound mount Feb 26, 2024
@jhomen368 jhomen368 changed the title pihole-unbound does not start with custom unbound mount pihole-unbound does not start with unbound volume mount Feb 26, 2024
@origamiofficial
Copy link
Owner

You can create a directory with the name opt-unbound-etc-unbound & move everything from ${PWD}/opt/unbound/etc/unbound, just like you did with etc-pihole. And then use -v "${PWD}/opt-unbound-etc-unbound:/opt/unbound/etc/unbound"

@jhomen368
Copy link
Author

jhomen368 commented Feb 27, 2024

I was hoping that it would prepopulate default configurations. I just looked at the upstream unbound and it does the same thing so think this is the current expected behavior.

Pre-populating is a bit more difficult with my particular use case since I'm using a Kubernetes cluster with longhorn which does dynamic volume assignment. I'm just guessing but I probably have to spin pihole-unbound pod up, let it fail, down that pod leave leave the volume behind. Finally, mount that volume to another pod (unrelated to pihole) make the changes there detach that volume and then re-spin up the pihole-unbound pod. I'll figure something out thanks though!

@origamiofficial
Copy link
Owner

origamiofficial commented Feb 27, 2024

@jhomen368 I've misread the logs first. It correctly found the unbound.conf but seems the a-records.conf and srv-records.conf files are missing in your custom directory. Copy the missing files a-records.conf and srv-records.conf into the same directory as the unbound.conf file inside the container. Your issue will be fixed.

@jhomen368
Copy link
Author

I put in a feature request for the upstream unbound container MatthewVance/unbound-docker#171.

@origamiofficial
Copy link
Owner

I'm working on it, soon image will be updated.

@jhomen368
Copy link
Author

Thanks! I really appreciate it

@origamiofficial
Copy link
Owner

Pushed hot fix updated image!

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

No branches or pull requests

2 participants