lae / ansible-role-proxmox

IaC for Proxmox VE clusters.
MIT License
496 stars 144 forks source link

AttributeError: 'module' object has no attribute 'run' #231

Closed mocart2 closed 7 months ago

mocart2 commented 10 months ago

On second run (cluster init playbook), a get error:

TASK [lae.proxmox : Check for kernel update] ********************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'module' object has no attribute 'run'
fatal: [pvenode3.example.com]: FAILED! => changed=false 
  module_stderr: |-
    Warning: Permanently added 'pvenode3.example.com' (ED25519) to the list of known hosts.
    Connection to pvenode3.example.com closed.
  module_stdout: |-
    Traceback (most recent call last):
      File "/home/username/.ansible/tmp/ansible-tmp-1700245596.351199-57927-220364742700907/AnsiballZ_collect_kernel_info.py", line 100, in <module>
        _ansiballz_main()
      File "/home/username/.ansible/tmp/ansible-tmp-1700245596.351199-57927-220364742700907/AnsiballZ_collect_kernel_info.py", line 92, in _ansiballz_main
        invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
      File "/home/username/.ansible/tmp/ansible-tmp-1700245596.351199-57927-220364742700907/AnsiballZ_collect_kernel_info.py", line 41, in invoke_module
        run_name='__main__', alter_sys=True)
      File "/usr/lib/python2.7/runpy.py", line 188, in run_module
        fname, loader, pkg_name)
      File "/usr/lib/python2.7/runpy.py", line 82, in _run_module_code
        mod_name, mod_fname, mod_loader, pkg_name)
      File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
        exec code in run_globals
      File "/tmp/ansible_collect_kernel_info_payload_eDh1rK/ansible_collect_kernel_info_payload.zip/ansible/modules/collect_kernel_info.py", line 70, in <module>
      File "/tmp/ansible_collect_kernel_info_payload_eDh1rK/ansible_collect_kernel_info_payload.zip/ansible/modules/collect_kernel_info.py", line 37, in main
    AttributeError: 'module' object has no attribute 'run'
  msg: |-
    MODULE FAILURE
    See stdout/stderr for the exact error
  rc: 1
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'module' object has no attribute 'run'
fatal: [pvenode2.example.com]: FAILED! => changed=false 
  module_stderr: |-
    Warning: Permanently added 'pvenode2.example.com' (ED25519) to the list of known hosts.
    Connection to pvenode2.example.com closed.
  module_stdout: |-
    Traceback (most recent call last):
      File "/home/username/.ansible/tmp/ansible-tmp-1700245596.44672-57930-68134482669865/AnsiballZ_collect_kernel_info.py", line 100, in <module>
        _ansiballz_main()
      File "/home/username/.ansible/tmp/ansible-tmp-1700245596.44672-57930-68134482669865/AnsiballZ_collect_kernel_info.py", line 92, in _ansiballz_main
        invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
      File "/home/username/.ansible/tmp/ansible-tmp-1700245596.44672-57930-68134482669865/AnsiballZ_collect_kernel_info.py", line 41, in invoke_module
        run_name='__main__', alter_sys=True)
      File "/usr/lib/python2.7/runpy.py", line 188, in run_module
        fname, loader, pkg_name)
      File "/usr/lib/python2.7/runpy.py", line 82, in _run_module_code
        mod_name, mod_fname, mod_loader, pkg_name)
      File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
        exec code in run_globals
      File "/tmp/ansible_collect_kernel_info_payload_MEOLMw/ansible_collect_kernel_info_payload.zip/ansible/modules/collect_kernel_info.py", line 70, in <module>
      File "/tmp/ansible_collect_kernel_info_payload_MEOLMw/ansible_collect_kernel_info_payload.zip/ansible/modules/collect_kernel_info.py", line 37, in main
    AttributeError: 'module' object has no attribute 'run'
  msg: |-
    MODULE FAILURE
    See stdout/stderr for the exact error
  rc: 1
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'module' object has no attribute 'run'
fatal: [pvenode1.example.com]: FAILED! => changed=false 
  module_stderr: |-
    Warning: Permanently added 'pvenode1.example.com' (ED25519) to the list of known hosts.
    Connection to pvenode1.example.com closed.
  module_stdout: |-
    Traceback (most recent call last):
      File "/home/username/.ansible/tmp/ansible-tmp-1700245596.389527-57928-225016512301287/AnsiballZ_collect_kernel_info.py", line 100, in <module>
        _ansiballz_main()
      File "/home/username/.ansible/tmp/ansible-tmp-1700245596.389527-57928-225016512301287/AnsiballZ_collect_kernel_info.py", line 92, in _ansiballz_main
        invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
      File "/home/username/.ansible/tmp/ansible-tmp-1700245596.389527-57928-225016512301287/AnsiballZ_collect_kernel_info.py", line 41, in invoke_module
        run_name='__main__', alter_sys=True)
      File "/usr/lib/python2.7/runpy.py", line 188, in run_module
        fname, loader, pkg_name)
      File "/usr/lib/python2.7/runpy.py", line 82, in _run_module_code
        mod_name, mod_fname, mod_loader, pkg_name)
      File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
        exec code in run_globals
      File "/tmp/ansible_collect_kernel_info_payload_42Coqx/ansible_collect_kernel_info_payload.zip/ansible/modules/collect_kernel_info.py", line 70, in <module>
      File "/tmp/ansible_collect_kernel_info_payload_42Coqx/ansible_collect_kernel_info_payload.zip/ansible/modules/collect_kernel_info.py", line 37, in main
    AttributeError: 'module' object has no attribute 'run'
  msg: |-
    MODULE FAILURE
    See stdout/stderr for the exact error
  rc: 1

node already rebooted, after first non-cluster install, and OS is have proxmox kernel

lae commented 7 months ago

@mocart2 sorry, it seems I completely missed this report.

You...wouldn't still happen to be having this issue, would you?

It looks like you're having an issue when the module calls subprocess.run, which only exists on Python 3.5+, and your output suggests you're using Python 2.7. Why is this?

This isn't standard on Debian 11+ since Python 2 was removed, and Debian 10 has Python 3.7 so that should probably be installed when using Ansible.