dell / dellemc-openmanage-ansible-modules

Dell OpenManage Ansible Modules
GNU General Public License v3.0
334 stars 163 forks source link

[BUG]: Incompatible with pysnmp >6.2.2 #704

Closed MallocArray closed 1 month ago

MallocArray commented 2 months ago

Bug Description

Dell playbooks failing after upgrading pysnmp to 6.2.2 - 6.2.4 but working with pysnmp 4.4.12

Opened issue with OMSDK repo as well https://github.com/dell/omsdk/issues/46

Component or Module Name

dellemc.openmanage.idrac_system_info

Ansible Version

2.16.9

Python Version

3.11

iDRAC/OME/OME-M version

iDRAC 7.00.00 MX740c blades

Operating System

Stream9 based Execution Environment

Playbook Used

    - name: Get system inventory
      dellemc.openmanage.idrac_system_info:
        idrac_ip: "{{ ansible_host }}"
        idrac_user: "{{ idrac_username }}"
        idrac_password: "{{ idrac_password }}"
        validate_certs: "{{ dell_validate_certs | default(omit) }}"
        ca_path: "{{ dell_ca_path | default(omit) }}"
      delegate_to: localhost
      tags: always
      register: idrac_system_info
      until: idrac_system_info is not failed
      retries: 0
      delay: 15

Logs

TASK [Get system inventory] *** task path: /runner/Dell/idrac/idrac_configuration.yml:23

ESTABLISH LOCAL CONNECTION FOR USER: root EXEC /bin/sh -c 'echo ~root && sleep 0' EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp `"&& mkdir "` echo /root/.ansible/tmp/ansible-tmp-1721674740.740452-903-140029397416120 `" && echo ansible-tmp-1721674740.740452-903-140029397416120="` echo /root/.ansible/tmp/ansible-tmp-1721674740.740452-903-140029397416120 `" ) && sleep 0' Using module file /runner/collections/ansible_collections/dellemc/openmanage/plugins/modules/idrac_system_info.py PUT /root/.ansible/tmp/ansible-local-8692e_20hs7/tmpbrey9cjp TO /root/.ansible/tmp/ansible-tmp-1721674740.740452-903-140029397416120/AnsiballZ_idrac_system_info.py EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1721674740.740452-903-140029397416120/ /root/.ansible/tmp/ansible-tmp-1721674740.740452-903-140029397416120/AnsiballZ_idrac_system_info.py && sleep 0' EXEC /bin/sh -c '/usr/bin/python3 /root/.ansible/tmp/ansible-tmp-1721674740.740452-903-140029397416120/AnsiballZ_idrac_system_info.py && sleep 0' EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1721674740.740452-903-140029397416120/ > /dev/null 2>&1 && sleep 0' The full traceback is: Traceback (most recent call last): File "/root/.ansible/tmp/ansible-tmp-1721674740.740452-903-140029397416120/AnsiballZ_idrac_system_info.py", line 107, in _ansiballz_main() File "/root/.ansible/tmp/ansible-tmp-1721674740.740452-903-140029397416120/AnsiballZ_idrac_system_info.py", line 99, in _ansiballz_main invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS) File "/root/.ansible/tmp/ansible-tmp-1721674740.740452-903-140029397416120/AnsiballZ_idrac_system_info.py", line 47, in invoke_module runpy.run_module(mod_name='ansible_collections.dellemc.openmanage.plugins.modules.idrac_system_info', init_globals=dict(_module_fqn='ansible_collections.dellemc.openmanage.plugins.modules.idrac_system_info', _modlib_path=modlib_path), File "", line 226, in run_module File "", line 98, in _run_module_code File "", line 88, in _run_code File "/tmp/ansible_dellemc.openmanage.idrac_system_info_payload_1qk0etkl/ansible_dellemc.openmanage.idrac_system_info_payload.zip/ansible_collections/dellemc/openmanage/plugins/modules/idrac_system_info.py", line 121, in File "/tmp/ansible_dellemc.openmanage.idrac_system_info_payload_1qk0etkl/ansible_dellemc.openmanage.idrac_system_info_payload.zip/ansible_collections/dellemc/openmanage/plugins/modules/idrac_system_info.py", line 106, in main File "/tmp/ansible_dellemc.openmanage.idrac_system_info_payload_1qk0etkl/ansible_dellemc.openmanage.idrac_system_info_payload.zip/ansible_collections/dellemc/openmanage/plugins/module_utils/dellemc_idrac.py", line 86, in __enter__ File "/usr/local/lib/python3.11/site-packages/omsdk/sdkinfra.py", line 88, in importPath module_loaded = self.load_from_file(fl[i]) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/omsdk/sdkinfra.py", line 61, in load_from_file py_mod = load_module(mod_name, filepath, False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/omsdk/sdkinfra.py", line 43, in load_module loader.exec_module(module) File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "/usr/local/lib/python3.11/site-packages/omdrivers/iDRAC.py", line 1915, in 'SysObjectID' : ObjectIdentity('SNMPv2-MIB', 'sysObjectID'), ^^^^^^^^^^^^^^ NameError: name 'ObjectIdentity' is not defined ### Steps to Reproduce Run playbook with pysnmp 4.4.12 installed successfully Upgrade to pysnmp 6.2.4 and run same playbook and receive the logs above ### Expected Behavior Playbook runs as expected ### Actual Behavior See logs for errors ### Screenshots _No response_ ### Additional Information _No response_
anupamaloke commented 2 months ago

@MallocArray, thank you for submitting this issue. We are looking into this error and will keep everyone updated with a potential fix.

vdudejon commented 2 months ago

I found that updating omdrivers/iDRAC.py with from pysnmp.smi.rfc1902 import ObjectIdentity fixed the issue

kitos9112 commented 2 months ago

We're pinning pysnmp to "6.1.3" in order to workaround this.

angyaljanos commented 2 months ago

Same error here, i tried to downgrade pysnmp to 4.4.12 but the error remains. My packages follows:

❯ pip list
Package            Version
------------------ --------
certifi            2024.7.4
charset-normalizer 3.3.2
future             1.0.0
idna               3.7
ipaddress          1.0.23
Jinja2             3.1.4
MarkupSafe         2.1.5
netaddr            1.3.0
omsdk              1.2.513
pip                22.0.2
ply                3.11
pyasn1             0.6.0
pycryptodomex      3.20.0
pysmi              1.4.4
pysnmp             4.4.12
pysnmp-mibs        0.1.6
PyYAML             6.0.1
requests           2.32.3
setuptools         59.6.0
urllib3            2.2.2
stf1966 commented 2 months ago

I found that updating omdrivers/iDRAC.py with from pysnmp.smi.rfc1902 import ObjectIdentity fixed the issue

same for me. Thanks

vdudejon commented 1 month ago

This should be resolved now with the latest release of the Dell OMSDK

rajshekarp87 commented 1 month ago

@MallocArray, This issue is fixed with latest release of OMSDK. Please find below the links: GitHub: https://github.com/dell/omsdk PyPI: https://pypi.org/project/omsdk/