Closed aaronfs07 closed 1 month ago
@aaronfs07 can you share the firmware and model of the switch that's failing - also which task is is failing specifically is it the first aoscx_interface
call?
It is a 6200F on 10.10.1060
And yes it is the first AOSCX_interface call.
@aaronfs07 is the switch in VSF a stack at the point of execution of this playbook? The interfaces 2/1/15
exists on the switch at that time?
Yes it does.
It will even fail on a switch with the same error on 1/1/19
See here
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'NoneType' object has no attribute 'items' fatal: [DPPS-MDF-02]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/home/ubuntu/.local/lib/python3.10/site-packages/pyaoscx/pyaoscx_factory.py\", line 132, in interface\n interface_obj.apply()\n File \"/home/ubuntu/.local/lib/python3.10/site-packages/pyaoscx/pyaoscx_module.py\", line 40, in ensure_connected\n return fnct(self, *args, **kwargs)\n File \"/home/ubuntu/.local/lib/python3.10/site-packages/pyaoscx/interface.py\", line 487, in apply\n modified = self.create()\n File \"/home/ubuntu/.local/lib/python3.10/site-packages/pyaoscx/pyaoscx_module.py\", line 40, in ensure_connected\n return fnct(self, *args, **kwargs)\n File \"/home/ubuntu/.local/lib/python3.10/site-packages/pyaoscx/interface.py\", line 464, in create\n raise GenericOperationError(response.text, response.status_code)\npyaoscx.exceptions.generic_op_error.GenericOperationError: 'GENERIC OPERATION ERROR: cannot add a system interface\\n: Code: 400'\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/home/ubuntu/.ansible/tmp/ansible-local-58622xqjkzzsj/ansible-tmp-1696534333.0329187-59633-239427269681588/AnsiballZ_aoscx_interface.py\", line 102, in <module>\n _ansiballz_main()\n File \"/home/ubuntu/.ansible/tmp/ansible-local-58622xqjkzzsj/ansible-tmp-1696534333.0329187-59633-239427269681588/AnsiballZ_aoscx_interface.py\", line 94, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/ubuntu/.ansible/tmp/ansible-local-58622xqjkzzsj/ansible-tmp-1696534333.0329187-59633-239427269681588/AnsiballZ_aoscx_interface.py\", line 40, in invoke_module\n runpy.run_module(mod_name='ansible_collections.arubanetworks.aoscx.plugins.modules.aoscx_interface', init_globals=None, run_name='__main__', alter_sys=True)\n File \"/usr/lib/python3.10/runpy.py\", line 224, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/usr/lib/python3.10/runpy.py\", line 96, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File \"/usr/lib/python3.10/runpy.py\", line 86, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_aoscx_interface_payload_5csl_yn1/ansible_aoscx_interface_payload.zip/ansible_collections/arubanetworks/aoscx/plugins/modules/aoscx_interface.py\", line 649, in <module>\n File \"/tmp/ansible_aoscx_interface_payload_5csl_yn1/ansible_aoscx_interface_payload.zip/ansible_collections/arubanetworks/aoscx/plugins/modules/aoscx_interface.py\", line 510, in main\n File \"/home/ubuntu/.local/lib/python3.10/site-packages/pyaoscx/pyaoscx_factory.py\", line 138, in interface\n interface_obj.get()\n File \"/home/ubuntu/.local/lib/python3.10/site-packages/pyaoscx/pyaoscx_module.py\", line 40, in ensure_connected\n return fnct(self, *args, **kwargs)\n File \"/home/ubuntu/.local/lib/python3.10/site-packages/pyaoscx/interface.py\", line 223, in get\n self.vlan_tag.get()\n File \"/home/ubuntu/.local/lib/python3.10/site-packages/pyaoscx/pyaoscx_module.py\", line 40, in ensure_connected\n return fnct(self, *args, **kwargs)\n File \"/home/ubuntu/.local/lib/python3.10/site-packages/pyaoscx/vlan.py\", line 132, in get\n Mac.get_all(self.session, self)\n File \"/home/ubuntu/.local/lib/python3.10/site-packages/pyaoscx/mac.py\", line 214, in get_all\n mac_obj.port = Interface.from_response(session, mac[\"port\"])\n File \"/home/ubuntu/.local/lib/python3.10/site-packages/pyaoscx/interface.py\", line 375, in from_response\n interfaces_id_arr = session.api.get_keys(\n File \"/home/ubuntu/.local/lib/python3.10/site-packages/pyaoscx/api.py\", line 97, in get_keys\n for k, v in response_data.items():\nAttributeError: 'NoneType' object has no attribute 'items'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
@aaronfs07 Can you share what versions of the aoscx collection and the pyaoscx package you're using? I'm attempting to recreate the error but having difficulty
Sure,
arubanetworks.aos_switch 1.5.0
arubanetworks.aoscx 4.2.0
Can you install the latest version of the arubanetworks.aoscx
collection and verify if the issue is still seen?
ansible-galaxy collection install arubanetworks.aoscx -f
Also please ensure the latest Python packages are installed as well:
pip install --upgrade pyaoscx
After an upgrade I now get a different error on those same switches of
interfaces_id_arr = session.api.get_keys(\n File \"/home/ubuntu/.local/lib/python3.10/site-packages/pyaoscx/api.py\", line 97, in get_keys\n for k, v in response_data.items():\nAttributeError: 'NoneType' object has no attribute 'items'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
Any update on this issue?
@aaronfs07 can you update your pyaoscx & Ansible version and see if you're still receiving the same error?
Getting the following error from the aoscx_interface module
I have checked all the usual suspects - switch settings (other playbooks work), updating packages
This same command works on other switches. I only have a few that throw this error.
Current Ansible Configuration part that is throwing this error
Expected Behavior
I expect that just like the other switches in this playbook that it will execute successfully. There is no config difference I can tell between the switches. I have even reloaded one of them to see.