Pure-Storage-Ansible / FlashArray-Collection

Ansible Collection for Pure Storage FlashArray
GNU General Public License v3.0
18 stars 22 forks source link

module failure for purestorage.flasharray.purefa_info #409

Closed colinet closed 1 year ago

colinet commented 1 year ago

Describe the bug While executing below playbook,

- name: pure | helpers info | collect data  
  purestorage.flasharray.purefa_info:  
    fa_url: "{{ san_CRUD_purearray_name[_pure_info_array_name|lower].url }}"  
    api_token: "{{ san_CRUD_purearray_name[_pure_info_array_name|lower].token }}"  
    gather_subset:  
      - hgroups  
      - hosts  
      - volumes  
      - vgroups  
      - pgroups  
  register: _pure_info_content  

it succeeds on some Pure arrays, but fails on one Pure array with below stack trace.
I have not tested all arrays. Just few ones among 50.


warnings.warn(\nTraceback (most recent call last):\n  
File \"/home/xxxxxxxxx/.ansible/tmp/ansible-tmp-1684937614.3134828-506956-13682452215673/AnsiballZ_purefa_info.py\", line 100, in <module>\n    _ansiballz_main()\n  
File \"/home/xxxxxxxxx/.ansible/tmp/ansible-tmp-1684937614.3134828-506956-13682452215673/AnsiballZ_purefa_info.py\", line 92, in _ansiballz_main\n  invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  
File \"/home/xxxxxxxxx/.ansible/tmp/ansible-tmp-1684937614.3134828-506956-13682452215673/AnsiballZ_purefa_info.py\", line 40, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.purestorage.flasharray.plugins.modules.purefa_info', init_globals=dict(_module_fqn='ansible_collections.purestorage.flasharray.plugins.modules.purefa_info', _modlib_path=modlib_path),\n  
File \"/usr/lib64/python3.9/runpy.py\", line 225, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  
File \"/usr/lib64/python3.9/runpy.py\", line 97, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  
File \"/usr/lib64/python3.9/runpy.py\", line 87, in _run_code\n    exec(code, run_globals)\n  
File \"/tmp/ansible_purestorage.flasharray.purefa_info_payload_kmvnqhxf/ansible_purestorage.flasharray.purefa_info_payload.zip/ansible_collections/purestorage/flasharray/plugins/modules/purefa_info.py\", line 2286,
in <module>\n  
File \"/tmp/ansible_purestorage.flasharray.purefa_info_payload_kmvnqhxf/ansible_purestorage.flasharray.purefa_info_payload.zip/ansible_collections/purestorage/flasharray/plugins/modules/purefa_info.py\", line 2225, in main\n  
File \"/tmp/ansible_purestorage.flasharray.purefa_info_payload_kmvnqhxf/ansible_purestorage.flasharray.purefa_info_payload.zip/ansible_collections/purestorage/flasharray/plugins/modules/purefa_info.py\", line 2020,
in generate_hgroups_dict\n
File \"/usr/local/lib/python3.9/site-packages/pypureclient/flasharray/FA_2_16/models/space.py\", line 142, in __getattribute__\n   raise AttributeError\nAttributeError\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

As per the stack strace, it looks related to generate_hgroups_dict. So I did a try commenting the hgroup subset collect in above playbook. Execution went fine by commenting hgroup subset collect.

To Reproduce Execute above playbook on some Pure array to collect hgroup subset. Most of the time, it works. But it fails on one array. I've done only few tests on different arrays.

Expected behavior Exection show have completed wothout stack trace on any Pure array

Additional context I had installed version 1.19.1 of Ansible collection for Pure array yesterday, before above test.

[xxxxxxxxx@xxxxxxxxx]$  ansible --version
ansible [core 2.11.9] 
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/xxxxxxxxx/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.9/site-packages/ansible
  ansible collection location = /home/xxxxxxxxx/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.9.14 (main, Jan  9 2023, 00:00:00) [GCC 11.3.1 20220421 (Red Hat 11.3.1-2)]
  jinja version = 3.1.2
  libyaml = True

[xxxxxxxxx@xxxxxxxxx]$  ansible-galaxy collection list |grep pure
purestorage.flasharray        1.11.0 
purestorage.flashblade        1.8.1  
purestorage.flasharray 1.19.1 

[xxxxxxxxx@xxxxxxxxx]$  pwd
/home/xxxxxxxxx/.ansible/collections/ansible_collections/purestorage/flasharray
[xxxxxxxxx@xxxxxxxxxflasharray]$  grep '1.19' *
CHANGELOG.rst:v1.19.1
CHANGELOG.rst:v1.19.0
...
MANIFEST.json:  "version": "1.19.1",
...

[xxxxxxxxx@xxxxxxxxx]$  uname -a
Linux xxxxxxxxx5.14.0-162.23.1.el9_1.x86_64 Thu Mar 23 20:08:28 EDT 2023 x86_64 x86_64 x86_64 GNU/Linux
[xxxxxxxxx@xxxxxxxxx]$
sdodsley commented 1 year ago

Yes. I know what is causing this. I'll raise a PR