unifi-utilities / unifios-utilities

A collection of enhancements for UnifiOS based devices
GNU General Public License v3.0
3.9k stars 419 forks source link

cant get pihole to run #242

Closed justfly1111 closed 2 years ago

justfly1111 commented 3 years ago

Describe the bug cannot get pihole to run

To Reproduce setup onboot podman update install-cni-plugins add-root-ssh-key setup common_container heres a copy and paste of the on_boot.d directory

ls /mnt/data/on_boot.d

01-podman-update.sh 10-wpa_supplicant.sh 20-ntopng-udm.sh 05-container-common.sh 15-add-root-ssh-key.sh 25-add-cron-jobs 05-install-cni-plugins.sh 15-add-ssh-known-hosts.sh 99-udm-le.sh 10-dns.sh 20-dns.conflist rclone 10-rclone.sh 20-dnsipv6.conflist

the shell scripts i currently dont want to run are chmod a-x d which is 10-wpa_supplicant.sh 15-add-ssh-known-hosts.sh 20-dns.conflist 20-dnsipv6.conflist 20-ntopng-udm.sh 25-add-cron-jobs all those are not executable for the time being because i didnt get that far into configuring my udm pro to use them yet.

but currently am following your instructions for setting up pihole and cannot get the docker image up and running bellow is the error message:

step 6 on your run pihole readme says to run /mnt/data/on_boot.d/10-dns.sh i do and get this error;

/bin/sh /mnt/data/on_boot.d/10-dns.sh

RTNETLINK answers: File exists RTNETLINK answers: File exists RTNETLINK answers: File exists podman-dns: Container pihole not found, make sure you set the proper name, you can ignore this error if it is your first time setting it up

then 7 has me make the directories mkdir -p /mnt/data/etc-pihole mkdir -p /mnt/data/pihole/etc-dnsmasq.d i make the dirs then step 8 has me start container mind you i am using all stock as is ips gate ways and servers to match your out of the box settings and plan to change them afer i have all setup a nd configured properly but when trying to run the container i get the following error and this is where i am stuck: podman run -d --network dns --restart always \ --name pihole \ -e TZ="America/Los Angeles" \ -v "/mnt/data/etc-pihole/:/etc/pihole/" \ -v "/mnt/data/pihole/etc-dnsmasq.d/:/etc/dnsmasq.d/" \ --dns=127.0.0.1 \ --dns=1.1.1.1 \ --dns=8.8.8.8 \ --hostname pi.hole \ -e VIRTUAL_HOST="pi.hole" \ -e PROXY_LOCATION="pi.hole" \ -e ServerIP="10.0.5.3" \ -e IPv6="False" \ pihole/pihole:latest

/bin/sh /mnt/data/on_boot.d/10-dns.sh

RTNETLINK answers: File exists RTNETLINK answers: File exists RTNETLINK answers: File exists podman-dns: Container pihole not found, make sure you set the proper name, you can ignore this error if it is your first time setting it up

^C

podman run -d --network dns --restart always \

--name pihole \
-e TZ="America/Los Angeles" \
-v "/mnt/data/etc-pihole/:/etc/pihole/" \
-v "/mnt/data/pihole/etc-dnsmasq.d/:/etc/dnsmasq.d/" \
--dns=127.0.0.1 \
--dns=1.1.1.1 \
--dns=8.8.8.8 \
--hostname pi.hole \
-e VIRTUAL_HOST="pi.hole" \
-e PROXY_LOCATION="pi.hole" \
-e ServerIP="10.0.5.3" \
-e IPv6="False" \
pihole/pihole:latest

ERRO[0000] error loading cached network config: network "dns" not found in CNI cache WARN[0000] falling back to loading from existing plugins on disk Error: error configuring network namespace for container 4e5fe1ec827aaed80c08360b47e9fe1b150b82b61a41787282dbb36abc16011e: error adding pod pihole_pihole to CNI network "dns": invalid args PUT YOUR GENERATED OWN MAC HERE for MAC addr: address PUT YOUR GENERATED OWN MAC HERE: invalid MAC address

this is completely different error then i got earlier before it said that network dns did not exist but this erorr what MAC address do i put in the MAC for my udm or do i generate a random MAC address and if so how do i do so?? Expected behavior

justfly1111 commented 3 years ago

so i removed container pihole and tried with my udm pros mac address and got this error which i believe is directly tied to the bug i submitted directly before this one about no longer being able to successfuly execute unifi-os shell anylonger

heres the output of trying to start this container

podman container rm pihole

4e5fe1ec827aaed80c08360b47e9fe1b150b82b61a41787282dbb36abc16011e

podman run -d --network dns --restart always \

--name pihole \
-e TZ="America/Los Angeles" \
-v "/mnt/data/etc-pihole/:/etc/pihole/" \
-v "/mnt/data/pihole/etc-dnsmasq.d/:/etc/dnsmasq.d/" \
--dns=127.0.0.1 \
--dns=1.1.1.1 \
--dns=8.8.8.8 \
--hostname pi.hole \
-e VIRTUAL_HOST="pi.hole" \
-e PROXY_LOCATION="pi.hole" \
-e ServerIP="10.0.5.3" \
-e IPv6="False" \
pihole/pihole:latest

WARN[0000] Failed to add conmon to cgroupfs sandbox cgroup: open /sys/fs/cgroup/libpod_parent/conmon/cpuset.cpus: open /sys/fs/cgroup/libpod_parent/conmon/cpuset.cpus.effective: no such file or directory Error: OCI runtime error: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: process_linux.go:508: setting cgroup config for procHooks process caused: bpf_prog_query(BPF_CGROUP_DEVICE) failed: function not implemented

please tell me youre able to help me with this thank you so much

pedropombeiro commented 2 years ago

What version of UniFi OS are you running? I had to downgrade from the latest to 1.10.4, otherwise I saw some errors.

boostchicken commented 2 years ago

You are getting this error because you upgraded podman, please revert back to stock podman

marceldarvas commented 2 years ago

@boostchicken what do you mean by stock podman? Ever since the 1.11 update I have been having issues with podman...

I have followed your suggestion https://github.com/boostchicken-dev/udm-utilities/issues/288#issuecomment-992404375 and have reverted back to podman 3.4.2 but I am getting a similar error as listed above:

"container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: process_linux.go:508: setting cgroup config for procHooks process caused: bpf_prog_query(BPF_CGROUP_DEVICE) failed: function not implemented

logankaser commented 2 years ago

@marceldarvas sorry to @ you, but did you ever resolve this? I'm running into this first time using this repository having made no change to the podman version only using the stock https://github.com/unifi-utilities/unifios-utilities/blob/main/podman-update/01-podman-update.sh

marceldarvas commented 2 years ago

@logankaser Yeah, I had a variety of issues with the podman update script... I am unsure how I resolved this one particularly. While I have a Pi-hole instance on my UDM right now, I've relied primarily on a Raspberry Pi since the Unifi updates have made these significant changes (I think I struggled to figure out why my UDM Pihole DNS queries were struggling to reach some DNS servers I specified; probably some firewall issue 😆 ). [ Btw. If you don't have a Pi available (due to supply shortage, go on eBay and look for a USFF and install Proxmox on there (lots of opportunities to virtualize stuff) ]

I remember following my instructions, which helped if I made a mistake... It might be helpful to you: https://github.com/unifi-utilities/unifios-utilities/issues/288#issuecomment-1001225564

boostchicken commented 2 years ago

@logankaser the podman update broke at 1.11, I dont know if it ever can be fixed. What is your issue? I would recommend not using it unless you ABSOLUTELY have to.

marceldarvas commented 2 years ago

@boostchicken Yes, that's what I've been afraid of...

Can you please clarify (maybe include clearer explanation in Readme) the podman-update component?

In the Features, it says: Podman 3.2.0 (w/ updated conmon, and runc), so I went checked mine

# podman -v podman version 1.6.1

UDM Information

Variant: UDM Firmware Version: 1.12.22 Controller Version: 7.1.68

Which seems to be the outdated standard. Should I just not touch it?

JoeOIVOV commented 2 years ago

@boostchicken Yes, that's what I've been afraid of...

Can you please clarify (maybe include clearer explanation in Readme) the podman-update component?

In the Features, it says: Podman 3.2.0 (w/ updated conmon, and runc), so I went checked mine

# podman -v podman version 1.6.1

UDM Information

Variant: UDM Firmware Version: 1.12.22 Controller Version: 7.1.68

Which seems to be the outdated standard. Should I just not touch it?

01-podman-update.sh won't work with that firmware. I downgraded to 1.10.4 and it works after adding the script to the on_boot.d directory and downloading the Podman zip from Actions tab and copying the files over the top of the root filesystem and it works.

Either backup your settings and downgrade, and restore, or just leave it.