M312: mlaunch errors launching replica set

In attempting to follow along with the lectures in M312, I’m having issues getting mlaunch to function.

For example in the lesson Fixing Missing Indexes, Part 2, if I attempt to launch the replica set as in the video, I get:

vagrant@m312:~$ mlaunch init --replicaset --name m312RS --wiredTigerCacheSizeGB 0.3 --port 30000 --host localhost
Traceback (most recent call last):
File “/usr/local/bin/mlaunch”, line 9, in
load_entry_point(‘mtools==1.6.1’, ‘console_scripts’, ‘mlaunch’)()
File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 351, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 2363, in load_entry_point
return ep.load()
File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 2088, in load
entry = import(self.module_name, globals(),globals(), [‘name’])
File “/usr/local/lib/python2.7/dist-packages/mtools/mlaunch/mlaunch.py”, line 1541
result.append(f’"{arg}"’)
^
SyntaxError: invalid syntax

Any ideas?

  1. Open the provision file and add these version numbers:
  2. Re-provision the machine:
    vagrant provision
2 Likes

That worked - THANK YOU!!! =)

:slightly_smiling_face::+1:

Hi. Just in case someone has the same error, i also add to force psutil to version 5.6.7.
Not working with 5.7.x

"Downloading/unpacking psutil
Downloading psutil-5.7.2.tar.gz (460kB): 460kB downloaded
Running setup.py (path:/tmp/pip_build_root/psutil/setup.py) egg_info for package psutil
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: ‘python_requires’
warnings.warn(msg)
error in psutil setup command: ‘extras_require’ must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.
Complete output from command python setup.py egg_info:
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: ‘python_requires’

warnings.warn(msg)

error in psutil setup command: ‘extras_require’ must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.
"

Fix:
sudo pip install psutil==5.6.7

1 Like

Hello I followed the suggested actions above but I have still problems:

vagrant@m312:/shared$ sh set_up_building_index_in_foreground.sh
mongod: no process found
Traceback (most recent call last):
File “/usr/local/bin/mlaunch”, line 7, in
from mtools.mlaunch.mlaunch import main
File “/usr/local/lib/python3.4/dist-packages/mtools/mlaunch/mlaunch.py”, line 1535
result.append(f’"{arg}"’)
^
SyntaxError: invalid syntax
MongoDB shell version v3.4.2
connecting to: mongodb://127.0.0.1:30000/
2020-08-10T17:07:51.011+0000 W NETWORK [thread1] Failed to connect to 127.0.0.1:30000, in(checking socket for error after poll), reason: Connection refused
2020-08-10T17:07:51.012+0000 E QUERY [thread1] Error: couldn’t connect to server 127.0.0.1:30000, connection attempt failed :
connect@src/mongo/shell/mongo.js:237:13
@(connect):1:6
exception: connect failed
2020-08-10T17:08:14.114+0000 […] m312.employees 0B/395MB (0.0%)
2020-08-10T17:08:14.648+0000 […] m312.employees 0B/395MB (0.0%)
2020-08-10T17:08:14.651+0000 Failed: error connecting to db server: no reachable servers
2020-08-10T17:08:14.652+0000 imported 0 documents

Could you pls help me?

Thanks Pierluigi Di Marco

Hi @Pierluigi_Di_Marco,

If you are already SSHed in to the Virtual machine, run the following commands to destroy it:

exit
vagrant destroy

Then update the install_python_dependencies() function in provision-m12 file. as below:

function install_python_dependencies(){
sudo apt-get install -y python-dev
sudo apt-get install -y python-pip
sudo apt-get install python-setuptools
sudo pip install pymongo --upgrade
sudo pip install docopt --upgrade
sudo pip install faker==3.0.1
sudo apt-get install python-psutil
sudo pip install mtools==1.5.3
}

Bring up your vagrant box and then try to run the script.

Please feel free to reach out if you still get any error

Thanks,
Sonali