Playbook freezes after several seconds on a task using cisco.ios in Python 3.12

Playbook freezes after several seconds on a task using cisco.ios to connect to Cisco Switches by using SSH in Python3.12.

I have a simple test playbook to gather facts from Cisco switches(x500, mainly Catalyst 9200) with the cisco.ios collection. In python 3.12, after some seconds on the task(several switches are answering correctly), the execution freezes without reason(without error message) and the playbook is still in running state. But it works in python 3.9. It doesn’t matter the SSH library used(libssh or paramiko)

The task is:

     - name: Get Facts from Switches
       cisco.ios.ios_facts:
         gather_subset:
         - hardware
       ignore_errors: yes
       register: GET_FACTS_STATUS

Collection version:

  • ansible.utils: 6.0.1
  • ansible.netcommon: 8.4.0
  • cisco.ios: 11.2.0

The playbook is executed from AWX with 200 forks.

detail of the 2 environments:

  • python 3.12

    • ansible 11.12.0
    • ansible-core 2.18.12
    • ansible-pylibssh 1.3.0
    • paramiko 4.0.0
  • python 3.9

    • ansible 8.7.0
    • ansible-core 2.15.8
    • ansible-pylibssh 1.2.2
    • paramiko 3.5.0

let me know if you have an idea on my issue and if you need more information

here you can find logs from debug mode but I’m pretty sure it won’t be usefull:

**[WARNING]: Persistent connection logging is enabled for A.B.C.21. This will**
**log ALL interactions to /tmp/awx/awx_196767_13r5ql5q/project/ansible.log and**
**WILL NOT redact sensitive configuration like passwords. USE WITH CAUTION!**
<A.B.C.21> ssh type is set to paramiko
<A.B.C.21> Loading collection ansible.builtin from
<A.B.C.21> local domain socket path is /var/lib/awx/.ansible/cpd/6d0d9f4419
<A.B.C.21> ANSIBLE_NETWORK_IMPORT_MODULES: enabled
**[WARNING]: Persistent connection logging is enabled for  A.B.C.110. This**
**will log ALL interactions to /tmp/awx/awx_196767_13r5ql5q/project/ansible.log**
**and WILL NOT redact sensitive configuration like passwords. USE WITH CAUTION!**
<A.B.C.110> ssh type is set to paramiko
<A.B.C.110> Loading collection ansible.builtin from
<A.B.C.110> local domain socket path is /var/lib/awx/.ansible/cpd/f191c127ba
<A.B.C.110> ANSIBLE_NETWORK_IMPORT_MODULES: enabled
**[WARNING]: Persistent connection logging is enabled for  A.B.C.11. This will**
**log ALL interactions to /tmp/awx/awx_196767_13r5ql5q/project/ansible.log and**
**WILL NOT redact sensitive configuration like passwords. USE WITH CAUTION!**
<A.B.C.11> ssh type is set to paramiko
<A.B.C.11> Loading collection ansible.builtin from
<A.B.C.11> local domain socket path is /var/lib/awx/.ansible/cpd/9d16891fad
<A.B.C.11> ANSIBLE_NETWORK_IMPORT_MODULES: enabled
**[WARNING]: Persistent connection logging is enabled for  A.B.C.91. This will**
**log ALL interactions to /tmp/awx/awx_196767_13r5ql5q/project/ansible.log and**
**WILL NOT redact sensitive configuration like passwords. USE WITH CAUTION!**
<A.B.C.91> ssh type is set to paramiko
<A.B.C.91> Loading collection ansible.builtin from
<A.B.C.91> local domain socket path is /var/lib/awx/.ansible/cpd/790594d44f
<A.B.C.91> ANSIBLE_NETWORK_IMPORT_MODULES: enabled
<A.B.C.31> local domain socket does not exist, starting it
<A.B.C.31> control socket path is /var/lib/awx/.ansible/cpd/105e4597c2
<A.B.C.31> Loading collection ansible.builtin from
<A.B.C.31> Loading collection ansible.netcommon from /tmp/awx/awx_196767_13r5ql5q/requirements_collections/ansible_collections/ansible/netcommon
<A.B.C.31> Loading collection ansible.utils from /tmp/awx/awx_196767_13r5ql5q/requirements_collections/ansible_collections/ansible/utils
<A.B.C.31> Loading collection cisco.ios from /tmp/awx/awx_196767_13r5ql5q/requirements_collections/ansible_collections/cisco/ios
<A.B.C.31> local domain socket listeners started successfully
<A.B.C.31> loaded cliconf plugin ansible_collections.cisco.ios.plugins.cliconf.ios from path /tmp/awx/awx_196767_13r5ql5q/requirements_collections/ansible_collections/cisco/ios/plugins/cliconf/ios.py for network_os cisco.ios.ios
**[WARNING]: Persistent connection logging is enabled for  A.B.C.31. This will**
**log ALL interactions to /tmp/awx/awx_196767_13r5ql5q/project/ansible.log and**
**WILL NOT redact sensitive configuration like passwords. USE WITH CAUTION!**
<A.B.C.31> ssh type is set to paramiko
<A.B.C.31> Loading collection ansible.builtin from
<A.B.C.31> local domain socket path is /var/lib/awx/.ansible/cpd/105e4597c2
1 Like

If you limit the test to a single target, are the results different / successful?

Which version of AWX are you using? Does the playbook run successfully from the CLI like ansible-playbook using the environment versions which are failing when running from AWX?