venvs in Custom virtual Environment Paths return [Errno 2] No such file or directory:

Hi,

I inherited an AWX installation that has in SETTINGS / SYSTEM a “Custom virtual environment paths” to /data/virtualenv
I’m running AWX 15.0.1

AWX is running in a docker container where this path is a mounted
/dev/mapper/vg_data-lv_data 51339744 20523380 28178748 43% /data/virtualenv

I am able to source these venv’s from the command line within the awx_web and awx_task containers.
Whenever i try to use these venvs from an AWX template, AWX is unable to find the venv end returns a failed job with the following error message:

Traceback (most recent call last): File “/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/main/tasks.py”, line 1501, in run res = ansible_runner.interface.run(**params) File “/var/lib/awx/venv/awx/lib/python3.6/site-packages/ansible_runner/interface.py”, line 178, in run r.run() File “/var/lib/awx/venv/awx/lib/python3.6/site-packages/ansible_runner/runner.py”, line 179, in run use_poll=self.config.pexpect_use_poll, File “/var/lib/awx/venv/awx/lib/python3.6/site-packages/pexpect/pty_spawn.py”, line 204, in init self._spawn(command, args, preexec_fn, dimensions) File “/var/lib/awx/venv/awx/lib/python3.6/site-packages/pexpect/pty_spawn.py”, line 303, in _spawn cwd=self.cwd, **kwargs) File “/var/lib/awx/venv/awx/lib/python3.6/site-packages/pexpect/pty_spawn.py”, line 314, in _spawnpty return ptyprocess.PtyProcess.spawn(args, **kwargs) File “/var/lib/awx/venv/awx/lib/python3.6/site-packages/ptyprocess/ptyprocess.py”, line 330, in spawn raise exception OSError: [Errno 2] No such file or directory: b’/data/virtualenv/ftth_ng/bin/ansible-playbook’

If i am able to source the venv from the cli within containers, should AWX not also be able to find this?

docker exec -it awx_task /bin/bash
bash-4.4# source /data/virtualenv/ftth_config_ng/bin/activate
(ftth_config_ng) bash-4.4#

docker exec -it awx_web /bin/bash
bash-4.4# source /data/virtualenv/ftth_config_ng/bin/activate
(ftth_config_ng) bash-4.4#

As i am far from an AWX or docker expert, i don’t get/see where the problem lies, if someone could point me in the right direction.
Thank you in advance.
Kind regards,
Thijn

Hello,

Please note that the latest version of AWX does not support venv anymore and therefore a new concept has been added called Execution Environments.

If in your awx-web or awx_task you are able to source that venv, that is because you are sharing a common volume, however, during the execution of playbook that will be triggered by a different container due to the EE concept.

EE are containers that will trigger the ansible-playbook command against your playbook data.

Could you check what EE version is your AWX pulling to execute the given playbook?

In case you need to customize your EE, you can refer to the ansible-builder project for further information.

Best Regards,
mmello