features: Terraform - Downloading GPG Key step gets stuck
Hello,
Since a few days I notice that the GPG Key download step in the Terraform feature hangs:
=> [internal] load metadata for mcr.microsoft.com/devcontainers/base:j 608.5s
=> => extracting sha256:9a586f3d84de83b25cb9ca6d0e733d37d5283da35a837917 0.8s
=> => extracting sha256:5ac951de24f647413f348bfa4183b92c9962b167e0a3106d 0.3s
=> => extracting sha256:1aa90a4f5c993fd6d1e5f0885a1794ee59253ee8d35463ea 0.0s
=> => extracting sha256:074fbd7f2200028d96665f87580813cabf3361b85a4217ce 0.0s
=> => extracting sha256:ee36e8b50d1a0a2f6169666f26f3938fe1ea3efabfb6df01 0.0s
=> => extracting sha256:9e8c9f9ef24f45765c7592d55a952cbe2d0d4fefcd797237 5.5s
=> [dev_containers_feature_content_normalize 2/3] COPY --from=dev_contai 4.8s
=> [dev_containers_feature_content_normalize 3/3] RUN chmod -R 0700 /tmp 1.7s
=> [dev_containers_target_stage 2/12] COPY --from=dev_containers_featur 0.3s
=> [dev_containers_target_stage 3/12] RUN echo "_CONTAINER_USER_HOME=$( 0.7s
=> [dev_containers_target_stage 4/12] RUN cd /tmp/build-features/azure 61.0s
=> [dev_containers_target_stage 5/12] RUN cd /tmp/build-features/github 6.1s
=> [dev_containers_target_stage 6/12] RUN cd /tmp/build-features/kubec 51.5s
=> [dev_containers_target_stage 7/12] RUN cd /tmp/build-features/power 34.3s
=> [dev_containers_target_stage 8/12] RUN cd /tmp/build-features/terr 431.1s
=> => # Downloading terraform...
=> => # TERRAFORM_GPG_KEY=72D7468F
=> => # GPG_KEY_SERVERS=keyserver hkp://keyserver.ubuntu.com:80
=> => # keyserver hkps://keys.openpgp.org
=> => # keyserver hkp://keyserver.pgp.com
=> => # (*) Downloading GPG key...
Screenshot:
I have tried this on various systems/connections and it seems to consistently hang. As you can see, other features install fine.
Any idea how to fix this? Thanks!
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 3
- Comments: 39 (13 by maintainers)
I could help remove the port 80 suffix from
GPG_KEY_SERVERS
for the Features, but I’d like to confirm if it solves the issue for everyone and doesn’t cause a regression.Can I get a 👍 if the following dev config works for you?
I have created a temporary
terraform
Feature on my personal repo which removes:80
https://github.com/samruddhikhandale/test-terraform/blob/main/src/terraform/install.sh#L29
Hi again @samruddhikhandale ,
Can confirm, the issue is the VPN. Tried without and built it without any issues.
You may, but I have already started working on updating all other Features. I would report here once completed. Shouldn’t take more than an hour.
Your change seems to be working, thank you
I was able to work around the issue.
I created a folder in the
.devcontainers
folder, called it0terraform
.I then copied the devcontainer-feature.json and install.sh files for the terraform feature into that folder and updated the devcontainer.json to reference it.
It looks like at line 66 of the
install.sh
, it calls theget_common_setting
function which looks like it downloads an env file (https://aka.ms/vscode-dev-containers/script-library/settings.env) and applies it.I added lines to override the GPG_KEY_SERVERS variable, removing the :80 for the ubuntu keyserver, which resolved the issue.
Is there anyway we can update the https://aka.ms/vscode-dev-containers/script-library/settings.env and remove the :80 reference?
I’m still getting the same issue, unfortunately.
But I’ve played around with it and discovered that the issue for me was port 80 on the ubuntu keyserver.
/tmp/tmp-gnupg/dirmngr.conf
:Running the command
gpg --verbose --recv-keys 72D7468F
gave me the following:And it just hangs there.
/tmp/tmp-gnupg/dirmngr.log
:If I change my
dirmngr.conf
to the following and run it again, it imports it successfully (i.e. remove the:80
on the ubuntu line):But I’ve tried each of the keyservers independently and found issues with all of them.
C874011F0AB405110D02105534365D9472D7468F
).I’ve also tried getting the key via curl from the ubuntu keyserver on port 80, and it worked just fine:
$ curl 'http://162.213.33.9:80/pks/lookup?op=get&options=mr&search=0x72D7468F'
I don’t know what can be done to fix this, though since it seems to be behaving differently for everyone. I just wanted to share my findings.