Bug 2213691

Summary: [RHEL8] Unexpected behavior when creating ext4 filesystem with invalid parameter
Product: Red Hat Enterprise Linux 9 Reporter: guazhang <guazhang>
Component: rhel-system-rolesAssignee: Rich Megginson <rmeggins>
Status: CLOSED ERRATA QA Contact: guazhang <guazhang>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.3CC: japokorn, rmeggins, spetrosi
Target Milestone: rcKeywords: Triaged
Target Release: 9.3Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: role:storage
Fixed In Version: rhel-system-roles-1.22.0-0.14.el9 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
: 2218899 (view as bug list) Environment:
Last Closed: 2023-11-07 08:29:47 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: 2218899    

Description guazhang@redhat.com 2023-06-09 03:21:58 UTC
This bug was initially created as a copy of Bug #2213673

I am copying this bug because: 



Description of problem:
storage roles regression found the error, please have a look 

Version-Release number of selected component (if applicable):
ansible-core-2.15.0-1.el8.x86_64
rhel-system-roles-1.22.0-0.9.el8.noarch 
RHEL-8.9.0-20230603.20 BaseOS x86_64

How reproducible:


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

Actual results:


Expected results:


Additional info:


TASK [rhel-system-roles.storage : Make sure required packages are installed] ***
task path: /usr/share/ansible/roles/rhel-system-roles.storage/tasks/main-blivet.yml:39
skipping: [localhost] => {"changed": false, "false_condition": "storage_skip_checks is not defined or not \"packages_installed\" in storage_skip_checks", "skip_reason": "Conditional result was False"}

TASK [rhel-system-roles.storage : Get service facts] ***************************
task path: /usr/share/ansible/roles/rhel-system-roles.storage/tasks/main-blivet.yml:46
skipping: [localhost] => {"changed": false, "false_condition": "storage_skip_checks is not defined or not \"service_facts\" in storage_skip_checks", "skip_reason": "Conditional result was False"}

TASK [rhel-system-roles.storage : Set storage_cryptsetup_services] *************
task path: /usr/share/ansible/roles/rhel-system-roles.storage/tasks/main-blivet.yml:53
ok: [localhost] => {"ansible_facts": {"storage_cryptsetup_services": []}, "changed": false}

TASK [rhel-system-roles.storage : Mask the systemd cryptsetup services] ********
task path: /usr/share/ansible/roles/rhel-system-roles.storage/tasks/main-blivet.yml:67
skipping: [localhost] => {"changed": false, "skipped_reason": "No items in the list"}

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:73
fatal: [localhost]: FAILED! => {"actions": [], "changed": false, "crypts": [], "leaves": [], "mounts": [], "msg": "cannot remove existing formatting (lvmpv) and/or devices on disk 'sdb' (pool 'foo') in safe mode", "packages": [], "pools": [], "volumes": []}

TASK [rhel-system-roles.storage : Failed message] ******************************
task path: /usr/share/ansible/roles/rhel-system-roles.storage/tasks/main-blivet.yml:95
fatal: [localhost]: FAILED! => {"changed": false, "msg": {"actions": [], "changed": false, "crypts": [], "failed": true, "invocation": {"module_args": {"disklabel_type": null, "diskvolume_mkfs_option_map": {}, "packages_only": false, "pool_defaults": {"disks": [], "encryption": false, "encryption_cipher": null, "encryption_key": null, "encryption_key_size": null, "encryption_luks_version": null, "encryption_password": null, "raid_chunk_size": null, "raid_device_count": null, "raid_level": null, "raid_metadata_version": null, "raid_spare_count": null, "state": "present", "type": "lvm", "volumes": []}, "pools": [{"disks": ["sdb"], "encryption": false, "encryption_cipher": null, "encryption_key": null, "encryption_key_size": null, "encryption_luks_version": null, "encryption_password": null, "name": "foo", "raid_chunk_size": null, "raid_device_count": null, "raid_level": null, "raid_metadata_version": null, "raid_spare_count": null, "state": "present", "type": "lvm", "volumes": [{"cache_devices": [], "cache_mode": null, "cache_size": null, "cached": null, "compression": null, "deduplication": null, "encryption": null, "encryption_cipher": null, "encryption_key": null, "encryption_key_size": null, "encryption_luks_version": null, "encryption_password": null, "fs_create_options": "-Fb 512", "fs_label": "", "fs_type": "ext4", "mount_group": null, "mount_mode": null, "mount_options": null, "mount_point": "/opt/test1", "mount_user": null, "name": "test1", "raid_disks": [], "raid_level": null, "raid_stripe_size": null, "size": "4g", "state": "present", "thin": false, "thin_pool_name": null, "thin_pool_size": null, "type": null, "vdo_pool_size": null}]}], "safe_mode": true, "use_partitions": null, "volume_defaults": {"cache_devices": [], "cache_mode": null, "cache_size": 0, "cached": false, "compression": null, "deduplication": null, "disks": [], "encryption": false, "encryption_cipher": null, "encryption_key": null, "encryption_key_size": null, "encryption_luks_version": null, "encryption_password": null, "fs_create_options": "", "fs_label": "", "fs_overwrite_existing": true, "fs_type": "xfs", "mount_check": 0, "mount_device_identifier": "uuid", "mount_options": "defaults", "mount_passno": 0, "mount_point": "", "raid_chunk_size": null, "raid_device_count": null, "raid_level": null, "raid_metadata_version": null, "raid_spare_count": null, "raid_stripe_size": null, "size": 0, "state": "present", "thin": null, "thin_pool_name": null, "thin_pool_size": null, "type": "lvm", "vdo_pool_size": null}, "volumes": []}}, "leaves": [], "mounts": [], "msg": "cannot remove existing formatting (lvmpv) and/or devices on disk 'sdb' (pool 'foo') in safe mode", "packages": [], "pools": [], "volumes": []}}

TASK [rhel-system-roles.storage : Unmask the systemd cryptsetup services] ******
task path: /usr/share/ansible/roles/rhel-system-roles.storage/tasks/main-blivet.yml:99
skipping: [localhost] => {"changed": false, "skipped_reason": "No items in the list"}

TASK [Check that we failed in the role] ****************************************
task path: /usr/share/ansible/roles/rhel-system-roles.storage/tests/verify-role-failed.yml:20
ok: [localhost] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [Verify the blivet output and error message are correct] ******************
task path: /usr/share/ansible/roles/rhel-system-roles.storage/tests/verify-role-failed.yml:25
fatal: [localhost]: FAILED! => {
    "assertion": "blivet_output.msg is search(__storage_failed_regex)",
    "changed": false,
    "evaluated_to": false,
    "msg": "Unexpected behavior when creating ext4 filesystem with invalid parameter"
}

PLAY RECAP *********************************************************************
localhost                  : ok=178  changed=4    unreachable=0    failed=1    skipped=150  rescued=2    ignored=0   
STDERR:
RETURN:2

https://beaker.engineering.redhat.com/recipes/14051127#task161440046



RHEL9 failed job
https://beaker.engineering.redhat.com/recipes/14051634#task161443711

Comment 11 errata-xmlrpc 2023-11-07 08:29:47 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/RHEA-2023:6390