GPG: Keyserver timed out

Hi all,
I am unable to get pass the GPG requesting key issue. I am having the following error:

mongod-m103: requesting key A15703C6 from hkp server keyserver.ubuntu.com
mongod-m103: gpg: keyserver timed out
mongod-m103: gpg: keyserver receive failed: keyserver error
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

Although, I am able to login to vagrant using vagrant ssh command.
But when I run from vagrant:

vagrant@m103:~$ validate_box
I get the command not found error

Can someone help me fix this issue ?
Iā€™ll be obliged

Hi @Muhammad_Zaid_07211,

I suspect it could be the Firewall/Anti-virus on your system that could be blocking the request.

Can you please refer this post and try to make the suggested changes in your provision-mongod file?

Thanks,
Shubham Ranjan
Curriculum Support Engineer

1 Like

Hi @Shubham_Ranjan

I changed the line and I believe it fixed the issue. This is the output after chaning the line:

mongod-m103: Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.P3pxYcEwlf --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d/ubuntu-advantage-esm-infra-trusty.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
mongod-m103: gpg:
mongod-m103: requesting key A15703C6 from hkp server keyserver.ubuntu.com
mongod-m103: gpg:
mongod-m103: key A15703C6: public key ā€œMongoDB 3.4 Release Signing Key packaging@mongodb.comā€ imported
mongod-m103: gpg:
mongod-m103: Total number processed: 1
mongod-m103: gpg:
mongod-m103: imported: 1
mongod-m103: (RSA: 1)

  • However this is whatā€™s happening now

mongod-m103: + echo ā€˜Update Repositoriesā€™
mongod-m103: Update Repositories
mongod-m103: + sudo apt-get update -y
mongod-m103: Get:1 https://esm.ubuntu.com trusty-infra-security InRelease
mongod-m103: Get:2 https://esm.ubuntu.com trusty-infra-updates InRelease
mongod-m103: Get:3 https://esm.ubuntu.com trusty-infra-security/main amd64 Packages
mongod-m103: Get:4 https://esm.ubuntu.com trusty-infra-security/main Translation-en_US
mongod-m103: Get:5 https://esm.ubuntu.com trusty-infra-updates/main Translation-en_US
mongod-m103: Ign https://esm.ubuntu.com trusty-infra-security/main Translation-en_US
mongod-m103: Ign https://esm.ubuntu.com trusty-infra-security/main Translation-en
mongod-m103: Ign https://esm.ubuntu.com trusty-infra-updates/main Translation-en_US
mongod-m103: Ign https://esm.ubuntu.com trusty-infra-updates/main Translation-en
mongod-m103: Err http://repo.mongodb.com trusty/mongodb-enterprise/3.6 InRelease
mongod-m103: Err http://repo.mongodb.com trusty/mongodb-enterprise/3.6 Release.gpg
mongod-m103: Cannot initiate the connection to repo.mongodb.com:80 (2600:9000:20e8:3c00:8:2816:bc8a:3ba1). - connect (101: Network is unreachable) [IP: 2600:9000:20e8:3c00:8:2816:bc8a:3ba1 80]
mongod-m103: Err http://archive.ubuntu.com trusty InRelease
mongod-m103: Err http://archive.ubuntu.com trusty-updates InRelease
mongod-m103: Err http://archive.ubuntu.com trusty-backports InRelease
mongod-m103: Err http://archive.ubuntu.com trusty Release.gpg
mongod-m103: Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8001::21 80]
mongod-m103: Err http://archive.ubuntu.com trusty-updates Release.gpg
mongod-m103: Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8001::21 80]
mongod-m103: Err http://archive.ubuntu.com trusty-backports Release.gpg
mongod-m103: Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8001::21 80]
C:\Users\Qadri\m103\m103-vagrant-env> mongod-m103: Err http://security.ubuntu.com trusty-security InRelease
mongod-m103: Err http://security.ubuntu.com trusty-security Release.gpg
mongod-m103: Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable) [IP: 2001:67c:1560:8001::14 80]
mongod-m103: Fetched 247 kB in 20min 1s (205 B/s)
mongod-m103: Reading package listsā€¦
mongod-m103: W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/InRelease
mongod-m103:
mongod-m103: W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/InRelease
mongod-m103:
mongod-m103: W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-backports/InRelease
mongod-m103:
mongod-m103: W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/InRelease
mongod-m103:
mongod-m103: W: Failed to fetch http://repo.mongodb.com/apt/ubuntu/dists/trusty/mongodb-enterprise/3.6/InRelease
mongod-m103:
mongod-m103: W: Failed to fetch http://repo.mongodb.com/apt/ubuntu/dists/trusty/mongodb-enterprise/3.6/Release.gpg Cannot initiate the connection to repo.mongodb.com:80 (2600:9000:20e8:3c00:8:2816:bc8a:3ba1). - connect (101: Network is unreachable) [IP: 2600:9000:20e8:3c00:8:2816:bc8a:3ba1 80]
mongod-m103:
mongod-m103: W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/Release.gpg Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8001::21 80]
mongod-m103:
mongod-m103: W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/Release.gpg Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8001::21 80]
mongod-m103:
mongod-m103: W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-backports/Release.gpg Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8001::21 80]
mongod-m103:
mongod-m103: W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/Release.gpg Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable) [IP: 2001:67c:1560:8001::14 80]
mongod-m103:
mongod-m103: W: Some index files failed to download. They have been ignored, or old ones used instead.
mongod-m103: + echo ā€˜Installing MongoDB Enterprise Dependenciesā€™
mongod-m103: Installing MongoDB Enterprise Dependencies
mongod-m103: + sudo apt-get install -y libgssapi-krb5-2 libsasl2-2 libssl1.0.0 libstdc++6 snmp --force-yes
mongod-m103: Reading package listsā€¦
mongod-m103: Building dependency treeā€¦
mongod-m103: Reading state informationā€¦
mongod-m103: libsasl2-2 is already the newest version.
mongod-m103: libgssapi-krb5-2 is already the newest version.
mongod-m103: libssl1.0.0 is already the newest version.
mongod-m103: libstdc++6 is already the newest version.
mongod-m103: Suggested packages:
mongod-m103: lm-sensors snmp-mibs-downloader
mongod-m103: The following NEW packages will be installed:
mongod-m103: libperl5.18 libsensors4 libsnmp-base libsnmp30 snmp
mongod-m103: 0 upgraded, 5 newly installed, 0 to remove and 2 not upgraded.
mongod-m103: Need to get 1,167 kB of archives.
mongod-m103: After this operation, 4,676 kB of additional disk space will be used.
mongod-m103: WARNING: The following packages cannot be authenticated!
mongod-m103: libperl5.18 libsnmp-base libsnmp30 snmp

So, I aborted it!! Do you have any idea about this issue ?

Hi @Muhammad_Zaid_07211,

As I can see in the screenshot, the errors are mostly due to network issue.

Please run the following commands and share the output.

ping repo.mongodb.com
telnet repo.mongodb.com 80

Are you connected to any corporate network/ VPN network ?

Also please make sure that the Firewall/Anti-virus on your system is not blocking the requests.

If possible, please try to connect from some other network and see if that helps.

Thanks,
Shubham Ranjan
Curriculum Support Engineer

Hey @Shubham_Ranjan,

Yeah I was connected to my corporate network. As soon as I switched the network, all of that setting up vagrant pain went away.
I would really suggest everyone struggling with issues related to executing vagrant setup should try switching their network.

Thanks a lot for your assistance man!
Cheers