Bug 2143246

Summary: [RHEL9] ansible.parsing.yaml.objects.AnsibleUnicode object' has no attribute 'bytes'
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: high    
Version: 9.2CC: japokorn, rmeggins, spetrosi
Target Milestone: rcKeywords: Triaged
Target Release: 9.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: role:storage
Fixed In Version: rhel-system-roles-1.21.0-0.13.el9 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
: 2151342 (view as bug list) Environment:
Last Closed: 2023-05-09 07:38:23 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: 2151342    

Description guazhang@redhat.com 2022-11-16 12:54:24 UTC
Description of problem:
upstream rhel-system role regression testing found the error, please have a look

Version-Release number of selected component (if applicable):
ansible-core-2.14.0-1.el9.x86_64



How reproducible:


Steps to Reproduce:
1. git clone https://github.com/linux-system-roles/storage.git 

2. ansible-playbook -vv -i host tests_create_thinp_then_remove_scsi_generated.yml


Actual results:
get a error

Expected results:
no error

Additional info:



TASK [Calculate maximum usable space in thin pool] ************************************************************************************
task path: /mnt/tests/gitlab.cee.redhat.com/kernel-qe/kernel/-/archive/master/kernel-master.tar.gz/storage/storage_role/auto_run_role_local/storage/tests/test-verify-volume-size.yml:61
ok: [localhost] => {"bytes": 1152245236236, "changed": false, "lvm": "1t", "parted": "1TiB", "size": "1 TiB"}

TASK [Apply upper size limit to max usable thin pool space] ***************************************************************************
task path: /mnt/tests/gitlab.cee.redhat.com/kernel-qe/kernel/-/archive/master/kernel-master.tar.gz/storage/storage_role/auto_run_role_local/storage/tests/test-verify-volume-size.yml:66
ok: [localhost] => {"ansible_facts": {"_storage_test_max_thin_pool_size": "_storage_test_default_thpool_reserve_max"}, "changed": false}

TASK [Apply lower size limit to max usable thin pool space] ***************************************************************************
task path: /mnt/tests/gitlab.cee.redhat.com/kernel-qe/kernel/-/archive/master/kernel-master.tar.gz/storage/storage_role/auto_run_role_local/storage/tests/test-verify-volume-size.yml:71
fatal: [localhost]: FAILED! => {"msg": "The conditional check 'storage_test_pool_size.bytes - _storage_test_max_thin_pool_size.bytes < _storage_test_default_thpool_reserve_min.bytes' failed. The error was: error while evaluating conditional (storage_test_pool_size.bytes - _storage_test_max_thin_pool_size.bytes < _storage_test_default_thpool_reserve_min.bytes): 'ansible.parsing.yaml.objects.AnsibleUnicode object' has no attribute 'bytes'\n\nThe error appears to be in '/mnt/tests/gitlab.cee.redhat.com/kernel-qe/kernel/-/archive/master/kernel-master.tar.gz/storage/storage_role/auto_run_role_local/storage/tests/test-verify-volume-size.yml': line 71, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n    - name: Apply lower size limit to max usable thin pool space\n      ^ here\n"}

PLAY RECAP ****************************************************************************************************************************
localhost                  : ok=138  changed=2    unreachable=0    failed=1    skipped=77   rescued=0    ignored=0   


https://beaker.engineering.redhat.com/recipes/12954143#task152792546

Comment 1 Rich Megginson 2022-11-16 15:02:47 UTC
I have not been able to reproduce.  This is what I have tried:

* upstream with tox -e qemu-ansible-core-2.14
* downstream with basic-smoke-test
* downstream with Upstream-testsuite - with a rhel 8.7 and a rhel 9.2 image

> 2. ansible-playbook -vv -i host tests_create_thinp_then_remove_scsi_generated.yml

What is `host`?  Is it the localhost?  If so, how are you creating the scsi device to test against?  Because the rhel-system-roles test Sanity/basic-smoke-test doesn't work for scsi devices.

If `host` is not localhost, what is it?  What version of rhel?  Is it a local VM, a beaker machine, some lab machine?

Comment 2 Rich Megginson 2022-11-16 15:26:04 UTC
I was able to reproduce.  You have to have drives with a size of 1TB or higher.

Comment 4 guazhang@redhat.com 2022-11-19 11:44:13 UTC
Hi,

[root@storageqe-104 tests]# cat host 
localhost  ansible_connection=local
[root@storageqe-104 tests]# 


[root@storageqe-104 tests]# lsscsi -g
[0:0:0:0]    disk    ATA      HFS480G3H2X069N  DZ02  /dev/sda   /dev/sg0 
[1:0:0:0]    disk    ATA      SAMSUNG MZ7LH480 904Q  /dev/sdb   /dev/sg1 
[2:0:0:0]    disk    ATA      SAMSUNG MZ7LH480 904Q  /dev/sdc   /dev/sg2 
[3:0:0:0]    disk    ATA      SAMSUNG MZ7LH480 904Q  /dev/sdd   /dev/sg3 
[root@storageqe-104 tests]# lsblk
NAME                         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda                            8:0    1 447.1G  0 disk 
├─sda1                         8:1    1     1G  0 part /boot
└─sda2                         8:2    1 446.1G  0 part 
  ├─rhel_storageqe--104-root 253:0    0    70G  0 lvm  /
  ├─rhel_storageqe--104-swap 253:1    0   7.7G  0 lvm  [SWAP]
  └─rhel_storageqe--104-home 253:2    0 368.4G  0 lvm  /home
sdb                            8:16   1 447.1G  0 disk 
└─sdb1                         8:17   1 447.1G  0 part 
  └─vg1-tpool1_tdata         253:4    0    10G  0 lvm  
    └─vg1-tpool1-tpool       253:5    0    10G  0 lvm  
      ├─vg1-tpool1           253:6    0    10G  1 lvm  
      └─vg1-lv1              253:7    0     3G  0 lvm  
sdc                            8:32   1 447.1G  0 disk 
└─sdc1                         8:33   1 447.1G  0 part 
sdd                            8:48   1 447.1G  0 disk 
└─sdd1                         8:49   1 447.1G  0 part 
  └─vg1-tpool1_tmeta         253:3    0    12M  0 lvm  
    └─vg1-tpool1-tpool       253:5    0    10G  0 lvm  
      ├─vg1-tpool1           253:6    0    10G  1 lvm  
      └─vg1-lv1              253:7    0     3G  0 lvm  
[root@storageqe-104 tests]# 
[root@storageqe-104 tests]# uname -a
Linux storageqe-104.rhts.eng.pek2.redhat.com 5.14.0-191.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Nov 9 15:02:51 EST 2022 x86_64 x86_64 x86_64 GNU/Linux
[root@storageqe-104 tests]#

Comment 6 guazhang@redhat.com 2022-12-07 04:35:15 UTC
Hi,


test failed with the test package. 

TASK [debug] **************************************************************************************************************************
task path: /usr/share/ansible/roles/rhel-system-roles.storage/tests/test-verify-volume-size.yml:124
ok: [localhost] => {
    "storage_test_actual_size": {
        "bytes": 1869169767219,
        "changed": false,
        "failed": false,
        "lvm": "1t",
        "parted": "1TiB",
        "size": "1 TiB"
    }
}

TASK [debug] **************************************************************************************************************************
task path: /usr/share/ansible/roles/rhel-system-roles.storage/tests/test-verify-volume-size.yml:127
ok: [localhost] => {
    "storage_test_expected_size": "1900391755530.0"
}

TASK [assert] *************************************************************************************************************************
task path: /usr/share/ansible/roles/rhel-system-roles.storage/tests/test-verify-volume-size.yml:130
fatal: [localhost]: FAILED! => {
    "assertion": "(storage_test_expected_size|int - storage_test_actual_size.bytes)|abs / storage_test_expected_size|int < 0.01",
    "changed": false,
    "evaluated_to": false,
    "msg": "Volume lv1 has unexpected size (expected: 1900391755530 / actual: 1869169767219)"
}

PLAY RECAP ****************************************************************************************************************************
localhost                  : ok=771  changed=10   unreachable=0    failed=1    skipped=540  rescued=0    ignored=0   

[root@storageqe-69 tests]# 

[root@storageqe-69 tests]# uname -a
Linux storageqe-69.rhts.eng.pek2.redhat.com 5.14.0-205.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Dec 2 08:55:37 EST 2022 x86_64 x86_64 x86_64 GNU/Linux
[root@storageqe-69 tests]# rpm -qa |grep role
rhel-system-roles-1.21.0-0.10.storage.el9.noarch
[root@storageqe-69 tests]#

Comment 7 Rich Megginson 2022-12-07 15:23:52 UTC
@japokorn please take a look

Comment 16 guazhang@redhat.com 2022-12-20 04:08:45 UTC
test pass with fixed package, move to verified.

Comment 19 errata-xmlrpc 2023-05-09 07:38:23 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:2246