Red Hat Satellite engineering is moving the tracking of its product development work on Satellite 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 "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. 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 "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-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 1777440 - 'Hypervisors' task fails with 'undefined method `[]' for nil:NilClass' error
Summary: 'Hypervisors' task fails with 'undefined method `[]' for nil:NilClass' error
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Candlepin
Version: 6.5.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: 6.7.0
Assignee: Barnaby Court
QA Contact: jcallaha
URL:
Whiteboard:
Depends On:
Blocks: 1812904
TreeView+ depends on / blocked
 
Reported: 2019-11-27 15:30 UTC by Jan Senkyrik
Modified: 2023-03-24 16:13 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1812904 (view as bug list)
Environment:
Last Closed: 2020-01-06 21:10:01 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github candlepin candlepin pull 2506 0 None closed 1774640: Provide configuration option to disable UUID uniqueness cons… 2020-09-29 15:39:54 UTC
Github candlepin candlepin pull 2507 0 None closed 1774640: Allow config entry to stop uuid match on consumers 2020-09-29 15:39:48 UTC
Red Hat Knowledge Base (Solution) 4878761 0 None None None 2020-03-05 12:55:20 UTC

Description Jan Senkyrik 2019-11-27 15:30:38 UTC
Description of problem:
'Hypervisors' task fails with 'undefined method `[]' for nil:NilClass' error when 'virt-who-0.24.7-1.el7.noarch' is being used. This is not reproducible with virt-who-0.22.5-1.el7.noarch.

### TEST with 'virt-who-0.24.7-1.el7.noarch' ###

# rpm -qa | grep -e virt-who -e satellite-6
~~~
virt-who-0.24.7-1.el7.noarch
satellite-6.5.2.1-1.el7sat.noarch
~~~

- Config file:

# cat /etc/virt-who.d/02499113.conf
~~~
[02499113]
type=fake
file=/etc/virt-who.d/json/02499113.json
is_hypervisor=True
owner=Default_Organization
env=Library
hypervisor_id=hostname
rhsm_hostname=jsenkyri-sat64.sysmgmt.lan
rhsm_username=admin
rhsm_password=XXX
rhsm_prefix=/rhsm
~~~

- Mappings being used: attached '02499113.json' file

- First virt-who run ends in success:
~~~
Id: 05359f6c-5a89-4d97-9670-f7d9461cce16
Label: Actions::Katello::Host::Hypervisors
Status: stopped
Result: success
Started at: 2019-11-27 13:17:36 UTC
Ended at: 2019-11-27 13:21:57 UTC 
~~

- Second (and any future) virt-who run with the same config and same mappings ends with error:
~~~
Id: 46616c49-4709-4232-948c-e8939cd8437e
Label: Actions::Katello::Host::Hypervisors
Status: stopped
Result: warning
Started at: 2019-11-27 13:31:31 UTC
Ended at: 2019-11-27 13:31:37 UTC
~~~

~~~
NoMethodError
undefined method `[]' for nil:NilClass
~~~

____________________________


### TEST with 'virt-who-0.22.5-1.el7.noarch' ###

# rpm -qa | grep -e virt-who -e satellite-6
~~~
virt-who-0.22.5-1.el7.noarch
satellite-6.5.2.1-1.el7sat.noarch
~~~

- Config file:

# cat /etc/virt-who.d/02499113.conf
~~~
[02499113]
type=fake
file=/etc/virt-who.d/json/02499113-older-virt-who.json
is_hypervisor=True
owner=Default_Organization
env=Library
hypervisor_id=hostname
rhsm_hostname=jsenkyri-sat64.sysmgmt.lan
rhsm_username=admin
rhsm_password=XXX
rhsm_prefix=/rhsm
~~~

- Mappings being used: attached '02499113-older-virt-who.json' file

- First any any other future virt-who run ends with success:
~~~
Id: 78e7e97a-eada-410b-ad80-4f91cc700d43
Label: Actions::Katello::Host::Hypervisors
Status: stopped
Result: success
Started at: 2019-11-27 14:50:01 UTC
Ended at: 2019-11-27 14:52:09 UTC
~~~

____________________________

Additional info:
- This is happening because 'virt-who-0.24.7-1' reports duplicate 'dmi.system.uuid' for some of the hypervisors:

# grep '20202020-2020-2020-2020-202020202020' 0.24.7-1.json
~~~ 
                "dmi.system.uuid": "20202020-2020-2020-2020-202020202020", 
                "dmi.system.uuid": "20202020-2020-2020-2020-202020202020", 
                "dmi.system.uuid": "20202020-2020-2020-2020-202020202020", 
                "dmi.system.uuid": "20202020-2020-2020-2020-202020202020", 
                "dmi.system.uuid": "20202020-2020-2020-2020-202020202020", 
                "dmi.system.uuid": "20202020-2020-2020-2020-202020202020", 
~~~


- 'virt-who-0.22.5-1' doesn't do that:

# grep '20202020-2020-2020-2020-202020202020' 0.22.5-1.json
~~~
<no results>
~~~

- 'virt-who-0.24.7-1' reports "dmi.system.uuid" for every hypervisor:

# grep dmi.system.uuid 0.24.7-1.json | wc -l
~~~
831
~~~

- 'virt-who-0.22.5-1' reports "dmi.system.uuid" for only a part of them:

# grep dmi.system.uuid 0.22.5-1.json | wc -l
~~~
64
~~~

____________________________


It's clear that the root cause of this issue are the duplicate hypervisor uuids which is something that needs to be fixed on the system level (in this case those are ESX hosts). That being said can we somehow instruct virt-who to not pass 'dmi.system.uuid' to Satellite? Or is the only current workaround to just stay on the older virt-who version until the duplicate uuids are gone?

Thanks & Kind regards,
Jan


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