Chapter 0: Introduction & Setup

Error with vagrant provision

C:\Users\esirv\m103\m103-vagrant-env>vagrant provision
==> mongod-m103: Running provisioner: shell…
mongod-m103: Running: C:/Users/esirv/AppData/Local/Temp/vagrant-shell20200224-3296-zzatpm
mongod-m103: + config
mongod-m103: + sudo su
mongod-m103: + echo -e never
mongod-m103: + echo -e never
mongod-m103: + echo manual
mongod-m103: + sudo tee /etc/init/mongod.override
mongod-m103: manual
mongod-m103: + ip_config
mongod-m103: ++ ifconfig
mongod-m103: ++ tail -1
mongod-m103: ++ awk ‘{ print $1}’
mongod-m103: ++ cut -d: -f2
mongod-m103: ++ grep -v 127.0.0.1
mongod-m103: ++ grep ‘inet addr:’
mongod-m103: + export CLIENT_IP_ADDR=192.168.103.100
mongod-m103: + CLIENT_IP_ADDR=192.168.103.100
mongod-m103: ++ hostname
mongod-m103: ++ tr ‘[:upper:]’ ‘[:lower:]’
mongod-m103: ++ cut -d. -f 1
mongod-m103: + export CLIENT_NAME=m103
mongod-m103: + CLIENT_NAME=m103
mongod-m103: + echo ‘Configuring /etc/hosts …’
mongod-m103: Configuring /etc/hosts …
mongod-m103: + echo '127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ’
mongod-m103: + echo ‘::1 localhost localhost.localdomain localhost6 localhost6.localdomain6’
mongod-m103: + echo ‘fe00::0 ip6-localnet’
mongod-m103: + echo ‘ff00::0 ip6-mcastprefix’
mongod-m103: + echo ‘ff02::1 ip6-allnodes’
mongod-m103: + echo ‘ff02::2 ip6-allrouters’
mongod-m103: + echo ‘ff02::3 ip6-allhosts’
mongod-m103: + echo ‘192.168.103.100 m103’
mongod-m103: Install MongoDB Enterprise Repository
mongod-m103: + update_repo
mongod-m103: + echo ‘Install MongoDB Enterprise Repository’
mongod-m103: + sudo tee /etc/apt/sources.list.d/mongodb-enterprise.list
mongod-m103: + echo ‘deb [ arch=amd64 ] http://repo.mongodb.com/apt/ubuntu trusty/mongodb-enterprise/3.6 multiverse’ mongod-m103: deb [ arch=amd64 ] http://repo.mongodb.com/apt/ubuntu trusty/mongodb-enterprise/3.6 multiverse
mongod-m103: + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 0C49F3730359A14518585931BC711F9BA15703C6
mongod-m103: Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.gzDqMwU5La --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 keyserver.ubuntu.com --recv 0C49F3730359A14518585931BC711F9BA15703C6
mongod-m103: gpg:
mongod-m103: requesting key A15703C6 from hkp server keyserver.ubuntu.com
mongod-m103: ?:
mongod-m103: keyserver.ubuntu.com: Host not found
mongod-m103: gpgkeys: HTTP fetch error 7: couldn’t connect: Success
mongod-m103: gpg:
mongod-m103: no valid OpenPGP data found.
mongod-m103: gpg:
mongod-m103: 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.

Open the provision-mongod file and try these steps:

Try substituting this line:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 0C49F3730359A14518585931BC711F9BA15703C6

with one of these two lines:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5

Save the file and run vagrant provision again.

still showing the same error

What about the second?

the same error is showing too.

Share a screenshot.

Also ssh into the box (vagrant ssh) > run this command curl portquiz.net:80 > tell me if it’s successful

You’re potentially using a Corporate network that’s behind a firewall, proxy or VPN.

Does it work on your host machine?

No, I am using my personal computer on my home network. I ran the command again with my firewall disabled but it threw the same error. Should I reinstall VB?
C:\Users\esirv\m103\m103-vagrant-env>vagrant provision
==> mongod-m103: Running provisioner: shell…
mongod-m103: Running: C:/Users/esirv/AppData/Local/Temp/vagrant-shell20200224-7888-1te5rwq
mongod-m103: + config
mongod-m103: + sudo su
mongod-m103: + echo -e never
mongod-m103: + echo -e never
mongod-m103: + echo manual
mongod-m103: + sudo tee /etc/init/mongod.override
mongod-m103: manual
mongod-m103: + ip_config
mongod-m103: ++ ifconfig
mongod-m103: ++ grep ‘inet addr:’
mongod-m103: ++ tail -1
mongod-m103: ++ awk ‘{ print $1}’
mongod-m103: ++ cut -d: -f2
mongod-m103: ++ grep -v 127.0.0.1
mongod-m103: + export CLIENT_IP_ADDR=192.168.103.100
mongod-m103: + CLIENT_IP_ADDR=192.168.103.100
mongod-m103: ++ hostname
mongod-m103: ++ tr ‘[:upper:]’ ‘[:lower:]’
mongod-m103: ++ cut -d. -f 1
mongod-m103: + export CLIENT_NAME=m103
mongod-m103: + CLIENT_NAME=m103
mongod-m103: + echo ‘Configuring /etc/hosts …’
mongod-m103: Configuring /etc/hosts …
mongod-m103: + echo '127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ’
mongod-m103: + echo ‘::1 localhost localhost.localdomain localhost6 localhost6.localdomain6’
mongod-m103: + echo ‘fe00::0 ip6-localnet’
mongod-m103: + echo ‘ff00::0 ip6-mcastprefix’
mongod-m103: + echo ‘ff02::1 ip6-allnodes’
mongod-m103: + echo ‘ff02::2 ip6-allrouters’
mongod-m103: + echo ‘ff02::3 ip6-allhosts’
mongod-m103: + echo ‘192.168.103.100 m103’
mongod-m103: Install MongoDB Enterprise Repository
mongod-m103: + update_repo
mongod-m103: + echo ‘Install MongoDB Enterprise Repository’
mongod-m103: + sudo tee /etc/apt/sources.list.d/mongodb-enterprise.list
mongod-m103: + echo ‘deb [ arch=amd64 ] http://repo.mongodb.com/apt/ubuntu trusty/mongodb-enterprise/3.6 multiverse’
mongod-m103: deb [ arch=amd64 ] http://repo.mongodb.com/apt/ubuntu trusty/mongodb-enterprise/3.6 multiverse
mongod-m103: + sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
mongod-m103: Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.UzFpqZETFq --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 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
mongod-m103: gpg:
mongod-m103: requesting key 91FA4AD5 from hkp server keyserver.ubuntu.com
mongod-m103: ?:
mongod-m103: keyserver.ubuntu.com: Host not found
mongod-m103: gpgkeys: HTTP fetch error 7: couldn’t connect: Success
mongod-m103: gpg: no valid OpenPGP data found.
mongod-m103: 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.

What is the output (curl portquiz.net:80) on the Windows terminal, the terminal for your host machine? And are you using a VPN?

No, I’m not usign a VPN.

the ouput is:
curl: (6) Could not resolve host: portquiz.net

I reinstalled it and this was my log
log.txt (5.5 KB)

You didn’t need to reinstall VirtualBox. This is a network issue not a VBox issue.

Just to be sure, can you please share the screenshot of this (including the command):

imagen

Open a new terminal (Command Prompt), run the command and share the screenshot.
That’s what I meant by running it on your host machine.

That means that your VM cannot connect to the Internet.

Run the following commands from your host machine and share the output as screenshots:
vagrant destroy -f
vagrant up --no-provision

1 Like

imagen

ssh into the VM and try the curl command again.

Hi @Jose_Emmanuel_70465,

As I can see you have successfully completed few labs in the course. Can you please confirm that your issue got resolved?

Thanks,
Shubham Ranjan
Curriculum Services Engineer

1 Like

I resolved the issue with this:

1 Like