Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1394399

Summary: Check for empty uuid string in get_fully_virt_info()
Product: Red Hat Enterprise Linux 6 Reporter: Neal Kim <nkim>
Component: rhn-client-toolsAssignee: Tomáš Kašpárek <tkasparek>
Status: CLOSED WONTFIX QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.8CC: cww, pstudeni, tlestach
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-06-13 17:52:53 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:

Description Neal Kim 2016-11-11 20:59:28 UTC
Description of problem:

When attempting to register a Xen guest against a Satellite 5 instance, the following error can be observed:

Exception Handler Information
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/spacewalk/server/apacheRequest.py", line 122, in call_function
    response = func(*params)
  File "/usr/share/rhn/server/handlers/xmlrpc/registration.py", line 513, in new_system
    architecture, data)
  File "/usr/share/rhn/server/handlers/xmlrpc/registration.py", line 345, in create_system
    and not rhnVirtualization.is_host_uuid(virt_uuid):
  File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnVirtualization.py", line 839, in is_host_uuid
    uuid = eval('0x%s' % uuid)
  File "<string>", line 1
     0x
      ^

 SyntaxError: invalid token
 
I imagine that it would be possible to encounter this error against upstream RHN as well.

Apparently, it seems that hardware.dmi_system_uuid() can end up returning an empty string thereby breaking the registration process.

/usr/share/rhn/up2date_client/rhnreg.py

def get_fully_virt_info():
    """
    This function looks in the SMBIOS area to determine if this is a 
    fully-virt guest.  It returns a (uuid, virt_type) tuple.
    """
    vendor = hardware.dmi_vendor()
    uuid = hardware.dmi_system_uuid()
    if vendor.lower() == "xen":
        uuid = uuid.lower().replace('-', '')
        virt_type = "fully"
        return (uuid, virt_type)
    else:
        return (None, None)

Notice the UUID value reported by dmidecode on a Xen guest system:
        
Handle 0x0100, DMI type 1, 27 bytes
System Information
        Manufacturer: Xen
        Product Name: HVM domU
        Version: 4.1<denied>
        Serial Number: 00000000-0000-0000-0000-000000000000
        UUID: Not Settable         <====== returns as empty string ''
        Wake-up Type: Power Switch
        SKU Number: Not Specified
        Family: Not Specified

This causes issues for paravirt guests since we may actually never make it to get_para_virt_info()

I'm filing this under RHEL 6 but likely applies to all RHEL releases.


Version-Release number of selected component (if applicable):

rhn-client-tools-1.0.0.1-38.el6


How reproducible:

Easily.


Steps to Reproduce:

1. Register a Xen guest w/ not settable UUID.
2. Let it rain.


Actual results:

SyntaxError: invalid token


Expected results:

No error, able to grab the UUID from /sys/hypervisor/uuid if paravirt


Additional info:

Not comprehensive but good enough...

diff --git a/rhnreg.py b/rhnreg.py
index 7a4735d..18b1e7c 100644
--- a/rhnreg.py
+++ b/rhnreg.py
@@ -222,7 +222,7 @@ def get_fully_virt_info():
     """
     vendor = hardware.dmi_vendor()
     uuid = hardware.dmi_system_uuid()
-    if vendor.lower() == "xen":
+    if vendor.lower() == "xen" and uuid:
         uuid = uuid.lower().replace('-', '')
         virt_type = "fully"
         return (uuid, virt_type)

Comment 4 Chris Williams 2017-06-13 17:52:53 UTC
Red Hat Enterprise Linux 6 transitioned to the Production 3 Phase on May 10, 2017.  During the Production 3 Phase, Critical impact Security Advisories (RHSAs) and selected Urgent Priority Bug Fix Advisories (RHBAs) may be released as they become available.
 
The official life cycle policy can be reviewed here:
 
http://redhat.com/rhel/lifecycle
 
This issue does not appear to meet the inclusion criteria for the Production Phase 3 and will be marked as CLOSED/WONTFIX. If this remains a critical requirement, please contact Red Hat Customer Support to request a re-evaluation of the issue, citing a clear business justification.  Red Hat Customer Support can be contacted via the Red Hat Customer Portal at the following URL:
 
https://access.redhat.com