Issue in fetching gpg key from Keyserver.ubuntu.com

Hi,

I am facing an issue while fetching the gpg key from
database: + apt-key adv –keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
database: Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.ZQrGcQ7YtZ --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primar
y-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d/ubuntu-advantage-esm-infra-trusty.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
database: gpg:
database: requesting key EA312927 from hkp server keyserver.ubuntu.com
database: gpgkeys: HTTP fetch error 7: couldn’t connect: eof
database: gpg:
database: no valid OpenPGP data found.
database: gpg:
database: Total number processed: 0
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.

I have also check with the server keyserver.ubuntu.com there this key: EA312927 was not available.

Please let me no what needs to done to solve this problem.

Suggest searching this Security forum. Solutions on this topic have been discussed multiple times.

Hi JB,
I have check everywhere and also checked the database-provision file.
In am getting error in below line of update_repo function. Can I get any help to solve this issue:
#apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927

Potentially you are behind a firewall that’s preventing you from reaching out. Let’s run some tests.

Let’s see the screenshots of:

  • ping downloads.mongodb.com
  • curl portquiz.net 80
  • telnet portquiz.net 80

Hi JB,
Kindly check that test case 1 is working fine but 2 and 3 are not working. Please let me know what needs to be done to fix this.

  1. ping downloads.mongodb.com

  2. curl portquiz.net 80

  3. telnet portquiz.net 80



@Manish_04653 Are you connected to the network at work? And are you using a work machine?

If you can, try to disable the firewall on your machine and use your private network (i.e. at home or use your mobile phone network as a Hotspot)

Already using my mobile phone’s hotspot.

Also, tried changing ports and got following output=>

HTTP/1.1 400 Bad Request
Date: Fri, 20 Dec 2019 16:34:00 GMT
Server: Apache/2.4.29 (Ubuntu)
Content-Length: 335
Connection: close
Content-Type: text/html; charset=iso-8859-1

                                              <html><head>
                                                          <title>400 Bad Request</title>
                                                                                        </head><body>
                                                                                                     <h1>Bad Request</h1>
                                                                                                                         <p>Your browser sent a request that this server could not understand.<br />

Apache/2.4.29 (Ubuntu) Server at ip-172-31-37-228.eu-west-3.compute.internal Port 80

Connection to host lost.

D:\DATA\Personal\DEV\MongoDB\MongoDB_University\M310\m310-vagrant-env>vagrant up database
Bringing machine ‘database’ up with ‘virtualbox’ provider…
==> database: Checking if box ‘ubuntu/trusty64’ version ‘20190514.0.0’ is up to date…
==> database: Machine already provisioned. Run vagrant provision or use the --provision
==> database: flag to force provisioning. Provisioners marked to run always will still run.

D:\DATA\Personal\DEV\MongoDB\MongoDB_University\M310\m310-vagrant-env>vagrant provision database
==> database: Running provisioner: shell…
database: Running: C:/Users/ADMINI~1/AppData/Local/Temp/vagrant-shell20191220-1368-8cd02g
database: + config_hosts
database: + echo ‘Configuring /etc/hosts …’
database: Configuring /etc/hosts …
database: + echo ‘192.168.31.100 database.m310.mongodb.university database’
database: + echo ‘192.168.31.200 infrastructure.m310.mongodb.university infrastructure’
database: + update_repo
database: + echo ‘Install MongoDB Enterprise Repository’
database: Install MongoDB Enterprise Repository
database: + tee /etc/apt/sources.list.d/mongodb-enterprise.list
database: ++ lsb_release -sc
database: + echo ‘deb http://repo.mongodb.com/apt/ubuntu trusty/mongodb-enterprise/3.2 multiverse’
database: deb http://repo.mongodb.com/apt/ubuntu trusty/mongodb-enterprise/3.2 multiverse
database: + sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
database: Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.Gg1HhJQHGS --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primar
y-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d/ubuntu-advantage-esm-infra-trusty.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
database: gpg:
database: requesting key EA312927 from hkp server keyserver.ubuntu.com
database: gpgkeys: key EA312927 can’t be retrieved
database: gpg:
database: no valid OpenPGP data found.
database: gpg:
database: Total number processed: 0
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.

D:\DATA\Personal\DEV\MongoDB\MongoDB_University\M310\m310-vagrant-env>vagrant up database
Bringing machine ‘database’ up with ‘virtualbox’ provider…
==> database: Checking if box ‘ubuntu/trusty64’ version ‘20190514.0.0’ is up to date…
==> database: Machine already provisioned. Run vagrant provision or use the --provision
==> database: flag to force provisioning. Provisioners marked to run always will still run.

D:\DATA\Personal\DEV\MongoDB\MongoDB_University\M310\m310-vagrant-env>vagrant provision database
==> database: Running provisioner: shell…
database: Running: C:/Users/ADMINI~1/AppData/Local/Temp/vagrant-shell20191220-12060-1l994f
database: + config_hosts
database: + echo ‘Configuring /etc/hosts …’
database: Configuring /etc/hosts …
database: + echo ‘192.168.31.100 database.m310.mongodb.university database’
database: + echo ‘192.168.31.200 infrastructure.m310.mongodb.university infrastructure’
database: + update_repo
database: + echo ‘Install MongoDB Enterprise Repository’
database: Install MongoDB Enterprise Repository
database: + tee /etc/apt/sources.list.d/mongodb-enterprise.list
database: ++ lsb_release -sc
database: + echo ‘deb http://repo.mongodb.com/apt/ubuntu trusty/mongodb-enterprise/3.2 multiverse’
database: deb http://repo.mongodb.com/apt/ubuntu trusty/mongodb-enterprise/3.2 multiverse
database: + sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
database: Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.FcymuIEFUd --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primar
y-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d/ubuntu-advantage-esm-infra-trusty.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
database: gpg:
database: requesting key 91FA4AD5 from hkp server keyserver.ubuntu.com
database: gpgkeys: key 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5 can’t be retrieved
database: gpg: no valid OpenPGP data found.
database: gpg: Total number processed: 0
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.

D:\DATA\Personal\DEV\MongoDB\MongoDB_University\M310\m310-vagrant-env>vagrant provision database
==> database: Running provisioner: shell…
database: Running: C:/Users/ADMINI~1/AppData/Local/Temp/vagrant-shell20191220-6596-11pjdng
database: + config_hosts
database: + echo ‘Configuring /etc/hosts …’
database: Configuring /etc/hosts …
database: + echo ‘192.168.31.100 database.m310.mongodb.university database’
database: + echo ‘192.168.31.200 infrastructure.m310.mongodb.university infrastructure’
database: + update_repo
database: + echo ‘Install MongoDB Enterprise Repository’
database: Install MongoDB Enterprise Repository
database: + tee /etc/apt/sources.list.d/mongodb-enterprise.list
database: ++ lsb_release -sc
database: + echo ‘deb http://repo.mongodb.com/apt/ubuntu trusty/mongodb-enterprise/3.2 multiverse’
database: deb http://repo.mongodb.com/apt/ubuntu trusty/mongodb-enterprise/3.2 multiverse
database: + sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
database: Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.nw86K8VxQx --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primar
y-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d/ubuntu-advantage-esm-infra-trusty.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
database: gpg:
database: requesting key EA312927 from hkp server keyserver.ubuntu.com
database: gpgkeys: key EA312927 can’t be retrieved
database: gpg:
database: no valid OpenPGP data found.
database: gpg:
database: Total number processed: 0
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.

D:\DATA\Personal\DEV\MongoDB\MongoDB_University\M310\m310-vagrant-env>vagrant provision database
==> database: Running provisioner: shell…
database: Running: C:/Users/ADMINI~1/AppData/Local/Temp/vagrant-shell20191220-3256-13tfm4u
database: + config_hosts
database: + echo ‘Configuring /etc/hosts …’
database: Configuring /etc/hosts …
database: + echo ‘192.168.31.100 database.m310.mongodb.university database’
database: + echo ‘192.168.31.200 infrastructure.m310.mongodb.university infrastructure’
database: + update_repo
database: + echo ‘Install MongoDB Enterprise Repository’
database: Install MongoDB Enterprise Repository
database: + tee /etc/apt/sources.list.d/mongodb-enterprise.list
database: ++ lsb_release -sc
database: + echo ‘deb http://repo.mongodb.com/apt/ubuntu trusty/mongodb-enterprise/3.2 multiverse’
database: deb http://repo.mongodb.com/apt/ubuntu trusty/mongodb-enterprise/3.2 multiverse
database: + sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:8080 --recv EA312927
database: Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.WWM4uXxdMv --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primar
y-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d/ubuntu-advantage-esm-infra-trusty.gpg --keyserver hkp://keyserver.ubuntu.com:8080 --recv EA312927
database: gpg:
database: requesting key EA312927 from hkp server keyserver.ubuntu.com
database: gpg:
database: keyserver timed out
database: 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.

D:\DATA\Personal\DEV\MongoDB\MongoDB_University\M310\m310-vagrant-env>vagrant provision database
==> database: Running provisioner: shell…
database: Running: C:/Users/ADMINI~1/AppData/Local/Temp/vagrant-shell20191220-11864-pdlosj
database: + config_hosts
database: + echo ‘Configuring /etc/hosts …’
database: Configuring /etc/hosts …
database: + echo ‘192.168.31.100 database.m310.mongodb.university database’
database: + echo ‘192.168.31.200 infrastructure.m310.mongodb.university infrastructure’
database: + update_repo
database: + echo ‘Install MongoDB Enterprise Repository’
database: Install MongoDB Enterprise Repository
database: + tee /etc/apt/sources.list.d/mongodb-enterprise.list
database: ++ lsb_release -sc
database: + echo ‘deb http://repo.mongodb.com/apt/ubuntu trusty/mongodb-enterprise/3.2 multiverse’
database: deb http://repo.mongodb.com/apt/ubuntu trusty/mongodb-enterprise/3.2 multiverse
database: + sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:81 --recv EA312927
database: Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.O6zbBZ0FmU --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primar
y-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d/ubuntu-advantage-esm-infra-trusty.gpg --keyserver hkp://keyserver.ubuntu.com:81 --recv EA312927
database: gpg:
database: requesting key EA312927 from hkp server keyserver.ubuntu.com
database: gpg:
database: keyserver timed out
database: 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.

D:\DATA\Personal\DEV\MongoDB\MongoDB_University\M310\m310-vagrant-env>vagrant provision database
==> database: Running provisioner: shell…
database: Running: C:/Users/ADMINI~1/AppData/Local/Temp/vagrant-shell20191220-2108-cj9o1r
database: + config_hosts
database: + echo ‘Configuring /etc/hosts …’
database: Configuring /etc/hosts …
database: + echo ‘192.168.31.100 database.m310.mongodb.university database’
database: + echo ‘192.168.31.200 infrastructure.m310.mongodb.university infrastructure’
database: + update_repo
database: + echo ‘Install MongoDB Enterprise Repository’
database: Install MongoDB Enterprise Repository
database: + tee /etc/apt/sources.list.d/mongodb-enterprise.list
database: ++ lsb_release -sc
database: + echo ‘deb http://repo.mongodb.com/apt/ubuntu trusty/mongodb-enterprise/3.2 multiverse’
database: deb http://repo.mongodb.com/apt/ubuntu trusty/mongodb-enterprise/3.2 multiverse
database: + sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
database: Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.dpfn8XrMqU --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primar
y-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d/ubuntu-advantage-esm-infra-trusty.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
database: gpg:
database: requesting key EA312927 from hkp server keyserver.ubuntu.com
database: gpgkeys: key EA312927 can’t be retrieved
database: gpg:
database: no valid OpenPGP data found.
database: gpg:
database: Total number processed: 0
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.

D:\DATA\Personal\DEV\MongoDB\MongoDB_University\M310\m310-vagrant-env>vagrant provision database
==> database: Running provisioner: shell…
database: Running: C:/Users/ADMINI~1/AppData/Local/Temp/vagrant-shell20191220-11880-1khr89f
database: + config_hosts
database: + echo ‘Configuring /etc/hosts …’
database: Configuring /etc/hosts …
database: + echo ‘192.168.31.100 database.m310.mongodb.university database’
database: + echo ‘192.168.31.200 infrastructure.m310.mongodb.university infrastructure’
database: + update_repo
database: + echo ‘Install MongoDB Enterprise Repository’
database: Install MongoDB Enterprise Repository
database: + tee /etc/apt/sources.list.d/mongodb-enterprise.list
database: ++ lsb_release -sc
database: + echo ‘deb http://repo.mongodb.com/apt/ubuntu trusty/mongodb-enterprise/3.2 multiverse’
database: deb http://repo.mongodb.com/apt/ubuntu trusty/mongodb-enterprise/3.2 multiverse
database: + sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 --force-yes
database: Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.YfQQxLDNLW --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primar
y-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d/ubuntu-advantage-esm-infra-trusty.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 --force-yes
database: gpg:
database: “–force-yes” not a key ID: skipping
database: gpg:
database: requesting key EA312927 from hkp server keyserver.ubuntu.com
database: gpgkeys: key EA312927 can’t be retrieved
database: gpg:
database: no valid OpenPGP data found.
database: gpg:
database: Total number processed: 0
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.

D:\DATA\Personal\DEV\MongoDB\MongoDB_University\M310\m310-vagrant-env>vagrant provision database

Hi @007_jb,

I have found the fix for my problem-

  1. Antivirus was restricting me to fetch the gpgkey from the keyserver.
    Solved this by disabling network restrictions on antivirus. This was the point which you were saying and thanks for that.

  2. EA312927 key was incomplete due to which mongodb server was not accepting the GPG key which came in response of EA312927 key from key server. Fixed that by replacing the
    apt-key adv –keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
    with
    sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xd68fa50fea312927

as 0xd68fa50fea312927 is the authentic key as mongodb server and can be found at keyserver.

1 Like

Good job @Manish_04653. That key actually worked for me when I took this course but I’ve noticed that others have used different keys in other courses to download MongoDB 3.2.2. :slightly_smiling_face::+1: