linux-system-roles / storage

Ansible role for linux storage management
https://linux-system-roles.github.io/storage/
MIT License
101 stars 58 forks source link

Required package libblockdev-nvme not installed on EL9 #382

Closed myllynen closed 10 months ago

myllynen commented 11 months ago

Perhaps the role should install libblockdev-nvme as on RHEL 9 I saw this error without manually installing it:

TASK [redhat.rhel_system_roles.storage : Manage the pools and volumes to match the specified state]
...
fatal: [10.10.10.10]: FAILED! =>
    changed: false
    module_stderr: |4-

        ** (process:8840): WARNING **: 12:38:45.660: failed to load module nvme: libbd_nvme.so.2: cannot open shared object file: No such file or directory

Thanks.

vojtechtrefny commented 11 months ago

I've added the dependency on #383, but the nvme plugin is optional dependency in blivet, so we should also try to find out why is it a critical error here.

richm commented 11 months ago

@myllynen is https://github.com/linux-system-roles/storage/issues/382#issue-1911099462 the full, entire error message? I'm running https://github.com/linux-system-roles/storage/blob/main/tests/tests_swap.yml#L44 except that I have changed it to use type: lvm. Then I run like this:

tox -e qemu-ansible-core-2.15 -- --image-name rhel-9-2 --log-level debug tests/tests_swap.yml 2>&1 | tee output

This is the output:

fatal: [/home/rmeggins/.cache/linux-system-roles/rhel-9-2.qcow2]: FAILED! => {
    "changed": false,
    "rc": 1
}

MSG:

MODULE FAILURE
See stdout/stderr for the exact error

MODULE_STDOUT:

** (process:24925): WARNING **: 10:45:25.384: failed to load module nvme: libbd_nvme.so.2: cannot open shared object file: No such file or directory

** (process:24925): CRITICAL **: 10:45:25.811: The function 'bd_nvme_get_namespace_info' called, but not implemented!

** (process:24925): CRITICAL **: 10:45:25.820: The function 'bd_nvme_get_namespace_info' called, but not implemented!

** (process:24925): CRITICAL **: 10:45:25.830: The function 'bd_nvme_get_namespace_info' called, but not implemented!
Traceback (most recent call last):
  File "/root/.ansible/tmp/ansible-tmp-1695653125.1445422-678326-237712421545466/AnsiballZ_blivet.py", line 107, in <module>
    _ansiballz_main()
  File "/root/.ansible/tmp/ansible-tmp-1695653125.1445422-678326-237712421545466/AnsiballZ_blivet.py", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/root/.ansible/tmp/ansible-tmp-1695653125.1445422-678326-237712421545466/AnsiballZ_blivet.py", line 47, in invoke_module
    runpy.run_module(mod_name='ansible.modules.blivet', init_globals=dict(_module_fqn='ansible.modules.blivet', _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_blivet_payload_whkias3u/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 1985, in <module>
  File "/tmp/ansible_blivet_payload_whkias3u/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 1981, in main
  File "/tmp/ansible_blivet_payload_whkias3u/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 1943, in run_module
  File "/tmp/ansible_blivet_payload_whkias3u/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 1566, in manage_volume
  File "/tmp/ansible_blivet_payload_whkias3u/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 584, in manage
  File "/tmp/ansible_blivet_payload_whkias3u/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 358, in _look_up_device
  File "/tmp/ansible_blivet_payload_whkias3u/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 711, in _get_device_id
AttributeError: 'NoneType' object has no attribute '_device'

MODULE_STDERR:

Shared connection to 127.0.0.3 closed.

TASK [linux-system-roles.storage : Failed message] *****************************
task path: /home/rmeggins/linux-system-roles/storage/tests/roles/linux-system-roles.storage/tasks/main-blivet.yml:95
Monday 25 September 2023  08:45:25 -0600 (0:00:00.854)       0:01:08.180 ****** 
fatal: [/home/rmeggins/.cache/linux-system-roles/rhel-9-2.qcow2]: FAILED! => {
    "changed": false
}

MSG:

{'failed': True, 'module_stdout': '\r\n** (process:24925): \x1b[1;33mWARNING\x1b[0m **: \x1b[34m10:45:25.384\x1b[0m: failed to load module nvme: fatal: [/home/rmeggins/.cache/linux-system-roles/rhel-9-2.qcow2]: FAILED! => {
    "changed": false,
    "rc": 1
}

MSG:

MODULE FAILURE
See stdout/stderr for the exact error

MODULE_STDOUT:

** (process:24925): WARNING **: 10:45:25.384: failed to load module nvme: libbd_nvme.so.2: cannot open shared object file: No such file or directory

** (process:24925): CRITICAL **: 10:45:25.811: The function 'bd_nvme_get_namespace_info' called, but not implemented!

** (process:24925): CRITICAL **: 10:45:25.820: The function 'bd_nvme_get_namespace_info' called, but not implemented!

** (process:24925): CRITICAL **: 10:45:25.830: The function 'bd_nvme_get_namespace_info' called, but not implemented!
Traceback (most recent call last):
  File "/root/.ansible/tmp/ansible-tmp-1695653125.1445422-678326-237712421545466/AnsiballZ_blivet.py", line 107, in <module>
    _ansiballz_main()
  File "/root/.ansible/tmp/ansible-tmp-1695653125.1445422-678326-237712421545466/AnsiballZ_blivet.py", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/root/.ansible/tmp/ansible-tmp-1695653125.1445422-678326-237712421545466/AnsiballZ_blivet.py", line 47, in invoke_module
    runpy.run_module(mod_name='ansible.modules.blivet', init_globals=dict(_module_fqn='ansible.modules.blivet', _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_blivet_payload_whkias3u/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 1985, in <module>
  File "/tmp/ansible_blivet_payload_whkias3u/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 1981, in main
  File "/tmp/ansible_blivet_payload_whkias3u/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 1943, in run_module
  File "/tmp/ansible_blivet_payload_whkias3u/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 1566, in manage_volume
  File "/tmp/ansible_blivet_payload_whkias3u/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 584, in manage
  File "/tmp/ansible_blivet_payload_whkias3u/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 358, in _look_up_device
  File "/tmp/ansible_blivet_payload_whkias3u/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 711, in _get_device_id
AttributeError: 'NoneType' object has no attribute '_device'

MODULE_STDERR:

Shared connection to 127.0.0.3 closed.

TASK [linux-system-roles.storage : Failed message] *****************************
task path: /home/rmeggins/linux-system-roles/storage/tests/roles/linux-system-roles.storage/tasks/main-blivet.yml:95
Monday 25 September 2023  08:45:25 -0600 (0:00:00.854)       0:01:08.180 ****** 
fatal: [/home/rmeggins/.cache/linux-system-roles/rhel-9-2.qcow2]: FAILED! => {
    "changed": false
}

MSG:

{'failed': True, 'module_stdout': '\r\n** (process:24925): \x1b[1;33mWARNING\x1b[0m **: \x1b[34m10:45:25.384\x1b[0m: failed to load module nvme: libbd_nvme.so.2: cannot open shared object file: No such file or directory\r\n\r\n** (process:24925): \x1b[1;35mCRITICAL\x1b[0m **: \x1b[34m10:45:25.811\x1b[0m: The function \'bd_nvme_get_namespace_info\' called, but not implemented!\r\n\r\n** (process:24925): \x1b[1;35mCRITICAL\x1b[0m **: \x1b[34m10:45:25.820\x1b[0m: The function \'bd_nvme_get_namespace_info\' called, but not implemented!\r\n\r\n** (process:24925): \x1b[1;35mCRITICAL\x1b[0m **: \x1b[34m10:45:25.830\x1b[0m: The function \'bd_nvme_get_namespace_info\' called, but not implemented!\r\nTraceback (most recent call last):\r\n  File "/root/.ansible/tmp/ansible-tmp-1695653125.1445422-678326-237712421545466/AnsiballZ_blivet.py", line 107, in <module>\r\n    _ansiballz_main()\r\n  File "/root/.ansible/tmp/ansible-tmp-1695653125.1445422-678326-237712421545466/AnsiballZ_blivet.py", line 99, in _ansiballz_main\r\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n  File "/root/.ansible/tmp/ansible-tmp-1695653125.1445422-678326-237712421545466/AnsiballZ_blivet.py", line 47, in invoke_module\r\n    runpy.run_module(mod_name=\'ansible.modules.blivet\', init_globals=dict(_module_fqn=\'ansible.modules.blivet\', _modlib_path=modlib_path),\r\n  File "/usr/lib64/python3.9/runpy.py", line 225, in run_module\r\n    return _run_module_code(code, init_globals, run_name, mod_spec)\r\n  File "/usr/lib64/python3.9/runpy.py", line 97, in _run_module_code\r\n    _run_code(code, mod_globals, init_globals,\r\n  File "/usr/lib64/python3.9/runpy.py", line 87, in _run_code\r\n    exec(code, run_globals)\r\n  File "/tmp/ansible_blivet_payload_whkias3u/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 1985, in <module>\r\n  File "/tmp/ansible_blivet_payload_whkias3u/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 1981, in main\r\n  File "/tmp/ansible_blivet_payload_whkias3u/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 1943, in run_module\r\n  File "/tmp/ansible_blivet_payload_whkias3u/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 1566, in manage_volume\r\n  File "/tmp/ansible_blivet_payload_whkias3u/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 584, in manage\r\n  File "/tmp/ansible_blivet_payload_whkias3u/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 358, in _look_up_device\r\n  File "/tmp/ansible_blivet_payload_whkias3u/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 711, in _get_device_id\r\nAttributeError: \'NoneType\' object has no attribute \'_device\'\r\n', 'module_stderr': 'Shared connection to 127.0.0.3 closed.\r\n', 'msg': 'MODULE FAILURE\nSee stdout/stderr for the exact error', 'rc': 1, '_ansible_no_log': None, 'changed': False}: No such file or directory\r\n\r\n** (process:24925): \x1b[1;35mCRITICAL\x1b[0m **: \x1b[34m10:45:25.811\x1b[0m: The function \'bd_nvme_get_namespace_info\' called, but not implemented!\r\n\r\n** (process:24925): \x1b[1;35mCRITICAL\x1b[0m **: \x1b[34m10:45:25.820\x1b[0m: The function \'bd_nvme_get_namespace_info\' called, but not implemented!\r\n\r\n** (process:24925): \x1b[1;35mCRITICAL\x1b[0m **: \x1b[34m10:45:25.830\x1b[0m: The function \'bd_nvme_get_namespace_info\' called, but not implemented!\r\nTraceback (most recent call last):\r\n  File "/root/.ansible/tmp/ansible-tmp-1695653125.1445422-678326-237712421545466/AnsiballZ_blivet.py", line 107, in <module>\r\n    _ansiballz_main()\r\n  File "/root/.ansible/tmp/ansible-tmp-1695653125.1445422-678326-237712421545466/AnsiballZ_blivet.py", line 99, in _ansiballz_main\r\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n  File "/root/.ansible/tmp/ansible-tmp-1695653125.1445422-678326-237712421545466/AnsiballZ_blivet.py", line 47, in invoke_module\r\n    runpy.run_module(mod_name=\'ansible.modules.blivet\', init_globals=dict(_module_fqn=\'ansible.modules.blivet\', _modlib_path=modlib_path),\r\n  File "/usr/lib64/python3.9/runpy.py", line 225, in run_module\r\n    return _run_module_code(code, init_globals, run_name, mod_spec)\r\n  File "/usr/lib64/python3.9/runpy.py", line 97, in _run_module_code\r\n    _run_code(code, mod_globals, init_globals,\r\n  File "/usr/lib64/python3.9/runpy.py", line 87, in _run_code\r\n    exec(code, run_globals)\r\n  File "/tmp/ansible_blivet_payload_whkias3u/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 1985, in <module>\r\n  File "/tmp/ansible_blivet_payload_whkias3u/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 1981, in main\r\n  File "/tmp/ansible_blivet_payload_whkias3u/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 1943, in run_module\r\n  File "/tmp/ansible_blivet_payload_whkias3u/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 1566, in manage_volume\r\n  File "/tmp/ansible_blivet_payload_whkias3u/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 584, in manage\r\n  File "/tmp/ansible_blivet_payload_whkias3u/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 358, in _look_up_device\r\n  File "/tmp/ansible_blivet_payload_whkias3u/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 711, in _get_device_id\r\nAttributeError: \'NoneType\' object has no attribute \'_device\'\r\n', 'module_stderr': 'Shared connection to 127.0.0.3 closed.\r\n', 'msg': 'MODULE FAILURE\nSee stdout/stderr for the exact error', 'rc': 1, '_ansible_no_log': None, 'changed': False}

As you can see - the libbd_nvme.so.2 part is just a WARNING - the actual error is in the python code traceback:

  File "/tmp/ansible_blivet_payload_whkias3u/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 711, in _get_device_id
AttributeError: 'NoneType' object has no attribute '_device'

This is the "real" problem.

myllynen commented 11 months ago

Thanks, indeed it was the same for me. Perhaps the warning could be ignored, though libblockdev-nvme adds only 270k after installing the other pre-req packages.

richm commented 11 months ago

I would like to find some way to suppress the WARNING and CRITICAL errors - they just add noise and make debugging difficult.

vojtechtrefny commented 10 months ago

I would like to find some way to suppress the WARNING and CRITICAL errors - they just add noise and make debugging difficult.

That needs to be fixed in libblockdev, blivet will then redirect the error messages to its log file instead of having these printed on stderr.