There are some instances where your environment build stalls and asks you to update your key. But you find yourself unable to connect to the Keyserver caused by the error below:
Step 32/53 : RUN gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 && gpg -a --export E298A3A825C0D65DFD57CBB651716619E084DAB9 | sudo apt-key add - ip-146-69-165-42.us-gov-west-1.compute.internal domino-build-624b2f6999f6b41d3afc6b8e domino-build-624b2f6999f6b41d3afc6b8e
Apr 04 2022 12:48:29 -0500 ---> Running in 39a9d1fcbc5e ip-146-69-165-42.us-gov-west-1.compute.internal domino-build-624b2f6999f6b41d3afc6b8e domino-build-624b2f6999f6b41d3afc6b8e
Apr 04 2022 12:48:29 -0500 [91mgpg: directory '/root/.gnupg' created ip-146-69-165-42.us-gov-west-1.compute.internal domino-build-624b2f6999f6b41d3afc6b8e domino-build-624b2f6999f6b41d3afc6b8e
Apr 04 2022 12:48:29 -0500 [0m ip-146-69-165-42.us-gov-west-1.compute.internal domino-build-624b2f6999f6b41d3afc6b8e domino-build-624b2f6999f6b41d3afc6b8e
Apr 04 2022 12:48:29 -0500 [91mgpg: keybox '/root/.gnupg/pubring.kbx' created ip-146-69-165-42.us-gov-west-1.compute.internal domino-build-624b2f6999f6b41d3afc6b8e domino-build-624b2f6999f6b41d3afc6b8e
Apr 04 2022 12:48:29 -0500 [0m ip-146-69-165-42.us-gov-west-1.compute.internal domino-build-624b2f6999f6b41d3afc6b8e domino-build-624b2f6999f6b41d3afc6b8e
Apr 04 2022 12:49:29 -0500 [91mgpg: keyserver receive failed: Connection timed out ip-146-69-165-42.us-gov-west-1.compute.internal domino-build-624b2f6999f6b41d3afc6b8e domino-build-624b2f6999f6b41d3afc6b8e
Apr 04 2022 12:49:29 -0500 [0m ip-146-69-165-42.us-gov-west-1.compute.internal domino-build-624b2f6999f6b41d3afc6b8e domino-build-624b2f6999f6b41d3afc6b8e
Apr 04 2022 12:49:30 -0500 Removing intermediate container 39a9d1fcbc5e ip-146-69-165-42.us-gov-west-1.compute.internal domino-build-624b2f6999f6b41d3afc6b8e domino-build-624b2f6999f6b41d3afc6b8e
Apr 04 2022 12:49:30 -0500 The command '/bin/sh -c gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 && gpg -a --export E298A3A825C0D65DFD57CBB651716619E084DAB9 | sudo apt-key add -' returned a non-zero code: 2 ip-146-69-165-42.us-gov-west-1.compute.internal domino-build-624b2f6999f6b41d3afc6b8e domino-build-624b2f6999f6b41d3afc6b8e
Apr 04 2022 12:49:30 -0500 ====================================================================== ip-146-69-165-42.us-gov-west-1.compute.internal domino-build-624b2f6999f6b41d3afc6b8e domino-build-624b2f6999f6b41d3afc6b8e
Apr 04 2022 12:49:30 -0500 Failed ip-146-69-165-42.us-gov-west-1.compute.internal domino-build-624b2f6999f6b41d3afc6b8e domino-build-624b2f6999f6b41d3afc6b8e
Apr 04 2022 12:49:30 -0500 ====================================================================== ip-146-69-165-42.us-gov-west-1.compute.internal domino-build-624b2f6999f6b41d3afc6b8e domino-build-624b2f6999f6b41d3afc6b8e
Apr 04 2022 12:49:30 -0500 ERROR: ProgressMessage{id=null, status=null, stream=null, error=The command '/bin/sh -c gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 && gpg -a --export E298A3A825C0D65DFD57CBB651716619E084DAB9 | sudo apt-key add -' returned a non-zero code: 2, progress=null, progressDetail=null} ip-146-69-165-42.us-gov-west-1.compute.internal domino-build-624b2f6999f6b41d3afc6b8e domino-build-624b2f6999f6b41d3afc6b8e
Next question is how do we resolve it?
We can do so by specifying the proxy. You would need to add the following lines on your Environment Build/ Docker. (*Note that this is done on your docker file. )
sudo apt-key adv \
--keyserver-options http-proxy=http://USER:PASSWORD@PROXY_URL:PORT/ \
--keyserver keyserver.ubuntu.com --recv-keys GPG_KEY
Here is another example as a reference. Below is a sample of the original command without proxy
Original command
RUN gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 && gpg -a --export E298A3A825C0D65DFD57CBB651716619E084DAB9 | sudo apt-key add - ip-146-69-165-42.us-gov-west-1.compute.internal domino-build-624b2f6999f6b41d3afc6b8e domino-build-624b2f6999f6b41d3afc6b8e
This is when proxy is added to resolve the issue.
RUN gpg --keyserver-options http-proxy=<proxy>:80 --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 && gpg -a --export E298A3A825C0D65DFD57CBB651716619E084DAB9 | sudo apt-key add - ip-146-69-165-42.us-gov-west-1.compute.internal domino-build-624b2f6999f6b41d3afc6b8e domino-build-624b2f6999f6b41d3afc6b8e
** RELATEAD ARTICLES
Build error for nvidia GPG Key
Environment build fails with GPG error
Comments
0 comments
Please sign in to leave a comment.