import context ImportError: No module named context

Hello,

I’m using AWX for Windows automation in my personal lab.
I use WinRM protocol with a certificate connection to reach my different VMs.

Software versions :

  • Ansible : 2.9.10
  • AWX : 2.1.2

I’ve tried to use dynamic inventories but i’m facing a problem with the Python module named “context” even if this module is physically present on the OS.

Did you already encountered this issue ? Thanks in advance for your help.

The error detail on AWX web interface is :

2.980 INFO Updating inventory 6: Dyn - INV - test

2
2.997 INFO Reading Ansible inventory source: /tmp/awx_127_9pMQHg/tmpXl9zaa

3
Traceback (most recent call last):

4
File “/opt/awx/bin/awx-manage”, line 11, in

5
sys.exit(manage())

6
File “/opt/awx/embedded/lib/python2.7/site-packages/awx/init.py”, line 150, in manage

7
execute_from_command_line(sys.argv)

8
File “/opt/awx/embedded/lib64/python2.7/site-packages/django/core/management/init.py”, line 364, in execute_from_command_line

9
utility.execute()

10
File “/opt/awx/embedded/lib64/python2.7/site-packages/django/core/management/init.py”, line 356, in execute

11
self.fetch_command(subcommand).run_from_argv(self.argv)

12
File “/opt/awx/embedded/lib64/python2.7/site-packages/django/core/management/base.py”, line 283, in run_from_argv

13
self.execute(*args, **cmd_options)

14
File “/opt/awx/embedded/lib64/python2.7/site-packages/django/core/management/base.py”, line 330, in execute

15
output = self.handle(*args, **options)

16
File “/opt/awx/embedded/lib/python2.7/site-packages/awx/main/management/commands/inventory_import.py”, line 994, in handle

17
self.is_custom)

18
File “/opt/awx/embedded/lib/python2.7/site-packages/awx/main/management/commands/inventory_import.py”, line 245, in load_inventory_source

19
is_custom=is_custom).load()

20
File “/opt/awx/embedded/lib/python2.7/site-packages/awx/main/management/commands/inventory_import.py”, line 180, in load

21
data = self.command_to_json(base_args + [‘–list’])

22
File “/opt/awx/embedded/lib/python2.7/site-packages/awx/main/management/commands/inventory_import.py”, line 163, in command_to_json

23
self.method, proc.returncode, stdout, stderr))

24
RuntimeError: ansible-inventory failed (rc=1) with stdout:

26
stderr:

27
[WARNING]: * Failed to parse /tmp/awx_127_9pMQHg/tmpXl9zaa with script plugin:

28
Inventory script (/tmp/awx_127_9pMQHg/tmpXl9zaa) had an execution error:

29
Traceback (most recent call last): File “/tmp/awx_127_9pMQHg/tmpXl9zaa”, line

30
7, in import context ImportError: No module named context

31
[WARNING]: Unable to parse /tmp/awx_127_9pMQHg/tmpXl9zaa as an inventory source

32
ERROR! No inventory was parsed, please check your configuration and options.