Unable to get Pi-hole working when following etcher-featured project

Hello @jezmck, indeed it looks like the project wasn’t pushed successfully to the device.

Are you pushing with the balena-cli?
Could you try pushing it again with balena-cli and share the push log so that I can take a look.

Another thing you could try is reverting back the dnscryot, that looks like the last update. https://github.com/klutchell/balena-pihole/commit/6d72ac3e7977eb7634cdb38dc5857f1d65834449

Thank you

Hi, thanks for looking.

Yep, pushed with balena-cli, doesn’t appear to have failed though; the services run.
Downgrading dnscrypt hasn’t changed anything as far as I can see.

D:\Dev\balena\balena-pihole>balena push pihole
[Info]            Starting build for pihole, user gh_jezmck
[Info]            Dashboard link: https://dashboard.balena-cloud.com/apps/1457102/devices
[Info]            Building on arm03
[Info]            Pulling previous images for caching purposes...
[Success]         Successfully pulled cache images
[pihole]          Step 1/17 : FROM balenalib/raspberrypi3-debian:latest-build AS build
[dnscrypt-proxy]  Step 1/6 : FROM klutchell/dnscrypt-proxy:2.0.23-arm
[pihole]           ---> 77514e80e43b
[pihole]          Step 2/17 : WORKDIR /usr/src
[pihole]          Using cache
[pihole]           ---> c0c22bcc7177
[pihole]          Step 3/17 : RUN install_packages cmake libraspberrypi-dev
[dnscrypt-proxy]   ---> cf68aaf47edd
[dnscrypt-proxy]  Step 2/6 : ARG server_names="['scaleway-fr', 'cloudflare']"
[pihole]          Using cache
[pihole]           ---> d7e909e06628
[pihole]          Step 4/17 : RUN curl -sSL https://raw.githubusercontent.com/tasanakorn/rpi-fbcp/master/CMakeLists.txt -O
[dnscrypt-proxy]  Using cache
[dnscrypt-proxy]   ---> 4382f9d4bf36
[dnscrypt-proxy]  Step 3/6 : RUN sed -r "s/^(# )?dnscrypt_servers = .+$/dnscrypt_servers = true/" -i /config/dnscrypt-proxy.toml
[pihole]          Using cache
[pihole]           ---> 8062efc09308
[pihole]          Step 5/17 : RUN curl -sSL https://raw.githubusercontent.com/tasanakorn/rpi-fbcp/master/main.c -O
[dnscrypt-proxy]  Using cache
[dnscrypt-proxy]   ---> a9f09455f9af
[pihole]          Using cache
[pihole]           ---> 0e8ba228519f
[pihole]          Step 6/17 : WORKDIR /usr/src/build
[pihole]          Using cache
[pihole]           ---> b8f008721ca3
[pihole]          Step 7/17 : RUN cmake .. && make
[dnscrypt-proxy]  Step 4/6 : RUN sed -r "s/^(# )?doh_servers = .+$/doh_servers = true/" -i /config/dnscrypt-proxy.toml
[dnscrypt-proxy]  Using cache
[dnscrypt-proxy]   ---> 3f996eb86d49
[dnscrypt-proxy]  Step 5/6 : RUN sed -r "s/^(# )?require_dnssec = .+$/require_dnssec = true/" -i /config/dnscrypt-proxy.toml
[dnscrypt-proxy]  Using cache
[dnscrypt-proxy]   ---> c5f70adb2ff3
[dnscrypt-proxy]  Step 6/6 : RUN sed -r "s/^(# )?require_nolog = .+$/require_nolog = true/" -i /config/dnscrypt-proxy.toml
[dnscrypt-proxy]  Using cache
[dnscrypt-proxy]   ---> 442d619699c9
[dnscrypt-proxy]  Successfully built 442d619699c9
[pihole]          Using cache
[pihole]           ---> 7ead5985357b
[pihole]          Step 8/17 : FROM pihole/pihole:4.2.2-1_armhf
[pihole]           ---> 412361a41707
[pihole]          Step 9/17 : WORKDIR /usr/src
[pihole]          Using cache
[pihole]           ---> 58f538474b37
[pihole]          Step 10/17 : COPY --from=build /opt/vc/lib/* /opt/vc/lib/
[pihole]          Using cache
[pihole]           ---> c9ecd6b877be
[pihole]          Step 11/17 : COPY --from=build /usr/src/build/fbcp /usr/src/
[pihole]          Using cache
[pihole]           ---> cf3de63f3051
[pihole]          Step 12/17 : COPY services/ /etc/services.d/
[pihole]           ---> 7ed5e1c065fc
[pihole]          Removing intermediate container 21d7e6642316
[pihole]          Step 13/17 : COPY init/ /etc/cont-init.d/
[pihole]           ---> b2d944c86ec5
[pihole]          Removing intermediate container 9708572bae58
[pihole]          Step 14/17 : RUN sed -i '/$AUTHORIZED_HOSTNAMES = array(/ a "balena-devices.com",' /var/www/html/admin/scripts/pi-hole/php/auth.php
[pihole]           ---> Running in 5f80356cdfa9
[pihole]           ---> 47a9bf86bf3b
[pihole]          Removing intermediate container 5f80356cdfa9
[pihole]          Step 15/17 : RUN echo "bind-interfaces" >> /etc/dnsmasq.conf
[pihole]           ---> Running in c20423ea2339
[pihole]           ---> 3d72ddde86c3
[pihole]          Removing intermediate container c20423ea2339
[pihole]          Step 16/17 : RUN curl -fsSL https://raw.githubusercontent.com/jpmck/PADD/master/padd.sh -O    && chmod +x padd.sh
[pihole]           ---> Running in 76bbe6ca2019
[pihole]           ---> dc25ce72e7ae
[pihole]          Removing intermediate container 76bbe6ca2019
[pihole]          Step 17/17 : RUN curl -sSL https://v.firebog.net/hosts/lists.php?type=tick -o /etc/pihole/adlists.list
[pihole]           ---> Running in c0366b4eece4
[pihole]           ---> ae6cad7332bd
[pihole]          Removing intermediate container c0366b4eece4
[pihole]          Successfully built ae6cad7332bd
[Info]            Uploading images
[Success]         Successfully uploaded images
[Success]         Release successfully created!
[Info]            Release: 78a9e560209bfe731f91f54cda63cfaa (id: 909346)
[Info]            ┌────────────────┬────────────┬────────────┐
[Info]            │ Service        │ Image Size │ Build Time │
[Info]            ├────────────────┼────────────┼────────────┤
[Info]            │ pihole         │ 271.19 MB  │ 16 seconds │
[Info]            ├────────────────┼────────────┼────────────┤
[Info]            │ dnscrypt-proxy │ 19.06 MB   │ < 1 second │
[Info]            └────────────────┴────────────┴────────────┘
[Info]            Build finished in 26 seconds
                            \
                             \
                              \\
                               \\
                                >\/7
                            _.-(6'  \
                           (=___._/` \
                                )  \ |
                               /   / |
                              /    > /
                             j    < _\
                         _.-' :      ``.
                         \ r=._\        `.
                        <`\\_  \         .`-.
                         \ r-7  `-. ._  ' .  `\
                          \`,      `-.`7  7)   )
                           \/         \|  \'  / `-._
                                      ||    .'
                                       \\  (
                                        >\  >
                                    ,.-' >.'
                                   <.'_.''
                                     <'
Received SIGINT, cleaning up. Please wait.

D:\Dev\balena\balena-pihole>

after downgrading dnscrypt:

D:\Dev\balena\balena-pihole>balena push pihole
[Info]            Starting build for pihole, user gh_jezmck
[Info]            Dashboard link: https://dashboard.balena-cloud.com/apps/1457102/devices
[Info]            Building on arm03
[Info]            Pulling previous images for caching purposes...
[Success]         Successfully pulled cache images
[dnscrypt-proxy]  Step 1/6 : FROM klutchell/dnscrypt-proxy:2.0.21-arm
[pihole]          Step 1/17 : FROM balenalib/raspberrypi3-debian:latest-build AS build
[dnscrypt-proxy]   ---> 1517b3a4f054
[dnscrypt-proxy]  Step 2/6 : ARG server_names="['scaleway-fr', 'cloudflare']"
[pihole]           ---> 77514e80e43b
[pihole]          Step 2/17 : WORKDIR /usr/src
[pihole]          Using cache
[pihole]           ---> c0c22bcc7177
[pihole]          Step 3/17 : RUN install_packages cmake libraspberrypi-dev
[pihole]          Using cache
[pihole]           ---> d7e909e06628
[pihole]          Step 4/17 : RUN curl -sSL https://raw.githubusercontent.com/tasanakorn/rpi-fbcp/master/CMakeLists.txt -O
[pihole]          Using cache
[pihole]           ---> 8062efc09308
[pihole]          Step 5/17 : RUN curl -sSL https://raw.githubusercontent.com/tasanakorn/rpi-fbcp/master/main.c -O
[pihole]          Using cache
[pihole]           ---> 0e8ba228519f
[pihole]          Step 6/17 : WORKDIR /usr/src/build
[pihole]          Using cache
[pihole]           ---> b8f008721ca3
[pihole]          Step 7/17 : RUN cmake .. && make
[pihole]          Using cache
[pihole]           ---> 7ead5985357b
[pihole]          Step 8/17 : FROM pihole/pihole:4.2.2-1_armhf
[dnscrypt-proxy]   ---> Running in 78e7994533ea
[pihole]           ---> 412361a41707
[pihole]          Step 9/17 : WORKDIR /usr/src
[pihole]          Using cache
[pihole]           ---> d98d3dfe429c
[pihole]          Step 10/17 : COPY --from=build /opt/vc/lib/* /opt/vc/lib/
[dnscrypt-proxy]   ---> fdb1cf48b7cb
[dnscrypt-proxy]  Removing intermediate container 78e7994533ea
[dnscrypt-proxy]  Step 3/6 : RUN sed -r "s/^(# )?dnscrypt_servers = .+$/dnscrypt_servers = true/" -i /config/dnscrypt-proxy.toml
[dnscrypt-proxy]   ---> Running in 9c52d88fb5f3
[dnscrypt-proxy]   ---> 710b79dc57f2
[dnscrypt-proxy]  Removing intermediate container 9c52d88fb5f3
[dnscrypt-proxy]  Step 4/6 : RUN sed -r "s/^(# )?doh_servers = .+$/doh_servers = true/" -i /config/dnscrypt-proxy.toml
[dnscrypt-proxy]   ---> Running in 4438bb1d16c4
[dnscrypt-proxy]   ---> 12c93e7a0ec1
[dnscrypt-proxy]  Removing intermediate container 4438bb1d16c4
[dnscrypt-proxy]  Step 5/6 : RUN sed -r "s/^(# )?require_dnssec = .+$/require_dnssec = true/" -i /config/dnscrypt-proxy.toml
[dnscrypt-proxy]   ---> Running in 21737eef685d
[dnscrypt-proxy]   ---> f0542bc75678
[dnscrypt-proxy]  Removing intermediate container 21737eef685d
[dnscrypt-proxy]  Step 6/6 : RUN sed -r "s/^(# )?require_nolog = .+$/require_nolog = true/" -i /config/dnscrypt-proxy.toml
[dnscrypt-proxy]   ---> Running in 8df278378c59
[dnscrypt-proxy]   ---> f5b01f165f9d
[dnscrypt-proxy]  Removing intermediate container 8df278378c59
[dnscrypt-proxy]  Successfully built f5b01f165f9d
[pihole]          Using cache
[pihole]           ---> 21598b56e377
[pihole]          Step 11/17 : COPY --from=build /usr/src/build/fbcp /usr/src/
[pihole]          Using cache
[pihole]           ---> edaf8a81ce1b
[pihole]          Step 12/17 : COPY services/ /etc/services.d/
[pihole]          Using cache
[pihole]           ---> 32b778e2d608
[pihole]          Step 13/17 : COPY init/ /etc/cont-init.d/
[pihole]          Using cache
[pihole]           ---> 47dbd3aa1cca
[pihole]          Step 14/17 : RUN sed -i '/$AUTHORIZED_HOSTNAMES = array(/ a "balena-devices.com",' /var/www/html/admin/scripts/pi-hole/php/auth.php
[pihole]          Using cache
[pihole]           ---> b2b24f857c83
[pihole]          Step 15/17 : RUN echo "bind-interfaces" >> /etc/dnsmasq.conf
[pihole]          Using cache
[pihole]           ---> a0c297c8ddd5
[pihole]          Step 16/17 : RUN curl -fsSL https://raw.githubusercontent.com/jpmck/PADD/master/padd.sh -O    && chmod +x padd.sh
[pihole]          Using cache
[pihole]           ---> 83134b64642f
[pihole]          Step 17/17 : RUN curl -sSL https://v.firebog.net/hosts/lists.php?type=tick -o /etc/pihole/adlists.list
[pihole]          Using cache
[pihole]           ---> ae6cad7332bd
[pihole]          Successfully built ae6cad7332bd
[Info]            Uploading images
[Success]         Successfully uploaded images
[Success]         Release successfully created!
[Info]            Release: f1646c7abc4c4dfe70359d3eccce30c6 (id: 909999)
[Info]            ┌────────────────┬────────────┬────────────┐
[Info]            │ Service        │ Image Size │ Build Time │
[Info]            ├────────────────┼────────────┼────────────┤
[Info]            │ pihole         │ 271.19 MB  │ 11 seconds │
[Info]            ├────────────────┼────────────┼────────────┤
[Info]            │ dnscrypt-proxy │ 22.01 MB   │ 4 seconds  │
[Info]            └────────────────┴────────────┴────────────┘
[Info]            Build finished in 26 seconds
                            \
                             \
                              \\
                               \\
                                >\/7
                            _.-(6'  \
                           (=___._/` \
                                )  \ |
                               /   / |
                              /    > /
                             j    < _\
                         _.-' :      ``.
                         \ r=._\        `.
                        <`\\_  \         .`-.
                         \ r-7  `-. ._  ' .  `\
                          \`,      `-.`7  7)   )
                           \/         \|  \'  / `-._
                                      ||    .'
                                       \\  (
                                        >\  >
                                    ,.-' >.'
                                   <.'_.''
                                     <'
Received SIGINT, cleaning up. Please wait.

D:\Dev\balena\balena-pihole>

It does seem that the dnscrypt-proxy is in a loop of (running, stopping, downloading, installing).

Hey @jezmck I’ve just set up a fresh device and am able to reproduce this so I’ll work out what’s happening and get back to you!

1 Like

OK @jezmck, if you remove your DNS1 and DNS2 entries and reboot your device, Pi-hole is going to start working. Right now it’s dependent on dnscrypt-proxy to start pihole; although the service says running, the internal services aren’t, which is why you can’t get to the web interface.

dnscrypt-proxy is failing to start because of this bug in the balena supervisor, but if you disable the DNS variables as mentioned above, Pi-hole will still work without it until the fix is deployed. You can also fully comment out the dnscrypt-proxy block within docker-compose.yml to just remove it for now.

Thanks for posting about the issue; I will update the guide/docs in whatever way we can so that other users aren’t caught by this.

Edit: as an alternative workaround, you can use balenaOS version v2.31.5 when adding your device to the application, which isn’t affected by the issue mentioned above and should work fine out of the box.

2 Likes

I followed the same article and had the same issue with dnscrypt-proxy. I applied the workaround mentioned above. While I am able to see the admin page. The server is no longer resolving DNS queries, so my router falls back onto my ISP’s DNS servers.

@habibkalia welcome to the forums! If you can see the admin page it’s likely everything is working correctly. I would try testing it by configuring the DNS of a single computer to point to your Pi-hole device, and see what happens then.

I tried removing the DNS1 and DNS2 variables and rebooting, but still couldn’t see it, though it seemed to have fixed the loop issue.

I’ve also tried commenting out the dnscrypt-proxy section as you suggest, pushing, and still no luck :frowning_face:; I still couldn’t see the web page.

Now trying the earlier version of balenaOS, also with no dnscrypt-proxy.

Still no luck. So it seems I have another issue.

Hey @jezmck , not sure if it will help at all, but just to make sure you are running/pushed the absolute latest version of the project. I see there were some very recent fixes pushed https://github.com/klutchell/balena-pihole/issues/9#issuecomment-490590063

No luck with that @shaunmulligan.

I’m going to try the simple-server-python project instead, check that that also works (as the node one did).

It didn’t work:

10.05.19 19:08:45 (+0100) Restarting service 'main sha256:e020348034d683bba7062f9c6fb60bde09ae325a7a32d6b4452d19c9830ef00f'
10.05.19 19:08:46 (+0100)  main  Traceback (most recent call last):
10.05.19 19:08:46 (+0100)  main    File "src/main.py", line 1, in <module>
10.05.19 19:08:46 (+0100)  main      from flask import Flask
10.05.19 19:08:46 (+0100)  main  ImportError: No module named 'flask'
10.05.19 19:08:48 (+0100) Service exited 'main sha256:e020348034d683bba7062f9c6fb60bde09ae325a7a32d6b4452d19c9830ef00f'

That’s with balenaOS 2.31.5+rev1 development version.

I’m close to giving up again on Balena, but really don’t want to.

Support access granted:
https://dashboard.balena-cloud.com/devices/da94f71773ef1c08abbdb31bd78bc158/summary

Hi @jezmck is the log from the PiHole project code from here pushed to the device?

Because it seems like you have only a single main service, while the current code of the project has two services, pihole and dnscrypt-proxy as shown here https://github.com/klutchell/balena-pihole/blob/6d72ac3e7977eb7634cdb38dc5857f1d65834449/docker-compose.yml

How did you deploy the code? Using balena push?

One note, sorry, I misread, the log is from the simple-server-python project, checking that out in that understanding. Apologies.

Yeah, there’s an issue with the Python base image in that project, and results in the problem as you mentioned, checking it with our base image maintainer, and thanks for the report!

1 Like

@jezmck we’re obviously having trouble figuring out what’s going wrong for you on the Pi-hole project. In your initial pushes of the app at the start of this thread it looked like everything was successful, but you encountered an issue with dnscrypt that I was able to reproduce and correct.

After that you said you downgraded the OS and pushed the project again? Did you delete your local copy and download the project from GitHub again? I’d be happy to take a look at your device if you can get it to the state where you have successfully pushed the Pi-hole project again; looking at simple-server-python probably isn’t going to be much help :slight_smile:

If you can download a fresh copy of the Pi-hole project and push it successfully as you did initially, share the device with us in this state, hopefully we can figure out what’s going wrong.

1 Like

Okay, done.

Back to balenaOS 2.32.0+rev1 but development this time.

Not a fresh clone of the repo, but is up to date and no uncommitted changes.

The services both run without error, but still nothing available on my local IP address, nor on the public device URL. :frowning:

https://dashboard.balena-cloud.com/devices/033571602d155ff4a5724ba40a50bd44/summary

Here’s the push log:

D:\Dev\balena\balena-pihole>..\balena-cli\balena.exe push pihole
[Info]            Starting build for pihole, user gh_jezmck
[Info]            Dashboard link: https://dashboard.balena-cloud.com/apps/1461518/devices
[Info]            Building on arm01
[Info]            Pulling previous images for caching purposes...
[Success]         Successfully pulled cache images
[pihole]          Step 1/17 : FROM balenalib/raspberrypi3-debian:latest-build AS build
[dnscrypt-proxy]  Step 1/6 : FROM klutchell/dnscrypt-proxy:2.0.23-arm
[pihole]           ---> f3018c0089bf
[pihole]          Step 2/17 : WORKDIR /usr/src
[dnscrypt-proxy]   ---> e74135075cf8
[dnscrypt-proxy]  Step 2/6 : ARG server_names="['scaleway-fr', 'cloudflare']"
[dnscrypt-proxy]   ---> Running in 69d1af366044
[pihole]           ---> 900c85879f18
[pihole]          Removing intermediate container e5b1e7609fc5
[pihole]          Step 3/17 : RUN install_packages cmake libraspberrypi-dev
[dnscrypt-proxy]   ---> 075fa83fe7a4
[dnscrypt-proxy]  Removing intermediate container 69d1af366044
[dnscrypt-proxy]  Step 3/6 : RUN sed -r "s/^(# )?dnscrypt_servers = .+$/dnscrypt_servers = true/" -i /config/dnscrypt-proxy.toml
[pihole]           ---> Running in d7e8ff284f5d
[dnscrypt-proxy]   ---> Running in 65a95ddd852d
[dnscrypt-proxy]   ---> 5cc8c495b3d0
[dnscrypt-proxy]  Removing intermediate container 65a95ddd852d
[dnscrypt-proxy]  Step 4/6 : RUN sed -r "s/^(# )?doh_servers = .+$/doh_servers = true/" -i /config/dnscrypt-proxy.toml
[dnscrypt-proxy]   ---> Running in 27985b24cf81
[dnscrypt-proxy]   ---> dfb78072496e
[dnscrypt-proxy]  Removing intermediate container 27985b24cf81
[dnscrypt-proxy]  Step 5/6 : RUN sed -r "s/^(# )?require_dnssec = .+$/require_dnssec = true/" -i /config/dnscrypt-proxy.toml
[dnscrypt-proxy]   ---> Running in 6ffb556be16a
[dnscrypt-proxy]   ---> e3e971d46c96
[dnscrypt-proxy]  Removing intermediate container 6ffb556be16a
[dnscrypt-proxy]  Step 6/6 : RUN sed -r "s/^(# )?require_nolog = .+$/require_nolog = true/" -i /config/dnscrypt-proxy.toml
[dnscrypt-proxy]   ---> Running in 0e1b7059dc88
[dnscrypt-proxy]   ---> a5c21117100d
[dnscrypt-proxy]  Removing intermediate container 0e1b7059dc88
[dnscrypt-proxy]  Successfully built a5c21117100d
[pihole]          Reading package lists...
[pihole]          Building dependency tree...
[pihole]          Reading state information...
[pihole]          The following additional packages will be installed:
[pihole]            cmake-data libarchive13 libjsoncpp1 libuv1
[pihole]          Suggested packages:
[pihole]            codeblocks eclipse ninja-build lrzip
[pihole]          The following NEW packages will be installed:
[pihole]            cmake cmake-data libarchive13 libjsoncpp1 libraspberrypi-dev libuv1
[pihole]          0 upgraded, 6 newly installed, 0 to remove and 27 not upgraded.
[pihole]          Need to get 4665 kB of archives.
[pihole]          After this operation, 20.5 MB of additional disk space will be used.
[pihole]          Get:1 http://deb.debian.org/debian stretch/main armhf cmake-data all 3.7.2-1 [1216 kB]
[pihole]          Get:2 http://deb.debian.org/debian stretch/main armhf libarchive13 armhf 3.2.2-2+deb9u1 [260 kB]
[pihole]          Get:3 http://deb.debian.org/debian stretch/main armhf libjsoncpp1 armhf 1.7.4-3 [67.8 kB]
[pihole]          Get:4 http://deb.debian.org/debian stretch/main armhf cmake armhf 3.7.2-1 [2629 kB]
[pihole]          Get:5 http://archive.raspberrypi.org/debian stretch/main armhf libuv1 armhf 1.18.0-3~bpo9+1 [86.3 kB]
[pihole]          Get:6 http://archive.raspberrypi.org/debian stretch/main armhf libraspberrypi-dev armhf 1.20190401-1 [405 kB]
[pihole]          debconf: delaying package configuration, since apt-utils is not installed
[pihole]          
[pihole]          Fetched 4665 kB in 0s (9674 kB/s)
[pihole]          Selecting previously unselected package cmake-data.
[pihole]          (Reading database ...
(Reading database ... 65%g database ... 5%
[pihole]          (Reading database ... 70%
[pihole]          (Reading database ... 75%
[pihole]          (Reading database ... 80%
[pihole]          (Reading database ... 85%
[pihole]          (Reading database ... 90%
[pihole]          (Reading database ... 95%
(Reading database ... 29780 files and directories currently installed.)
[pihole]          Preparing to unpack .../0-cmake-data_3.7.2-1_all.deb ...
[pihole]          Unpacking cmake-data (3.7.2-1) ...
[pihole]          Selecting previously unselected package libarchive13:armhf.
[pihole]          Preparing to unpack .../1-libarchive13_3.2.2-2+deb9u1_armhf.deb ...
[pihole]          Unpacking libarchive13:armhf (3.2.2-2+deb9u1) ...
[pihole]          Selecting previously unselected package libjsoncpp1:armhf.
[pihole]          Preparing to unpack .../2-libjsoncpp1_1.7.4-3_armhf.deb ...
[pihole]          Unpacking libjsoncpp1:armhf (1.7.4-3) ...
[pihole]          Selecting previously unselected package libuv1:armhf.
[pihole]          Preparing to unpack .../3-libuv1_1.18.0-3~bpo9+1_armhf.deb ...
[pihole]          Unpacking libuv1:armhf (1.18.0-3~bpo9+1) ...
[pihole]          Selecting previously unselected package cmake.
[pihole]          Preparing to unpack .../4-cmake_3.7.2-1_armhf.deb ...
[pihole]          Unpacking cmake (3.7.2-1) ...
[pihole]          Selecting previously unselected package libraspberrypi-dev.
[pihole]          Preparing to unpack .../5-libraspberrypi-dev_1.20190401-1_armhf.deb ...
[pihole]          Unpacking libraspberrypi-dev (1.20190401-1) ...
[pihole]          Setting up libarchive13:armhf (3.2.2-2+deb9u1) ...
[pihole]          Setting up libuv1:armhf (1.18.0-3~bpo9+1) ...
[pihole]          Setting up libraspberrypi-dev (1.20190401-1) ...
[pihole]          Setting up cmake-data (3.7.2-1) ...
[pihole]          Processing triggers for libc-bin (2.24-11+deb9u4) ...
[pihole]          Setting up libjsoncpp1:armhf (1.7.4-3) ...
[pihole]          Setting up cmake (3.7.2-1) ...
[pihole]          Processing triggers for libc-bin (2.24-11+deb9u4) ...
[pihole]           ---> 4ee73aad0e86
[pihole]          Removing intermediate container d7e8ff284f5d
[pihole]          Step 4/17 : RUN curl -sSL https://raw.githubusercontent.com/tasanakorn/rpi-fbcp/master/CMakeLists.txt -O
[pihole]           ---> Running in db6723e9e12e
[pihole]           ---> 0bfb4ec66921
[pihole]          Removing intermediate container db6723e9e12e
[pihole]          Step 5/17 : RUN curl -sSL https://raw.githubusercontent.com/tasanakorn/rpi-fbcp/master/main.c -O
[pihole]           ---> Running in 755022ecfe3e
[pihole]           ---> 3dbb516fec21
[pihole]          Removing intermediate container 755022ecfe3e
[pihole]          Step 6/17 : WORKDIR /usr/src/build
[pihole]           ---> a89f6981dc39
[pihole]          Removing intermediate container a7b84f70038a
[pihole]          Step 7/17 : RUN cmake .. && make
[pihole]           ---> Running in 516bc18fbd3f
[pihole]          -- The C compiler identification is GNU 6.3.0
[pihole]          -- The CXX compiler identification is GNU 6.3.0
[pihole]          -- Check for working C compiler: /usr/bin/cc
[pihole]          -- Check for working C compiler: /usr/bin/cc -- works
[pihole]          -- Detecting C compiler ABI info
[pihole]          -- Detecting C compiler ABI info - done
[pihole]          -- Detecting C compile features
[pihole]          -- Detecting C compile features - done
[pihole]          -- Check for working CXX compiler: /usr/bin/c++
[pihole]          -- Check for working CXX compiler: /usr/bin/c++ -- works
[pihole]          -- Detecting CXX compiler ABI info
[pihole]          -- Detecting CXX compiler ABI info - done
[pihole]          -- Detecting CXX compile features
[pihole]          -- Detecting CXX compile features - done
[pihole]          -- Configuring done
[pihole]          -- Generating done
[pihole]          -- Build files have been written to: /usr/src/build
[pihole]          Scanning dependencies of target fbcp
[pihole]          [ 50%] Building C object CMakeFiles/fbcp.dir/main.c.o
[pihole]          [100%] Linking C executable fbcp
[pihole]          [100%] Built target fbcp
[pihole]           ---> 37b12e423d18
[pihole]          Removing intermediate container 516bc18fbd3f
[pihole]          Step 8/17 : FROM pihole/pihole:4.2.2-1_armhf
[pihole]           ---> 412361a41707
[pihole]          Step 9/17 : WORKDIR /usr/src
[pihole]          Using cache
[pihole]           ---> fb789507c387
[pihole]          Step 10/17 : COPY --from=build /opt/vc/lib/* /opt/vc/lib/
[pihole]          Using cache
[pihole]           ---> 62d1b8da08ad
[pihole]          Step 11/17 : COPY --from=build /usr/src/build/fbcp /usr/src/
[pihole]          Using cache
[pihole]           ---> 4723e79c83eb
[pihole]          Step 12/17 : COPY services/ /etc/services.d/
[pihole]           ---> 4d71e59523ae
[pihole]          Removing intermediate container 12a233e33926
[pihole]          Step 13/17 : COPY init/ /etc/cont-init.d/
[pihole]           ---> 98d0b70924d9
[pihole]          Removing intermediate container e3fd7a4111bf
[pihole]          Step 14/17 : RUN sed -i '/$AUTHORIZED_HOSTNAMES = array(/ a "balena-devices.com",' /var/www/html/admin/scripts/pi-hole/php/auth.php
[pihole]           ---> Running in 3fb41ae6c179
[pihole]           ---> 343ce71c075f
[pihole]          Removing intermediate container 3fb41ae6c179
[pihole]          Step 15/17 : RUN echo "bind-interfaces" >> /etc/dnsmasq.conf
[pihole]           ---> Running in 895a2227d83c
[pihole]           ---> 91033837cc57
[pihole]          Removing intermediate container 895a2227d83c
[pihole]          Step 16/17 : RUN curl -fsSL https://raw.githubusercontent.com/jpmck/PADD/master/padd.sh -O    && chmod +x padd.sh
[pihole]           ---> Running in e006ea572131
[pihole]           ---> c19316ec7de1
[pihole]          Removing intermediate container e006ea572131
[pihole]          Step 17/17 : RUN curl -sSL https://v.firebog.net/hosts/lists.php?type=tick -o /etc/pihole/adlists.list
[pihole]           ---> Running in ee19a695a539
[pihole]           ---> 9679a27dbf6b
[pihole]          Removing intermediate container ee19a695a539
[pihole]          Successfully built 9679a27dbf6b
[Info]            Uploading images
[Success]         Successfully uploaded images
[Success]         Release successfully created!
[Info]            Release: 6df0d216ee29cbd4cd19d213efe48e04 (id: 918148)
[Info]            ┌────────────────┬────────────┬────────────┐
[Info]            │ Service        │ Image Size │ Build Time │
[Info]            ├────────────────┼────────────┼────────────┤
[Info]            │ pihole         │ 271.19 MB  │ 38 seconds │
[Info]            ├────────────────┼────────────┼────────────┤
[Info]            │ dnscrypt-proxy │ 19.06 MB   │ 5 seconds  │
[Info]            └────────────────┴────────────┴────────────┘
[Info]            Build finished in 48 seconds
                            \
                             \
                              \\
                               \\
                                >\/7
                            _.-(6'  \
                           (=___._/` \
                                )  \ |
                               /   / |
                              /    > /
                             j    < _\
                         _.-' :      ``.
                         \ r=._\        `.
                        <`\\_  \         .`-.
                         \ r-7  `-. ._  ' .  `\
                          \`,      `-.`7  7)   )
                           \/         \|  \'  / `-._
                                      ||    .'
                                       \\  (
                                        >\  >
                                    ,.-' >.'
                                   <.'_.''
                                     <'

Edit to add:

I’ve just spotted this in the logs, in green, so am not sure whether it’s actually a problem:

12.05.19 00:03:36 (+0100)  pihole  [cont-init.d] 30-checktft.sh: executing... 
: No such file or directorypihole  ifelse: fatal: unable to exec bash

also:

12.05.19 00:06:36 (+0100)  pihole  OK: Checks passed for /etc/resolv.conf DNS servers
12.05.19 00:06:36 (+0100)  pihole  
12.05.19 00:06:36 (+0100)  pihole  nameserver 127.0.0.1
12.05.19 00:06:36 (+0100)  pihole  nameserver 1.1.1.1
12.05.19 00:06:36 (+0100)  pihole  stty: 'standard input': Inappropriate ioctl for device
12.05.19 00:06:37 (+0100)  pihole    [i] Existing PHP installation detected : PHP version 7.0.33-0+deb9u1
12.05.19 00:06:37 (+0100)  pihole  
12.05.19 00:06:37 (+0100)  pihole    [i] Installing configs from /etc/.pihole...
12.05.19 00:06:37 (+0100)  pihole    [i] Existing dnsmasq.conf found... it is not a Pi-hole file, leaving alone!
  [✓] Copying 01-pihole.conf to /etc/dnsmasq.d/01-pihole.conf
12.05.19 00:06:37 (+0100)  pihole  chown: cannot access '/etc/pihole/dhcp.leases': No such file or directory

Could you enable support access for this device please?

@jezmck thanks for sharing your device.

This problem is that the scripts in the project are being converted to Windows (dos) line endings on your machine before they are pushed. You were correct in spotting that the problem was due to where the 30-checktft.sh script is being executed on startup; on your device this file has the incorrect format and can’t run. I’ve deleted it for now and everything has started and I can access the web interface.

I’m not sure of the exact fix for this at the moment as I don’t have a Windows system to reproduce, but it sounds like you cloned the repo with Git rather than downloading a zip file from GitHub, in which case take a look at this: https://www.balena.io/docs/faq/troubleshooting/troubleshooting/#i-get-r-command-not-found-when-my-device-tries-to-run-scripts - it might be a case of simply changing a setting on your local Git configuration.

As I’ve left your device right now the script has been deleted so everything was able to start. I hope this helps!

1 Like

Ah ha, excellent, thank you.

I don’t remember what option I chose when installing git, but now I know the cause I can find out how to change that setting and re-clone.

edit: it was easiest to reinstall git for windows, and select a different setting for line-endings.

1 Like

@chrisys I’ve tried this solution and some other I could find, but with no success.
I’m working on a Mac, so Windows related issues, should not be the cause to me.

Any clues or something I could try?

BTW… I using a Pi Zero (I know it might not be the recommended model) and deploying the code with PiHole 4.4 got the service up, but the blocklist would not be updated at all, even after updating Gravity.

Also, I was able to run Pi Hole 5.4 on the same Pi Zero, but doing it from scratch with regular Raspbian image (not Balena’s).

Thx in advance