Bug 921249

Summary: subscription manager facts do not update after registering
Product: Red Hat Enterprise Linux 5 Reporter: J.C. Molet <jmolet>
Component: subscription-managerAssignee: Devan Goodwin <dgoodwin>
Status: CLOSED ERRATA QA Contact: IDM QE LIST <seceng-idm-qe-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 5.10CC: alikins, bkearney, dgoodwin, fsharath, jgalipea, redakkan, spandey
Target Milestone: beta   
Target Release: 5.10   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
No description necessary
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-30 22:59:52 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: 840995, 920191    
Attachments:
Description Flags
System Facts displayed appropriately none

Description J.C. Molet 2013-03-13 18:57:10 UTC
Description of problem:
A couple of the subscription manager facts are unknown when you are not registered.  When you do register and then open the facts viewer, these values are still shown as unknown when they are known.

Version-Release number of selected component (if applicable):
subscription-manager-gui-1.8.4-1.git.24.36ea5ff.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. Have subscription-manager installed, and be in a completely unregistered state
2. start subscription-manager-gui
3. register to your candlepin server through the gui
4. (optional) wait for your product statuses to update: see Bug 921245 
5. Go to System > View System Facts
  
Actual results:

in the gui the only thing under virt is:

virt.is_guest: Unknown
virt.uuid: Unknown

In the CLI during the same time:
# subscription-manager facts --list | grep ^virt
virt.host_type: kvm
virt.is_guest: True
virt.uuid: 131e448d-c000-f6bb-e2a9-8bb549e21ab4


Expected results:
virt.is_guest and virt.uuid would show the same information.  Additionally the gui would also show the value of virt.host_type

Additional info:

Comment 1 RHEL Program Management 2013-04-09 20:57:08 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.

Comment 3 Adrian Likins 2013-04-29 21:40:05 UTC
anything in /var/log/rhsm.log?

curious if virt-what (or our parsing of it's output) is failing in this case

Comment 4 Devan Goodwin 2013-05-07 18:43:03 UTC
Problem masked by:

2013-05-07 15:16:32,225 [INFO]  @repolib.py:158 - repos updated: 0
2013-05-07 15:16:32,255 [ERROR]  @hwprobe.py:423 - signal only works in main thread
Traceback (most recent call last):
  File "/usr/share/rhsm/subscription_manager/hwprobe.py", line 410, in getVirtInfo
    host_type = self._get_output('virt-what')
  File "/usr/share/rhsm/subscription_manager/hwprobe.py", line 439, in _get_output
    signal.signal(signal.SIGPIPE, signal.SIG_DFL)
ValueError: signal only works in main thread
2013-05-07 15:16:32,317 [WARNING]  @hwprobe.py:482 - Error finding UUID: 'virt.host_type'

Suspect this is happening in registration and auto-attach dialog, which are both asynchronous which could cause the signal / thread error above.

Comment 5 spandey 2013-05-13 12:51:43 UTC
I am getting same kind of issue , 

virtual guest is consuming more than 1 instance based subscription with gui auto-attach with register .

i can see virtual machine info in system facts , still getting this issue 

i got above traceback in rhsm.log file . 

using following rpm 
subscription-manager-gui-1.8.7-1.git.33.1b83804.el5
subscription-manager-migration-1.8.7-1.git.33.1b83804.el5
subscription-manager-migration-data-1.11.2.7-1.git.0.1dfd00e.el5
subscription-manager-1.8.7-1.git.33.1b83804.el5
subscription-manager-firstboot-1.8.7-1.git.33.1b83804.el5

Comment 6 Devan Goodwin 2013-05-15 15:11:39 UTC
This bug was happening in the registergui code where we lookup suitable service levels, so it would surface if you registered via the GUI wizard, or if you used auto-attach after registration.

If you did this, and you looked on the server you would see unknown virt status:

(dgoodwin@lenovo ~) $ curl -k -u admin:admin "https://localhost:8443/candlepin/consumers/b41364aa-fbef-4cb5-aa61-c4ea36ec1ae7" | grep guest
0    "virt.is_guest" : "Unknown",

And something like this in the logs:

2013-05-14 15:32:44,530 [ERROR]  @hwprobe.py:423 - signal only works in main thread
Traceback (most recent call last):
  File "/usr/share/rhsm/subscription_manager/hwprobe.py", line 410, in getVirtInfo
    host_type = self._get_output('virt-what')
  File "/usr/share/rhsm/subscription_manager/hwprobe.py", line 439, in _get_output
    signal.signal(signal.SIGPIPE, signal.SIG_DFL)
ValueError: signal only works in main thread

The problem was indeed caused by an unnecessary reload of facts in the asynchronous autobind code. To fix I am having the relevant code re-use the facts we already looked up in the main thread before we went into the async code.

Comment 7 Devan Goodwin 2013-05-21 13:50:43 UTC
Fixed in subscription-manager.git master: 12b4ff606e1aeff6c5c82d0ed1d4792b4749eab5

Will appear in: subscription-manager-1.8.8-1

Comment 8 Sharath Dwaral 2013-06-05 18:56:54 UTC
Created attachment 757341 [details]
System Facts displayed appropriately

Version:

# rpm -qa | egrep "subscription-manager|python-rhsm"
subscription-manager-migration-data-1.11.3.1-1.git.1.78afd75.el5
subscription-manager-migration-1.8.10-1.git.1.b44c4b1.el5
python-rhsm-1.8.12-1.git.0.d747a65.el5
subscription-manager-firstboot-1.8.10-1.git.1.b44c4b1.el5
subscription-manager-1.8.10-1.git.1.b44c4b1.el5
subscription-manager-gui-1.8.10-1.git.1.b44c4b1.el5

CLI output:
# subscription-manager facts --list | grep virt
virt.host_type: kvm
virt.is_guest: True
virt.uuid: 3edf259b-25f7-1f57-9eb6-60d515bcfcd7

GUI Output:
Please see attachment

The system facts re updated appropriately.

VERIFIED

Comment 10 errata-xmlrpc 2013-09-30 22:59:52 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, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-1332.html