Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: "dellemc.powerscale.synciqpolicy fails with error TypeError: cannot unpack non-iterable NoneType object" #44

Open
dennym opened this issue Nov 22, 2022 · 3 comments
Labels
triage/needs-information More investigation is required to reproduce. type/bug Something isn't working

Comments

@dennym
Copy link

dennym commented Nov 22, 2022

Description
We are trying to manage SyncIQ-Policies using this collection but we're running into the following issue: Unless we leave out required parameters like state or provide wrong credentials on purpose (in which case we get a "normal" Ansible error, such as "incorrect username or password"), we always get the following Python error message:

Logs

Traceback (most recent call last):
  File \"/root/.ansible/tmp/ansible-tmp-1669116874.2854335-64-40565527781314/AnsiballZ_synciqpolicy.py\", line 107, in <module>
    _ansiballz_main()
  File \"/root/.ansible/tmp/ansible-tmp-1669116874.2854335-64-40565527781314/AnsiballZ_synciqpolicy.py\", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File \"/root/.ansible/tmp/ansible-tmp-1669116874.2854335-64-40565527781314/AnsiballZ_synciqpolicy.py\", line 47, in invoke_module
    runpy.run_module(mod_name='ansible_collections.dellemc.powerscale.plugins.modules.synciqpolicy', init_globals=dict(_module_fqn='ansible_collections.dellemc.powerscale.plugins.modules.synciqpolicy', _modlib_path=modlib_path),
  File \"/usr/lib64/python3.9/runpy.py\", line 225, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File \"/usr/lib64/python3.9/runpy.py\", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File \"/usr/lib64/python3.9/runpy.py\", line 87, in _run_code
    exec(code, run_globals)
  File \"/tmp/ansible_dellemc.powerscale.synciqpolicy_payload_vwnkij0j/ansible_dellemc.powerscale.synciqpolicy_payload.zip/ansible_collections/dellemc/powerscale/plugins/modules/synciqpolicy.py\", line 1076, in <module>
  File \"/tmp/ansible_dellemc.powerscale.synciqpolicy_payload_vwnkij0j/ansible_dellemc.powerscale.synciqpolicy_payload.zip/ansible_collections/dellemc/powerscale/plugins/modules/synciqpolicy.py\", line 1072, in main
  File \"/tmp/ansible_dellemc.powerscale.synciqpolicy_payload_vwnkij0j/ansible_dellemc.powerscale.synciqpolicy_payload.zip/ansible_collections/dellemc/powerscale/plugins/modules/synciqpolicy.py\", line 854, in perform_module_operation
TypeError: cannot unpack non-iterable NoneType object

To reproduce

  1. write a minimal playbook:
- name: bug
  hosts: localhost
  tasks:
    - name: demo filesync policy bug
      dellemc.powerscale.synciqpolicy:
        onefs_host: "isilon.ecample.com"
        verify_ssl: false
        api_user: "****"
        api_password: "****"
        policy_name: "debug"
        state: "absent"
  1. run the playbook

System Information:

  • OS/Version: Red Hat 8.5.0-13
  • Ansible Version v2.13.4
  • Python Version v3.9.13

Expected behavior

The "debug" policy is either deleted if it exists or nothing is done if it doesn't. In either case, the task should succeed.

Other modules from this collection such as smb and smartquota work w/o issue on the same setup.

Are there any implicitely required parameters we are missing here?

Best

@dennym dennym added needs-triage Issue requires triage. type/bug Something isn't working labels Nov 22, 2022
@dennym
Copy link
Author

dennym commented Nov 28, 2022

Further inspections resulted in that there was an issue on our side but the error was not meaningful.

The SyncIQ service was not activated and unfortunately the playbook and the sdk did not catch that exception and ran into the next logic step and couldn't handle the response.

This line uses the Isilon python binding sdk and assumes that it either returns no policy or a collection of policies
https://github.com/dell/ansible-powerscale/blob/master/plugins/modules/synciqpolicy.py#L500

The API call happens here:
https://github.com/Isilon/isilon_sdk_python/blob/a76bec4087528b16679c54f4c9e1200a590b47bd/isi_sdk_9_1_0/isi_sdk_9_1_0/api/sync_api.py#L3033

We weren't able to check the actual response there but it should have failed and be caught.

Solution would be either to somehow check if self.api_instance.get_sync_policy(name_or_id).policies works or returns an exception or isilon sdk needs to have some exception handling. I leave it open until some response but it basically is resolved.

Best

@Jennifer-John
Copy link
Collaborator

Thanks @dennym for reporting the issue. We will look into the scenario, if it can be handled by the module.

Thanks,
Jennifer

@kuttattz
Copy link

kuttattz commented Feb 6, 2023

@dennym We tried to replicate the above issue.
Our setup doesn't have synciq activated as in below screenshot
image

But then when we executed the create workflow for the synciq from ansible we got the below result
image

This works as expected. Can you please share further information for us to replicate the issue.

@anupamaloke anupamaloke added triage/needs-information More investigation is required to reproduce. and removed needs-triage Issue requires triage. labels Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage/needs-information More investigation is required to reproduce. type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants