Fails to install in Koa latest build

The current build from github for Koa fails. I’m not sure why but I did tried already installed setuptools for python. See the following error below:

TASK [supervisor : Install supervisor in its venv] *****************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ModuleNotFoundError: No module named 'pkg_resources'
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to import the required Python library (setuptools) on pupnode2's Python /usr/bin/python3. Please read module documentation and install in the appropriate location"}

and as I mentioned, setuptools is is installed

(edx_ansible) root@pupnode2:~/openedx# pip list installed|grep setuptools
setuptools      51.1.2
(edx_ansible) root@pupnode2:~/openedx# dpkg -l|grep setuptools
ii  python-setuptools              44.0.0-2                          all          Python Distutils Enhancements
ii  python3-setuptools             45.2.0-1                          all          Python3 Distutils Enhancements
1 Like

FWIW, i tried downgrading and setting up juniper(.3) and it passes the supervisor sections. This seems to be a bug IMHO.

In comparison to Juniper, this is what I got in my env:
changed: [localhost] => (item=/edx/var/log/supervisor)

TASK [supervisor : Install supervisor in its venv] *****************************
changed: [localhost]

TASK [supervisor : Install supervisor in its venv] *****************************
changed: [localhost]

TASK [supervisor : Create supervisor upstart job] ******************************
skipping: [localhost]

TASK [supervisor : Create supervisor systemd job] ******************************
changed: [localhost]

TASK [supervisor : Write the pre_suprevisor python script] *********************
skipping: [localhost]

TASK [supervisor : Create supervisor master config] ****************************
changed: [localhost]

TASK [supervisor : Remove a symlink for supervisortctl] ************************
 [WARNING]: The src option requires state to be 'link' or 'hard'.  This will
become an error in Ansible 2.10
ok: [localhost]

TASK [supervisor : Remove symlink for supervisor cfg] **************************
ok: [localhost] => (item=/edx/app/supervisor/supervisord.conf)
ok: [localhost] => (item=/edx/app/supervisor/conf.d)

TASK [supervisor : Create helper script for running supervisor] ****************
changed: [localhost]

TASK [supervisor : Are we in a Docker container] *******************************
changed: [localhost]

TASK [supervisor : Enable supervisor to start on boot] *************************
changed: [localhost]

TASK [supervisor : Start supervisor] *******************************************
changed: [localhost]

TASK [supervisor : Wait for web port to be available] **************************
ok: [localhost]

TASK [supervisor : Update supervisor configuration] ****************************
ok: [localhost]

TASK [edxapp_common : Install system packages] *********************************

It’s still installing the edxapp_common as of this time but the main problem I encountered in supervisord is relieved.

Hi @geekgogie, and welcome to the forum!

So, I just ran into this myself while test-installing koa.2 on Ubuntu 20.04, using the native installation instructions. The workaround was to run:

sudo apt-get install --reinstall python3-pkg-resources

I wonder what exactly’s clobbering that package’s install path.

1 Like

TASK [common : pip install virtualenv] *****************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ImportError: No module named pkg_resources
fatal: [127.0.0.1]: FAILED! => {“changed”: false, “msg”: “Failed to import the required Python library (setuptools) on aabsc.abc.com’s Python /usr/bin/python. Please read module documentation and install in the appropriate location”}

I have the same error, even after trying the workaround. Any suggestions?

@arbrandes and @Maksim_Sokolskiy figured out what was happening: the ansible-bootstrap.sh script instructs you to activate a virtualenv at the end. This was incorrect advice, and causes the failures above. You should not activate a virtualenv at that step of the installation.

We’re updating the installation instructions and the script.

1 Like