This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2213673 - [RHEL8] Unexpected behavior when creating ext4 filesystem with invalid parameter
Summary: [RHEL8] Unexpected behavior when creating ext4 filesystem with invalid parameter
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: lvm2
Version: 8.9
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: LVM Team
QA Contact: cluster-qe
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-06-09 00:51 UTC by guazhang@redhat.com
Modified: 2023-09-23 19:19 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-09-23 19:19:26 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker   RHEL-8345 0 None Migrated None 2023-09-23 19:19:15 UTC
Red Hat Issue Tracker RHELPLAN-159352 0 None None None 2023-06-09 01:02:40 UTC

Description guazhang@redhat.com 2023-06-09 00:51:53 UTC
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

Comment 1 Rich Megginson 2023-06-13 17:21:07 UTC
@guazhang 

> 1. ansible-playbook -vv -i host tests_misc.yml
> 2. ansible-playbook -vv -i host tests_misc_scsi_generated.yml

In this case, is `host` "localhost"?  I'm trying to reproduce this, but so far I have not been able to.  How exactly did you run this?

The problem appears to be clean up.  The test: https://github.com/linux-system-roles/storage/blob/main/tests/tests_misc.yml#L72 is expecting blivet to return an error message like

Failed to commit changes to disk: (FSError('format failed: 1',), '/dev/mapper/foo-test1')

but instead, the error message is

cannot remove existing formatting (lvmpv) and/or devices on disk 'sdb' (pool 'foo') in safe mode

The test wants to create a new lvm pool with sdb and a new volume with ext4 and an invalid parameter.  But for some reason the pool?  or volume? still exists.  @vtrefny ?  How do I tell what still exists that it is complaining about?

I have tried running the test multiple times in a row using qemu/kvm (I do not have a local machine with real SCSI devices) and it seems to clean up properly every time.  So at this point I'm not sure what's going on.

Comment 2 guazhang@redhat.com 2023-06-14 05:44:45 UTC
(In reply to Rich Megginson from comment #1)
> @guazhang 
> 
> > 1. ansible-playbook -vv -i host tests_misc.yml
> > 2. ansible-playbook -vv -i host tests_misc_scsi_generated.yml
> 
> In this case, is `host` "localhost"?  I'm trying to reproduce this, but so
> far I have not been able to.  How exactly did you run this?
> 


echo "localhost  ansible_connection=local" > host

no other setup, I test it with my test server storageqe-104.rhts.eng.pek2.redhat.com which include some SSD.

Comment 3 Vojtech Trefny 2023-06-21 07:28:10 UTC
I also wasn't able to reproduce this. @guazhang I can't find blivet.log in the beaker job, is it available somewhere? From the role output it looks like the cleanup worked as expected and everything, including the lvmpv format on sdb should be removed, but it's hard to tell what actually happened without the blivet.log.

        "actions": [
            {
                "action": "destroy format",
                "device": "/dev/mapper/foo-test1",
                "fs_type": "ext4"
            },
            {
                "action": "destroy device",
                "device": "/dev/mapper/foo-test1",
                "fs_type": null
            },
            {
                "action": "destroy device",
                "device": "/dev/foo",
                "fs_type": null
            },
            {
                "action": "destroy format",
                "device": "/dev/sdb",
                "fs_type": "lvmpv"
            }

Comment 5 Vojtech Trefny 2023-06-21 12:54:10 UTC
The udev database is in inconsistent state after the pvremove call we do. The /dev/sdb PV is removed but udev still thinks it is formatted to lvmpv:

---------------
# lsblk -f /dev/sdb
NAME FSTYPE      LABEL UUID                                   MOUNTPOINT
sdb  LVM2_member       KvVOZf-1tc2-c1E1-c8Vr-aSH3-LZJ3-W3liPZ

# udevadm info /dev/sdb
...
E: ID_FS_TYPE=LVM2_member
E: ID_FS_USAGE=raid
E: ID_FS_UUID=KvVOZf-1tc2-c1E1-c8Vr-aSH3-LZJ3-W3liPZ
---------------

but the disk is empty:
---------------
# pvremove /dev/sdb
  No PV found on device /dev/sdb.
# wipefs /dev/sdb
# 
---------------

Moving to lvm for further investigation.

Comment 7 RHEL Program Management 2023-09-23 19:14:21 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 8 RHEL Program Management 2023-09-23 19:19:26 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.


Note You need to log in before you can comment on or make changes to this bug.