Error: retrieving gpg key timed out
joseverav opened this issue · comments
I cloned the repository and tried to run the docker-compose --verbose build
command, but I get an error. It seems that it is related to the docker/backend/Dockerfile where the ubuntu:xenial image is created. Here is the error output:
#0 17.98 gpg: keyring `/tmp/tmpmfnsuaam/secring.gpg' created
#0 17.98 gpg: keyring `/tmp/tmpmfnsuaam/pubring.gpg' created
#0 17.98 gpg: requesting key 6A755776 from hkp server keyserver.ubuntu.com
#0 47.45 Error: retrieving gpg key timed out.
#0 138.0 gpg: keyserver timed out
#0 138.0 gpg: keyserver receive failed: keyserver error
------
time="2023-02-03T17:34:07-07:00" level=debug msg="serving grpc connection"
time="2023-02-03T17:34:07-07:00" level=debug msg="stopping session" span="load buildkit capabilities"
time="2023-02-03T17:34:07-07:00" level=debug msg="serving grpc connection"
time="2023-02-03T17:36:26-07:00" level=debug msg="stopping session"
failed to solve: executor failed running [/bin/sh -c apt-get update && apt-get install -y software-properties-common && add-apt-repository ppa:deadsnakes/ppa && apt-get update && apt-get install -y python3.6 python3.6-dev python3-pip]: exit code: 1
Hi @joseverav,
could you try to update the ubuntu image in the docker/backend/Dockerfile
from ubuntu:xenial
to ubuntu:jammy
? Do you still have the error?
I tried that and I am still getting the error. Do you get this error at all when using the master branch? Because I want to rule out the possibility of the error being produced by something in my local machine.
[+] Building 22.0s (7/17)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 710B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/ubuntu:jammy 0.9s
=> [auth] library/ubuntu:pull token for registry-1.docker.io 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 2.90kB 0.0s
=> CACHED [ 1/12] FROM docker.io/library/ubuntu:jammy@sha256:9a0bdde4188b896a372804be2384015e90e3f84906b750c1a53539b585fbbe7f 0.0s
=> ERROR [ 2/12] RUN apt-get update && apt-get install -y software-properties-common && add-apt-repository ppa:deadsnakes/ppa && apt-get update && apt-g 21.1s
------
> [ 2/12] RUN apt-get update && apt-get install -y software-properties-common && add-apt-repository ppa:deadsnakes/ppa && apt-get update && apt-get install -y python3.6 python3.6-dev python3-pip:
#0 5.357 Err:1 http://archive.ubuntu.com/ubuntu jammy InRelease
#0 5.357 403 connecting to archive.ubuntu.com:80: connecting to 185.125.190.39:80: dial tcp 185.125.190.39:80: i/o timeout [IP: 185.125.190.39 80]
#0 6.267 Get:2 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
#0 6.944 Get:3 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [5557 B]
#0 7.090 Get:4 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [681 kB]
#0 9.168 Get:5 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [754 kB]
#0 10.41 Err:6 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
#0 10.41 403 connecting to archive.ubuntu.com:80: connecting to 185.125.190.39:80: dial tcp 185.125.190.39:80: i/o timeout [IP: 185.125.190.39 80]
#0 13.65 Get:7 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [799 kB]
#0 15.46 Err:8 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
#0 15.46 403 connecting to archive.ubuntu.com:80: connecting to 185.125.190.39:80: dial tcp 185.125.190.39:80: i/o timeout [IP: 185.125.190.39 80]
#0 21.04 Reading package lists...
#0 21.08 E: The repository 'http://archive.ubuntu.com/ubuntu jammy InRelease' is not signed.
#0 21.08 E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease 403 connecting to archive.ubuntu.com:80: connecting to 185.125.190.39:80: dial tcp 185.125.190.39:80: i/o timeout [IP: 185.125.190.39 80]
#0 21.08 E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease 403 connecting to archive.ubuntu.com:80: connecting to 185.125.190.39:80: dial tcp 185.125.190.39:80: i/o timeout [IP: 185.125.190.39 80]
#0 21.08 E: The repository 'http://archive.ubuntu.com/ubuntu jammy-updates InRelease' is not signed.
#0 21.08 E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease 403 connecting to archive.ubuntu.com:80: connecting to 185.125.190.39:80: dial tcp 185.125.190.39:80: i/o timeout [IP: 185.125.190.39 80]
#0 21.08 E: The repository 'http://archive.ubuntu.com/ubuntu jammy-backports InRelease' is not signed.
------
failed to solve: executor failed running [/bin/sh -c apt-get update && apt-get install -y software-properties-common && add-apt-repository ppa:deadsnakes/ppa && apt-get update && apt-get install -y python3.6 python3.6-dev python3-pip]: exit code: 100
The solution that worked for me was to change images from ubuntu:xenial
to ubuntu:jammy
and update from Python 3.6 to 3.8. Here is what docker/backend/Dockerfile
looks like now:
FROM ubuntu:jammy
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository ppa:deadsnakes/ppa -y && \
apt-get update && \
apt-get install -y python3.8 python3.8-dev python3-pip python3.8-distutils
WORKDIR /app
COPY requirements.txt .
RUN rm -f /usr/bin/python && ln -s /usr/bin/python3.8 /usr/bin/python
RUN rm -f /usr/bin/python3 && ln -s /usr/bin/python3.8 /usr/bin/python3
RUN pip3 install -r requirements.txt
RUN pip3 install gunicorn==19.9.0
ADD ./backend /app/backend
ADD ./docker /app/docker
ADD ./research /app/research
#RUN mkdir -p /app/backend/server/staticfiles
RUN mkdir -p /app/backend/server/static
I also had to update scikit-learn
to version 0.24.2
in requirements.txt
. I can make a pull request for this @pplonski if it is helpful.
Though my docker image gets built, running docker compose up
creates a new error. See my new issue.