# RecursionError: maximum recursion depth exceeded while getting the str of an object

**URL:** <https://forum.ansible.com/t/recursionerror-maximum-recursion-depth-exceeded-while-getting-the-str-of-an-object/6036>\
**Category:** Get Help\
**Tags:** arubanetworks, error, python, awx, collections\
**Created:** [May 28, 2024, 12:15pm UTC](https://forum.ansible.com/t/recursionerror-maximum-recursion-depth-exceeded-while-getting-the-str-of-an-object/6036 "2024-05-28T12:15:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![motorbass](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@motorbass](https://forum.ansible.com/u/motorbass)\
**Post date:** [May 28, 2024, 12:15pm UTC](https://forum.ansible.com/t/recursionerror-maximum-recursion-depth-exceeded-while-getting-the-str-of-an-object/6036/1 "2024-05-28T12:15:00Z")

</div>

Hi  
I’m currently building a network oriented project to configure SNMP + Radius on my Aruba switches. As aruba collection is pretty poor and not so well maintained, I’m able to do what I need using `ansible.netcommon.cli_command` collection.

For instance, here’s a simple task I use to check if SNMPv3 is already enabled :

```auto
  - name: Verification si SNMPv3 est deja active
    ansible.netcommon.cli_command:
      command: |
        sh running-config | include snmpv3 enable
    register: snmp_check

```

Ansible to switch connection is made through SSH (natively from ansible.netcommon) using Hashicorp Vault variables present in vars.yml :

```auto
ansible_hashi_vault_token: "{{ lookup('env','VAULT_ANSIBLE') }}"
approle_id: "{{ lookup('env','VAULT_ROLE_ID') }}"
approle_secret_id: "{{ lookup('env','VAULT_SECRET_ID') }}"

switchs_secrets_vault: "{{ lookup('community.hashi_vault.vault_kv2_get', 'aruba-switch', engine_mount_point='kv/', auth_method='approle', role_id=approle_id, secret_id=approle_secret_id) }}"
ansible_user: "{{ switchs_secrets_vault.secret.login }}"
ansible_password: "{{ switchs_secrets_vault.secret.password }}"

```

First, I develop my project from a Debian/Ansible VM where Ansible details are :

```auto
ansible [core 2.15.9]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.9/dist-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110] (/usr/bin/python3)
  jinja version = 3.1.4
  libyaml = True

```

**From this platform I don’t have any issues at all.**

Now, when I want to try the same project on AWX, I receive the following error :

```auto
Loading collection arubanetworks.aos_switch from /runner/requirements_collections/ansible_collections/arubanetworks/aos_switch
<10.6.4.47> attempting to start connection
<10.6.4.47> using connection plugin ansible.netcommon.network_cli
Found ansible-connection at path /usr/local/bin/ansible-connection
The full traceback is:
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/ansible/executor/task_executor.py", line 165, in run
    res = self._execute()
  File "/usr/local/lib/python3.9/site-packages/ansible/executor/task_executor.py", line 608, in _execute
    socket_path = start_connection(self._play_context, options, self._task._uuid)
  File "/usr/local/lib/python3.9/site-packages/ansible/executor/task_executor.py", line 1230, in start_connection
    write_to_file_descriptor(master, options)
  File "/usr/local/lib/python3.9/site-packages/ansible/module_utils/connection.py", line 58, in write_to_file_descriptor
    src = cPickle.dumps(obj, protocol=0)
  File "/usr/lib64/python3.9/copyreg.py", line 71, in _reduce_ex
    state = base(self)
RecursionError: maximum recursion depth exceeded while getting the str of an object

```

I’m using AWX 23.5.1 with a custom image I made with the same pip modules + os packages I got from my Debian  
Why do I get this kind of error on a platform but not on another one ?  
Is this a Python related issues or AWX/Ansible ?

I don’t know what tracks I may follow to fix that , need your help !!! 🙂

Gael

---

<div class="post-metadata">

**Author:** ![motorbass](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@motorbass](https://forum.ansible.com/u/motorbass)\
**Post date:** [May 28, 2024, 1:49pm UTC](https://forum.ansible.com/t/recursionerror-maximum-recursion-depth-exceeded-while-getting-the-str-of-an-object/6036/2 "2024-05-28T13:49:51Z")

</div>

Saw on some reddits posts that some people simply upgrade their AWX-EE image to a newer one.  
In my case as it’s a custom one, I simply upgrade ansible from ansible-core2.15rc1 to ansible-core2.15.12 and it WORKS !!! 😃

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [June 27, 2024, 1:50pm UTC](https://forum.ansible.com/t/recursionerror-maximum-recursion-depth-exceeded-while-getting-the-str-of-an-object/6036/3 "2024-06-27T13:50:45Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
