dell / ansible-powerscale

PowerScale (Isilon) Ansible modules
GNU General Public License v3.0
25 stars 21 forks source link

[dellemc.powerscale.smartquota: - "msg": "Get Quota Details for ******** failed with Invalid value for `description`, must not be `None`"]: #65

Closed Javedkhansiddiqui closed 3 months ago

Javedkhansiddiqui commented 8 months ago

Hi All,

My Community Conversations Can Be Seen Here As Well

I am working on Quota creation part and noticed it is working on SERVER_A , but the same code is failing on SERVER_B. post those failing I checked manually and it is working file with same account. Please find the error message below.

=========ansible.cfg File Running From AAP===============

ansible-playbook [core 2.13.8] config file = /etc/ansible/ansible.cfg configured module search path = ['/home/runner/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3.9/site-packages/ansible ansible collection location = /runner/requirements_collections:/home/runner/.ansible/collections:/usr/share/ansible/collections executable location = /usr/bin/ansible-playbook python version = 3.9.16 (main, May 31 2023, 12:21:58) [GCC 8.5.0 20210514 (Red Hat 8.5.0-18)] jinja version = 3.0.3 libyaml = True Using /etc/ansible/ansible.cfg as config file SSH password: BECOME password[defaults to SSH password]: host_list declined parsing /runner/inventory/hosts as it did not pass its verify_file() method Parsed /runner/inventory/hosts inventory source with script plugin Skipping callback 'awx_display', as we already have a stdout callback. Skipping callback 'default', as we already have a stdout callback. Skipping callback 'minimal', as we already have a stdout callback. Skipping callback 'oneline', as we already have a stdout callback.

two thing to watch out is, 1) file creation was successful , in both cases without any issue , but failing while quota creation. 2) SERVER_A is at onefs 9.2.1.15 ----- successful SERVER_B is at onefs 9.4.0.14 ----- failed




=========MY COMMON CODE FOR BOTH SERVER===============

      - name: "Create A Quota On quota_full_path_dev_target -> {{ quota_full_path_dev_target }}"
        dellemc.powerscale.smartquota:
          onefs_host: "{{ isilon_ip_address_t }}"
          verify_ssl: false
          api_user: "{{ isilon_api_user }}"
          api_password: "{{ isilon_api_password }}"
          path: "{{ quota_full_path_dev_target }}"
          quota_type: "directory"
          access_zone: "System"
          quota:
            advisory_limit_size: "{{ advisory_limit_size | int }}"
            hard_limit_size: "{{ hard_limit_size }}"
            soft_limit_size: "{{ soft_limit_size | int }}"
            cap_unit: "{{ cap_unit }}"
            soft_grace_period: "{{ soft_grace_period }}"
            period_unit: "{{ period_unit }}"
            container: "yes"
            include_snapshots: false
            include_overheads: true
          state: "present"



=========SUCCESS _LOG _START FOR SERVER_A===============


changed: [xyz.domain.org] => {
    "changed": true,
    "invocation": {
        "module_args": {
            "access_zone": "System",
            "api_password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "api_user": "isilon_user",
            "group_name": null,
            "onefs_host": "172.0.0.1<SERVER_A>",
            "path": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "port_no": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "provider_type": "local",
            "quota": {
                "advisory_limit_size": 10.0,
                "cap_unit": "GB",
                "container": true,
                "hard_limit_size": 13.0,
                "include_overheads": true,
                "include_snapshots": false,
                "period_unit": "weeks",
                "soft_grace_period": 1,
                "soft_limit_size": 11.0,
                "thresholds_on": null
            },
            "quota_type": "directory",
            "state": "present",
            "user_name": null,
            "verify_ssl": false
        }
    },
    "quota_details": {
        "container": true,
        "efficiency_ratio": 0.02587890625,
        "enforced": true,
        "id": "CJhaEwIAAAAAAAAAAAAAQPgAAAAAAAAA",
        "include_snapshots": false,
        "linked": false,
        "notifications": "default",
        "path": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
        "persona": null,
        "ready": true,
        "reduction_ratio": null,
        "thresholds": {
            "advisory": 10737418240,
            "advisory(GB)": "10.0",
            "advisory_exceeded": false,
            "advisory_last_exceeded": null,
            "hard": 13958643712,
            "hard(GB)": "13.0",
            "hard_exceeded": false,
            "hard_last_exceeded": null,
            "percent_advisory": null,
            "percent_soft": null,
            "soft": 11811160064,
            "soft(GB)": "11.0",
            "soft_exceeded": false,
            "soft_grace": 604800,
            "soft_last_exceeded": null
        },
        "thresholds_on": "fslogicalsize",
        "type": "directory",
        "usage": {
            "applogical": 0,
            "applogical_ready": true,
            "fslogical": 53,
            "fslogical_ready": true,
            "fsphysical": 2048,
            "fsphysical_ready": true,
            "inodes": 1,
            "inodes_ready": true,
            "physical": 2048,
            "physical_data": 0,
            "physical_data_ready": true,
            "physical_protection": 0,
            "physical_protection_ready": true,
            "physical_ready": true,
            "shadow_refs": 0,
            "shadow_refs_ready": true
        }
    }
}



=========ERROR _LOG _START FOR SERVER_B===============

> The full traceback is:
  File "/tmp/ansible_dellemc.powerscale.smartquota_payload_01r59iil/ansible_dellemc.powerscale.smartquota_payload.zip/ansible_collections/dellemc/powerscale/plugins/modules/smartquota.py", line 599, in get_quota_details
  File "/usr/local/lib/python3.6/site-packages/isilon_sdk/v9_4_0/api/quota_api.py", line 1865, in list_quota_quotas
    (data) = self.list_quota_quotas_with_http_info(**kwargs)  # noqa: E501
  File "/usr/local/lib/python3.6/site-packages/isilon_sdk/v9_4_0/api/quota_api.py", line 1985, in list_quota_quotas_with_http_info
    collection_formats=collection_formats)
  File "/usr/local/lib/python3.6/site-packages/isilon_sdk/v9_4_0/api_client.py", line 346, in call_api
    _preload_content, _request_timeout)
  File "/usr/local/lib/python3.6/site-packages/isilon_sdk/v9_4_0/api_client.py", line 185, in __call_api
    return_data = self.deserialize(response_data, response_type)
  File "/usr/local/lib/python3.6/site-packages/isilon_sdk/v9_4_0/api_client.py", line 257, in deserialize
    return self.__deserialize(data, response_type)
  File "/usr/local/lib/python3.6/site-packages/isilon_sdk/v9_4_0/api_client.py", line 296, in __deserialize
    return self.__deserialize_model(data, klass)
  File "/usr/local/lib/python3.6/site-packages/isilon_sdk/v9_4_0/api_client.py", line 671, in __deserialize_model
    kwargs[attr] = self.__deserialize(value, attr_type)
  File "/usr/local/lib/python3.6/site-packages/isilon_sdk/v9_4_0/api_client.py", line 274, in __deserialize
    for sub_data in data]
  File "/usr/local/lib/python3.6/site-packages/isilon_sdk/v9_4_0/api_client.py", line 274, in <listcomp>
    for sub_data in data]
  File "/usr/local/lib/python3.6/site-packages/isilon_sdk/v9_4_0/api_client.py", line 296, in __deserialize
    return self.__deserialize_model(data, klass)
  File "/usr/local/lib/python3.6/site-packages/isilon_sdk/v9_4_0/api_client.py", line 673, in __deserialize_model
    instance = klass(**kwargs)
  File "/usr/local/lib/python3.6/site-packages/isilon_sdk/v9_4_0/models/quota_quota_extended.py", line 100, in __init__
    self.description = description
  File "/usr/local/lib/python3.6/site-packages/isilon_sdk/v9_4_0/models/quota_quota_extended.py", line 169, in description
    raise ValueError("Invalid value for `description`, must not be `None`")  # noqa: E501
fatal: [[xyz.domain.org]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "access_zone": "System",
            "api_password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "api_user": "isilon_user",
            "group_name": null,
            "onefs_host": "172.0.0.2<SERVER_B>",
            "path": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "port_no": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "provider_type": "local",
            "quota": {
                "advisory_limit_size": 10.0,
                "cap_unit": "GB",
                "container": true,
                "hard_limit_size": 13.0,
                "include_overheads": true,
                "include_snapshots": false,
                "period_unit": "weeks",
                "soft_grace_period": 1,
                "soft_limit_size": 11.0,
                "thresholds_on": null
            },
            "quota_type": "directory",
            "state": "present",
            "user_name": null,
            "verify_ssl": false
        }
    },
    "msg": "Get Quota Details for ******** failed with Invalid value for `description`, must not be `None`"
}
nikolisg7 commented 8 months ago

I believe there was a bug in the OneFS API with version 9.4.x.x to the effect that quota API queries didn't return a key "description" for quota in the JSON response if no description was available in the quota entry; in the API spec this key is defined as required, thus classes from the Python SKD are expecting it and they fail in this case with an error like "Invalid value for description, must not be None"; it has been fixed on OneFS 9.5;

trisha-dell commented 3 months ago

Hello @Javedkhansiddiqui,

Please use the latest version of the Isilon SDK (0.3.0.1). This issue has been resolved for version 9.4.x.x as well.