Course M312: Unable to complete vagrant installation

I am taking course M312 Diagnostics and Debugging. I am unable to execute lab 2.1 because several libraries have not been installed.
According to the URLs in the pip.log error messages it looks like we are impacted by a TLS upgrade at pypi.python.org.
Based on what I see I don’t know what else might be missing. What do I need to do to complete the vagrant installation so I can complete this course?

When I execute lab 2.1:
I can start vagrant and ssh into it. I can start mongod with the “single.cfg” file provided in the lab material. When I execute the singleapp.py script I get this error.

vagrant@m312:/shared$ python singleapp.py
Traceback (most recent call last):
File “singleapp.py”, line 15, in
from docopt import docopt
ImportError: No module named docopt

I tried to install docopt manually. Here are the contents of ~/.pip/pip.log:

DistributionNotFound: No distributions at all found for docopt
/home/vagrant/.pip/pip.log (END)------------------------------------------------------------
/usr/bin/pip run on Mon May 3 15:17:27 2021
Downloading/unpacking docopt
… 403 Client Error:
[[[!!! BREAKING CHANGE !!!]]]
Support for clients that do not support Server Name Indication is temporarily disabled and will be permanently deprecated soon.
See URLS x and y
[[[!!! END BREAKING CHANGE !!!]]]

DistributionNotFound: No distributions at all found for docopt

BACKGROUND:

I also received an error when creating my vagrant image. It could not find the pymongo package. The pip.log entries include the same BREAKING CHANGE messages.

This was the final result of the install:


m312: Downloading/unpacking pymongo

m312: Could not find any downloads that satisfy the requirement pymongo
m312: No distributions at all found for pymongo

Here is the Python information for my vagrant image:

vagrant@m312:/shared$ python --version
Python 2.7.6

vagrant@m312:/shared$ pip list
apt-xapian-index (0.45)
argparse (1.2.1)
chardet (2.0.1)
Cheetah (2.4.4)
cloud-init (0.7.5)
colorama (0.2.5)
configobj (4.7.2)
html5lib (0.999)
httplib2 (0.8)
jsonpatch (1.3)
jsonpointer (1.0)
keyring (3.5)
Landscape-Client (14.12)
launchpadlib (1.10.2)
lazr.restfulclient (0.13.3)
lazr.uri (1.0.3)
oauth (1.0.1)
PAM (0.4.2)
pip (1.5.4)
prettytable (0.7.2)
pycrypto (2.6.1)
pycurl (7.19.3)
pygobject (3.12.0)
pyOpenSSL (0.13)
pyserial (2.6)
python-apt (0.9.3.5ubuntu3)
python-debian (0.1.21-nmu2ubuntu2)
PyYAML (3.10)
requests (2.2.1)
SecretStorage (2.0.0)
setuptools (3.3)
simplejson (3.3.1)
six (1.5.2)
ssh-import-id (3.21)
Twisted-Core (13.2.0)
Twisted-Names (13.2.0)
Twisted-Web (13.2.0)
urllib3 (1.7.1)
wadllib (1.3.2)
wheel (0.24.0)
wsgiref (0.1.2)
zope.interface (4.0.5)

I could not include any URLs in my initial post. Here are URLs x and y from the pip log.

See https://status.python.org/incidents/hzmjhqsdjqgb and https://github.com/pypa/pypi-support/issues/978

Hi @Jeff_Richardson - welcome to the forums!

Firstly to answer the question around the Vagrant installation, this is a course requirement as a number of the exercises for this course with the related data are embedded in the specific Vagrant environment you are asked to install. This makes it a prerequisite to completing the course.

Thank you for flagging the Breaking Change. I’ve been investigating this and it will actually require some substantial re-factoring on the part of our Vagrant images. Essentially, the Pip Python install tool uses a CDN (to host files) which has recently stopped non-SNI clients (see https://github.com/pypa/pypi-support/issues/978 and https://www.cloudflare.com/learning/ssl/what-is-sni/).

We are in the process of developing a workaround for this and we’ll update you once we have a suitable process that you can use to complete the installation of your Vagrant box.

Thanks for flagging this again and we’ll be working on this solution as a matter of urgency.

Kindest regards,
Eoin

I fixed this problem by installing last version of python2 (building from sources) and pip

install latest python2

sudo apt-get install -y build-essential checkinstall
sudo apt-get install -y libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev -y
cd /usr/src
sudo wget -q https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tgz
sudo tar xzf Python-2.7.18.tgz
cd Python-2.7.18
sudo ./configure --enable-optimizations
sudo make install
cd /usr/src
sudo rm -rf /usr/src/Python-2.7.18*

install latest pip

sudo curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
sudo python get-pip.py
sudo rm get-pip.py

Also removed

sudo pip install setuptools==45.3.0
version requirement, since it requires python3

Hi @Jeff_Richardson

Thanks for your patience, we’re currently testing a fix to the provisioning script used by the Vagrant box for M312. If you want to test this yourself you can simply replace your existing provision-m312 file with the contents of this file. It is a similar fix to @111403 suggestion but you should only need to reprovision your vagrant box again.

Once you update the provision-m312, you can on the command line for your host OS in the correct directory with the M312 vagrant box, type ‘vagrant provision’ which will re-provision and re-install the items within that script.

If you want to wait, we should be deploying this fix in the coming days but rather than delay your progress I wanted to offer you the opportunity to test this fix locally and continue your progress in M312.

Kindest regards,
Eoin

1 Like

HI @Eoin_Brazil,

thank you for you post and the correction. It’s ok now for me.
Here are my version details :

  • MAC OSX bigsur 11.2.3
  • vagrant : 2.2.15
  • virtual box : 6.1.20 r143896 (Qt5.6.3)

I can now finish my 2 labs on chapter 3 of M3112.

only one pb with mplotqueries tool ==> see error

vagrant@m312:~$ mplotqueries /home/vagrant/data/m312RS/rs1/mongod.log
Traceback (most recent call last):
File “/usr/local/bin/mplotqueries”, line 5, in
from mtools.mplotqueries.mplotqueries import main
File “/usr/local/lib/python2.7/site-packages/mtools/mplotqueries/mplotqueries.py”, line 28, in
"web browser. Error: " + str(e))
ImportError: Can’t import matplotlib. See github.com/rueckstiess/mtools/blob/master/INSTALL.md for instructions how to install matplotlib or try mlogvis instead, which is a simplified version of mplotqueries that visualizes the logfile in a web browser. Error: No module named matplotlib
vagrant@m312:~$

thanks.

regards.
David

Hi @David_DE_CARVALHO

Thanks for flagging this. It can be resolved by installing matplotlib with pip using this command:

pip install matplotlib

Hope this helps and good luck with the rest of the course.

Kindest regards,
Eoin

Ho @Eoin_Brazil

thank you. It’s ok but outside vagrant … inside vagrant we don’t have DISPLAY to generate graphics and I have an error :stuck_out_tongue:
“no display name and no $DISPLAY environment variable”

thank you again !
regards.
David.

Hi @Jeff_Richardson

I wanted to check back with you to see if these fixes and suggestions have allowed you to complete your Vagrant installation and progress with the course?

Thanks and kindest regards,
Eoin

1 Like