Brandawg93/Pi-Hole-Monitoring

Error on docker-compose

Closed this issue · 9 comments

pi@raspberrypi:~/Pi-Hole-Monitoring $ docker-compose up -d
Building sql_influx
Step 1/4 : FROM python:3-alpine
 ---> 3cc7843766a1
Step 2/4 : COPY ./requirements.txt .
 ---> Using cache
 ---> cf33f0e2dc24
Step 3/4 : RUN pip install -r requirements.txt
 ---> Running in cb49a97ee9b1
ERROR: Service 'sql_influx' failed to build: The command '/bin/sh -c pip install -r requirements.txt' returned a non-zero code: 139

¯_(ツ)_/¯

What pi is this and which version of raspbian are you using?

I have the same error on raspbian buster. I think it is due to docker not being able to use the pihole dns server since systemd edits /etc/resolv.conf to point to its dns server. systemd dns server only listens to queries on the loop interface so docker containers can't use it. Docker then tries to use google dns which I have blocked on my router.

The python code shouldn’t be touching any of that. That line of code is simply installing requests and influxdb. It could be due to using the alpine version of python in the Docker file. Try changing alpine to latest here.

I changed the settings of the Dockerfile to FROM python:3-latest but it failed.
Am I doing something wrong.

I changed the settings of the Dockerfile to FROM python:3-latest but it failed.
Am I doing something wrong.

Switching the line to "FROM python:3-buster" allowed the installation to progress from that error

Thanks for the information. I edited the file and re-ran the command docker-compose up -d
However it still shows the same error

I am running on a raspberry pi 3B with Buster version 10..
Is there something I am not doing correctly.

Hi,
I also have the issue on a raspberry pi zero w with the latest raspbian lite, plus apt-get update && apt-get upgrade && apt-get dist-upgrade.
This is my output:

pi@raspberrypi-gr:~/Pi-Hole-Monitoring $ docker-compose up -d
Building sql_influx
Step 1/4 : FROM python:3-alpine
 ---> cd58c639a4df
Step 2/4 : COPY ./requirements.txt .
 ---> Using cache
 ---> 61d83f7c56d4
Step 3/4 : RUN pip install -r requirements.txt
 ---> Running in 028d57c92f59
ERROR: Service 'sql_influx' failed to build: The command '/bin/sh -c pip install -r requirements.txt' returned a non-zero code: 139

When I change alpine to latest and re-run docker-compose up -d, I get this error instead:

pi@raspberrypi-gr:~/Pi-Hole-Monitoring $ docker-compose up -d
Building sql_influx
Step 1/4 : FROM python:3-latest
ERROR: Service 'sql_influx' failed to build: manifest for python:3-latest not found

(But I'm not sure this can be called progressing from the error, since python:3-alpine didn't seem to be the issue)

However, when I run the failed command (locally, not in the container):
/bin/sh -c pip install -r requirements.txt
I get a help menu for pip.
But if I leave out the /bin/sh -c part (again locally, not in the container), it runs without error:
pip install -r requirements.txt

[Edit: missed the error message in the second code paste]

The issue may be fixed in my latest commit. I don't have a pi zero to test this on, but others have had the same issue and sent a stack trace. It looks like influxdb requires a specific version of requests but the latest was installed first.

Looks like it, yes:

[...]
Status: Downloaded newer image for grafana/grafana:latest
Creating influxdb ... done
Creating sql_influx ... done
Creating telegraf   ... done
Creating grafana    ... done