Bug 1990793

Summary: [storage role] Get syntax errors in tests_lvm_errors.yml
Product: Red Hat Enterprise Linux 8 Reporter: guazhang <guazhang>
Component: rhel-system-rolesAssignee: Rich Megginson <rmeggins>
Status: CLOSED ERRATA QA Contact: guazhang <guazhang>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.5CC: djez, dlehman, japokorn, jharuda, nhosoi, pcahyna, spetrosi
Target Milestone: betaFlags: pm-rhel: mirror+
Target Release: 8.5   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: role:storage
Fixed In Version: rhel-system-roles-1.7.1-1.el8 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
: 1991142 (view as bug list) Environment:
Last Closed: 2021-11-09 17:46:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1991142    

Description guazhang@redhat.com 2021-08-06 09:03:36 UTC
Description of problem:
Storage role regression testing failed, please have a look if hit a bug.

Version-Release number of selected component (if applicable):
rhel-system-roles-1.5.1-1.el8.noarch

How reproducible:


Steps to Reproduce:
1. ansible-playbook -vv -i host tests_lvm_errors.yml
2.
3.



TASK [rhel-system-roles.storage : get required packages] *******************************************************************************
task path: /usr/share/ansible/roles/rhel-system-roles.storage/tasks/main-blivet.yml:18
fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: [{'name': 'foo', 'disks': '{{ unused_disks[0] }}', 'volumes': [{'name': 'test1', 'size': '{{ volume_size }}', 'mount_point': '{{ mount_location1 }}'}]}]: 'volume_size' is undefined\n\nThe error appears to be in '/usr/share/ansible/roles/rhel-system-roles.storage/tasks/main-blivet.yml': line 18, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: get required packages\n  ^ here\n"}



task path: /usr/share/ansible/roles/rhel-system-roles.storage/tasks/main-blivet.yml:57
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'NoneType' object has no attribute '_device'
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/root/.ansible/tmp/ansible-tmp-1628238291.2594755-244172-85072390066614/AnsiballZ_blivet.py\", line 102, in <module>\n    _ansiballz_main()\n  File \"/root/.ansible/tmp/ansible-tmp-1628238291.2594755-244172-85072390066614/AnsiballZ_blivet.py\", line 94, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/root/.ansible/tmp/ansible-tmp-1628238291.2594755-244172-85072390066614/AnsiballZ_blivet.py\", line 40, in invoke_module\n    runpy.run_module(mod_name='ansible.modules.blivet', init_globals=None, run_name='__main__', alter_sys=True)\n  File \"/usr/lib64/python3.6/runpy.py\", line 205, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib64/python3.6/runpy.py\", line 96, in _run_module_code\n    mod_name, mod_spec, pkg_name, script_name)\n  File \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_blivet_payload_thpg5b7b/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 1530, in <module>\n  File \"/tmp/ansible_blivet_payload_thpg5b7b/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 1526, in main\n  File \"/tmp/ansible_blivet_payload_thpg5b7b/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 1488, in run_module\n  File \"/tmp/ansible_blivet_payload_thpg5b7b/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 1181, in manage_volume\n  File \"/tmp/ansible_blivet_payload_thpg5b7b/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 521, in manage\n  File \"/tmp/ansible_blivet_payload_thpg5b7b/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 348, in _look_up_device\n  File \"/tmp/ansible_blivet_payload_thpg5b7b/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 639, in _get_device_id\nAttributeError: 'NoneType' object has no attribute '_device'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}



TASK [rhel-system-roles.storage : failed message] **************************************************************************************
task path: /usr/share/ansible/roles/rhel-system-roles.storage/tasks/main-blivet.yml:71
fatal: [localhost]: FAILED! => {"changed": false, "msg": {"changed": false, "exception": "Traceback (most recent call last):\n  File \"/root/.ansible/tmp/ansible-tmp-1628238291.2594755-244172-85072390066614/AnsiballZ_blivet.py\", line 102, in <module>\n    _ansiballz_main()\n  File \"/root/.ansible/tmp/ansible-tmp-1628238291.2594755-244172-85072390066614/AnsiballZ_blivet.py\", line 94, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/root/.ansible/tmp/ansible-tmp-1628238291.2594755-244172-85072390066614/AnsiballZ_blivet.py\", line 40, in invoke_module\n    runpy.run_module(mod_name='ansible.modules.blivet', init_globals=None, run_name='__main__', alter_sys=True)\n  File \"/usr/lib64/python3.6/runpy.py\", line 205, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib64/python3.6/runpy.py\", line 96, in _run_module_code\n    mod_name, mod_spec, pkg_name, script_name)\n  File \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_blivet_payload_thpg5b7b/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 1530, in <module>\n  File \"/tmp/ansible_blivet_payload_thpg5b7b/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 1526, in main\n  File \"/tmp/ansible_blivet_payload_thpg5b7b/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 1488, in run_module\n  File \"/tmp/ansible_blivet_payload_thpg5b7b/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 1181, in manage_volume\n  File \"/tmp/ansible_blivet_payload_thpg5b7b/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 521, in manage\n  File \"/tmp/ansible_blivet_payload_thpg5b7b/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 348, in _look_up_device\n  File \"/tmp/ansible_blivet_payload_thpg5b7b/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 639, in _get_device_id\nAttributeError: 'NoneType' object has no attribute '_device'\n", "failed": true, "module_stderr": "Traceback (most recent call last):\n  File \"/root/.ansible/tmp/ansible-tmp-1628238291.2594755-244172-85072390066614/AnsiballZ_blivet.py\", line 102, in <module>\n    _ansiballz_main()\n  File \"/root/.ansible/tmp/ansible-tmp-1628238291.2594755-244172-85072390066614/AnsiballZ_blivet.py\", line 94, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/root/.ansible/tmp/ansible-tmp-1628238291.2594755-244172-85072390066614/AnsiballZ_blivet.py\", line 40, in invoke_module\n    runpy.run_module(mod_name='ansible.modules.blivet', init_globals=None, run_name='__main__', alter_sys=True)\n  File \"/usr/lib64/python3.6/runpy.py\", line 205, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib64/python3.6/runpy.py\", line 96, in _run_module_code\n    mod_name, mod_spec, pkg_name, script_name)\n  File \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_blivet_payload_thpg5b7b/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 1530, in <module>\n  File \"/tmp/ansible_blivet_payload_thpg5b7b/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 1526, in main\n  File \"/tmp/ansible_blivet_payload_thpg5b7b/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 1488, in run_module\n  File \"/tmp/ansible_blivet_payload_thpg5b7b/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 1181, in manage_volume\n  File \"/tmp/ansible_blivet_payload_thpg5b7b/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 521, in manage\n  File \"/tmp/ansible_blivet_payload_thpg5b7b/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 348, in _look_up_device\n  File \"/tmp/ansible_blivet_payload_thpg5b7b/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 639, in _get_device_id\nAttributeError: 'NoneType' object has no attribute '_device'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}}

Comment 1 Rich Megginson 2021-08-06 14:33:42 UTC
What is your controller platform (el8? el8.5?) and what version of ansible are you using - 2.8 or 2.9?

I see this message in the output from running my test on f34 using ansible 2.9:

The task includes an option with an undefined variable. The error was: [{'name': 'foo', 'disks': '{{ unused_disks[0] }}', 'volumes': [{'name': 'test1', 'size': '{{ volume_size }}', 'mount_point': '{{ mount_location1 }}'}]}]: 'volume_size' is undefined

The error appears to be in '/home/rmeggins/linux-system-roles/storage/tasks/main-blivet.yml': line 18, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

but the "rescue:" block handles this 

So I'm not sure how this error "leaked" out of the rescue block - that's really strange

This is a real bug and I am going to fix it - but I want to know why this wasn't found by CI testing

Comment 2 guazhang@redhat.com 2021-08-07 13:13:36 UTC
Hi,

# ansible --version
ansible 2.9.23
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.6/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.6.8 (default, Jul 14 2021, 07:24:37) [GCC 8.5.0 20210514 (Red Hat 8.5.0-2)]

[root@storageqe-90 ~]# uname -a
Linux storageqe-90.lab.eng.brq.redhat.com 4.18.0-326.el8.x86_64 #1 SMP Tue Jul 27 20:07:27 EDT 2021 x86_64 x86_64 x86_64 GNU/Linux   
[root@storageqe-90 ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux release 8.6 Beta (Ootpa)
DISTRO=RHEL-8.5.0-20210730.n.0

I test it by my physics server and hit it every time, the error is very easy to reproduce.

Comment 5 guazhang@redhat.com 2021-08-10 11:52:37 UTC
Hi,

rhel-system-roles-1.7.5-99.el8.noarch

fixed the get required packages task error.

TASK [rhel-system-roles.storage : get required packages] *******************************************************************************
task path: /usr/share/ansible/roles/rhel-system-roles.storage/tasks/main-blivet.yml:18
ok: [localhost] => {"actions": [], "changed": false, "crypts": [], "leaves": [], "mounts": [], "packages": [], "pools": [], "volumes": []}



but still hit other errors, or the error is expected ?


TASK [rhel-system-roles.storage : Mask the systemd cryptsetup services] ****************************************************************
task path: /usr/share/ansible/roles/rhel-system-roles.storage/tasks/main-blivet.yml:51


the task in tests_lvm_errors.yaml 
TASK [Try to create LVM volume from outside of any pool.] ******************************************************************************
task path: /usr/share/ansible/roles/rhel-system-roles.storage/tests/tests_lvm_errors.yml:157

TASK [rhel-system-roles.storage : manage the pools and volumes to match the specified state] *******************************************
task path: /usr/share/ansible/roles/rhel-system-roles.storage/tasks/main-blivet.yml:57
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'NoneType' object has no attribute '_device'
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/root/.ansible/tmp/ansible-tmp-1628571143.4451976-262603-185620659085404/AnsiballZ_blivet.py\", line 102, in <module>\n    _ansiballz_main()\n  File \"/root/.ansible/tmp/ansible-tmp-1628571143.4451976-262603-185620659085404/AnsiballZ_blivet.py\", line 94, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/root/.ansible/tmp/ansible-tmp-1628571143.4451976-262603-185620659085404/AnsiballZ_blivet.py\", line 40, in invoke_module\n    runpy.run_module(mod_name='ansible.modules.blivet', init_globals=None, run_name='__main__', alter_sys=True)\n  File \"/usr/lib64/python3.6/runpy.py\", line 205, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib64/python3.6/runpy.py\", line 96, in _run_module_code\n    mod_name, mod_spec, pkg_name, script_name)\n  File \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 1552, in <module>\n  File \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 1548, in main\n  File \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 1510, in run_module\n  File \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 1203, in manage_volume\n  File \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 536, in manage\n  File \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 348, in _look_up_device\n  File \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 658, in _get_device_id\nAttributeError: 'NoneType' object has no attribute '_device'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

TASK [rhel-system-roles.storage : failed message] **************************************************************************************
task path: /usr/share/ansible/roles/rhel-system-roles.storage/tasks/main-blivet.yml:71
fatal: [localhost]: FAILED! => {"changed": false, "msg": {"changed": false, "exception": "Traceback (most recent call last):\n  File \"/root/.ansible/tmp/ansible-tmp-1628571143.4451976-262603-185620659085404/AnsiballZ_blivet.py\", line 102, in <module>\n    _ansiballz_main()\n  File \"/root/.ansible/tmp/ansible-tmp-1628571143.4451976-262603-185620659085404/AnsiballZ_blivet.py\", line 94, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/root/.ansible/tmp/ansible-tmp-1628571143.4451976-262603-185620659085404/AnsiballZ_blivet.py\", line 40, in invoke_module\n    runpy.run_module(mod_name='ansible.modules.blivet', init_globals=None, run_name='__main__', alter_sys=True)\n  File \"/usr/lib64/python3.6/runpy.py\", line 205, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib64/python3.6/runpy.py\", line 96, in _run_module_code\n    mod_name, mod_spec, pkg_name, script_name)\n  File \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 1552, in <module>\n  File \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 1548, in main\n  File \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 1510, in run_module\n  File \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 1203, in manage_volume\n  File \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 536, in manage\n  File \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 348, in _look_up_device\n  File \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 658, in _get_device_id\nAttributeError: 'NoneType' object has no attribute '_device'\n", "failed": true, "module_stderr": "Traceback (most recent call last):\n  File \"/root/.ansible/tmp/ansible-tmp-1628571143.4451976-262603-185620659085404/AnsiballZ_blivet.py\", line 102, in <module>\n    _ansiballz_main()\n  File \"/root/.ansible/tmp/ansible-tmp-1628571143.4451976-262603-185620659085404/AnsiballZ_blivet.py\", line 94, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/root/.ansible/tmp/ansible-tmp-1628571143.4451976-262603-185620659085404/AnsiballZ_blivet.py\", line 40, in invoke_module\n    runpy.run_module(mod_name='ansible.modules.blivet', init_globals=None, run_name='__main__', alter_sys=True)\n  File \"/usr/lib64/python3.6/runpy.py\", line 205, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib64/python3.6/runpy.py\", line 96, in _run_module_code\n    mod_name, mod_spec, pkg_name, script_name)\n  File \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 1552, in <module>\n  File \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 1548, in main\n  File \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 1510, in run_module\n  File \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 1203, in manage_volume\n  File \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 536, in manage\n  File \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 348, in _look_up_device\n  File \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 658, in _get_device_id\nAttributeError: 'NoneType' object has no attribute '_device'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}}

Comment 6 Rich Megginson 2021-08-10 14:58:56 UTC
(In reply to guazhang from comment #5)
> Hi,
> 
> rhel-system-roles-1.7.5-99.el8.noarch
> 
> fixed the get required packages task error.
> 
> TASK [rhel-system-roles.storage : get required packages]
> *****************************************************************************
> **
> task path:
> /usr/share/ansible/roles/rhel-system-roles.storage/tasks/main-blivet.yml:18
> ok: [localhost] => {"actions": [], "changed": false, "crypts": [], "leaves":
> [], "mounts": [], "packages": [], "pools": [], "volumes": []}
> 
> 
> 
> but still hit other errors, or the error is expected ?

Yes, and no.

Yes, there is an error expected here.  The point of the test is to pass in various bad parameters to the storage role to see that it raises errors.

No, the problem is that the error being raised by the storage role is not the expected error.  I will investigate.

Another issue is a general observation about the way Ansible does "exception handling".  There is unfortunately no way to completely hide the errors from the Ansible output when using the block/rescue style.  The error is always printed to the log with a BIG BOLD "FAILED!" error message, which is alarming to users, even though the error is caught and handled appropriately.  I'm not sure if there is a way around this unless we go to a completely different way to handle such errors in Ansible.

The only way to really tell, when you are looking at an Ansible log, to see if the error is a "real" error or not, is to look at the play summary printed at the end.  For example:

PLAY RECAP *********************************************************************
hostname : ok=193  changed=4    unreachable=0    failed=10   skipped=94   rescued=10   ignored=0

You can see that there were 10 failed tasks, but 10 rescued, meaning all of the errors were handled.

You can also tell that the exit code of the ansible-playbook command is 0 for success, or non-zero for failure.


> 
> 
> TASK [rhel-system-roles.storage : Mask the systemd cryptsetup services]
> ****************************************************************
> task path:
> /usr/share/ansible/roles/rhel-system-roles.storage/tasks/main-blivet.yml:51
> 
> 
> the task in tests_lvm_errors.yaml 
> TASK [Try to create LVM volume from outside of any pool.]
> *****************************************************************************
> *
> task path:
> /usr/share/ansible/roles/rhel-system-roles.storage/tests/tests_lvm_errors.
> yml:157
> 
> TASK [rhel-system-roles.storage : manage the pools and volumes to match the
> specified state] *******************************************
> task path:
> /usr/share/ansible/roles/rhel-system-roles.storage/tasks/main-blivet.yml:57
> An exception occurred during task execution. To see the full traceback, use
> -vvv. The error was: AttributeError: 'NoneType' object has no attribute
> '_device'
> fatal: [localhost]: FAILED! => {"changed": false, "module_stderr":
> "Traceback (most recent call last):\n  File
> \"/root/.ansible/tmp/ansible-tmp-1628571143.4451976-262603-185620659085404/
> AnsiballZ_blivet.py\", line 102, in <module>\n    _ansiballz_main()\n  File
> \"/root/.ansible/tmp/ansible-tmp-1628571143.4451976-262603-185620659085404/
> AnsiballZ_blivet.py\", line 94, in _ansiballz_main\n   
> invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File
> \"/root/.ansible/tmp/ansible-tmp-1628571143.4451976-262603-185620659085404/
> AnsiballZ_blivet.py\", line 40, in invoke_module\n   
> runpy.run_module(mod_name='ansible.modules.blivet', init_globals=None,
> run_name='__main__', alter_sys=True)\n  File
> \"/usr/lib64/python3.6/runpy.py\", line 205, in run_module\n    return
> _run_module_code(code, init_globals, run_name, mod_spec)\n  File
> \"/usr/lib64/python3.6/runpy.py\", line 96, in _run_module_code\n   
> mod_name, mod_spec, pkg_name, script_name)\n  File
> \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code\n    exec(code,
> run_globals)\n  File
> \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/
> modules/blivet.py\", line 1552, in <module>\n  File
> \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/
> modules/blivet.py\", line 1548, in main\n  File
> \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/
> modules/blivet.py\", line 1510, in run_module\n  File
> \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/
> modules/blivet.py\", line 1203, in manage_volume\n  File
> \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/
> modules/blivet.py\", line 536, in manage\n  File
> \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/
> modules/blivet.py\", line 348, in _look_up_device\n  File
> \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/
> modules/blivet.py\", line 658, in _get_device_id\nAttributeError: 'NoneType'
> object has no attribute '_device'\n", "module_stdout": "", "msg": "MODULE
> FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
> 
> TASK [rhel-system-roles.storage : failed message]
> *****************************************************************************
> *********
> task path:
> /usr/share/ansible/roles/rhel-system-roles.storage/tasks/main-blivet.yml:71
> fatal: [localhost]: FAILED! => {"changed": false, "msg": {"changed": false,
> "exception": "Traceback (most recent call last):\n  File
> \"/root/.ansible/tmp/ansible-tmp-1628571143.4451976-262603-185620659085404/
> AnsiballZ_blivet.py\", line 102, in <module>\n    _ansiballz_main()\n  File
> \"/root/.ansible/tmp/ansible-tmp-1628571143.4451976-262603-185620659085404/
> AnsiballZ_blivet.py\", line 94, in _ansiballz_main\n   
> invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File
> \"/root/.ansible/tmp/ansible-tmp-1628571143.4451976-262603-185620659085404/
> AnsiballZ_blivet.py\", line 40, in invoke_module\n   
> runpy.run_module(mod_name='ansible.modules.blivet', init_globals=None,
> run_name='__main__', alter_sys=True)\n  File
> \"/usr/lib64/python3.6/runpy.py\", line 205, in run_module\n    return
> _run_module_code(code, init_globals, run_name, mod_spec)\n  File
> \"/usr/lib64/python3.6/runpy.py\", line 96, in _run_module_code\n   
> mod_name, mod_spec, pkg_name, script_name)\n  File
> \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code\n    exec(code,
> run_globals)\n  File
> \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/
> modules/blivet.py\", line 1552, in <module>\n  File
> \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/
> modules/blivet.py\", line 1548, in main\n  File
> \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/
> modules/blivet.py\", line 1510, in run_module\n  File
> \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/
> modules/blivet.py\", line 1203, in manage_volume\n  File
> \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/
> modules/blivet.py\", line 536, in manage\n  File
> \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/
> modules/blivet.py\", line 348, in _look_up_device\n  File
> \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/
> modules/blivet.py\", line 658, in _get_device_id\nAttributeError: 'NoneType'
> object has no attribute '_device'\n", "failed": true, "module_stderr":
> "Traceback (most recent call last):\n  File
> \"/root/.ansible/tmp/ansible-tmp-1628571143.4451976-262603-185620659085404/
> AnsiballZ_blivet.py\", line 102, in <module>\n    _ansiballz_main()\n  File
> \"/root/.ansible/tmp/ansible-tmp-1628571143.4451976-262603-185620659085404/
> AnsiballZ_blivet.py\", line 94, in _ansiballz_main\n   
> invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File
> \"/root/.ansible/tmp/ansible-tmp-1628571143.4451976-262603-185620659085404/
> AnsiballZ_blivet.py\", line 40, in invoke_module\n   
> runpy.run_module(mod_name='ansible.modules.blivet', init_globals=None,
> run_name='__main__', alter_sys=True)\n  File
> \"/usr/lib64/python3.6/runpy.py\", line 205, in run_module\n    return
> _run_module_code(code, init_globals, run_name, mod_spec)\n  File
> \"/usr/lib64/python3.6/runpy.py\", line 96, in _run_module_code\n   
> mod_name, mod_spec, pkg_name, script_name)\n  File
> \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code\n    exec(code,
> run_globals)\n  File
> \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/
> modules/blivet.py\", line 1552, in <module>\n  File
> \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/
> modules/blivet.py\", line 1548, in main\n  File
> \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/
> modules/blivet.py\", line 1510, in run_module\n  File
> \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/
> modules/blivet.py\", line 1203, in manage_volume\n  File
> \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/
> modules/blivet.py\", line 536, in manage\n  File
> \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/
> modules/blivet.py\", line 348, in _look_up_device\n  File
> \"/tmp/ansible_blivet_payload_qd02o675/ansible_blivet_payload.zip/ansible/
> modules/blivet.py\", line 658, in _get_device_id\nAttributeError: 'NoneType'
> object has no attribute '_device'\n", "module_stdout": "", "msg": "MODULE
> FAILURE\nSee stdout/stderr for the exact error", "rc": 1}}

Comment 10 guazhang@redhat.com 2021-08-19 14:27:16 UTC
Hi,

the package rhel-system-roles-1.7.1-1.el8 fixed the issue.

Comment 14 guazhang@redhat.com 2021-08-20 03:06:03 UTC
Move to verified since #10

Comment 16 errata-xmlrpc 2021-11-09 17:46:07 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (rhel-system-roles bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:4159