Bug 1311884 - Error in communication with subscription manager as retry_after is "NoneType"
Error in communication with subscription manager as retry_after is "NoneType"
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: virt-who (Show other bugs)
6.8
x86_64 Linux
unspecified Severity medium
: rc
: ---
Assigned To: Radek Novacek
Eko
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-25 04:39 EST by Liushihui
Modified: 2016-11-30 19:35 EST (History)
7 users (show)

See Also:
Fixed In Version: virt-who-0.16-5.el6.noarch
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-05-10 19:57:38 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
virt-who log (57.08 KB, text/plain)
2016-02-25 04:41 EST, Liushihui
no flags Details

  None (edit)
Description Liushihui 2016-02-25 04:39:09 EST
Description of problem:
When virt-who communicate with stage candlepin, if virt-who received 429, it will show "Error in communication with subscription manager" is cause by "TypeError: int() argument must be a string or a number, not 'NoneType'"

Version-Release number of selected component (if applicable):
virt-who-0.16-4.el6.noarch
subscription-manager-1.16.8-2.el6.x86_64
python-rhsm-1.16.6-1.el6.x86_64

How reproducible:
Always

Steps to Reproduce:
1.Register system to stage candlepin
2.Configure virt-who monitor esx and hyperv as the following:
[root@sgi-xe500-01 ~]# cat /etc/virt-who.d/virt
[test-esx1]
type=esx
server=10.73.2.95
username=Administrator@vsphere.local
password=Welcome1!
owner=ACME_Corporation
env=Library
hypervisor_id=hostname
[root@sgi-xe500-01 ~]# cat /etc/sysconfig/virt-who  | grep -v ^# | grep -v ^$
VIRTWHO_DEBUG=1
VIRTWHO_INTERVAL=2
VIRTWHO_HYPERV=1
VIRTWHO_HYPERV_OWNER=ACME_Corporation
VIRTWHO_HYPERV_ENV=Library
VIRTWHO_HYPERV_SERVER=10.73.5.212
VIRTWHO_HYPERV_USERNAME=administrator
VIRTWHO_HYPERV_PASSWORD=Welcome1
3. Restart virt-who service and monitor virt-who's log
[root@sgi-xe500-01 ~]# service virt-who restart
[root@sgi-xe500-01 ~]# tail -f /var/log/rhsm/rhsm.log

Actual results:
When virt-who received 429 code, it will show error info as the following:
2016-02-25 03:08:33,202 [virtwho.main ERROR] MainProcess(1469):MainThread @virtwho.py:send:214 - Error in communication with subscription manager:
Traceback (most recent call last):
  File "/usr/share/virt-who/virtwho.py", line 197, in send
    self._sendGuestAssociation(report)
  File "/usr/share/virt-who/virtwho.py", line 224, in _sendGuestAssociation
    manager.hypervisorCheckIn(report, self.options)
  File "/usr/share/virt-who/manager/subscriptionmanager/subscriptionmanager.py", line 198, in hypervisorCheckIn
    retry_after = int(getattr(e, 'headers', {}).get('Retry-After'))
TypeError: int() argument must be a string or a number, not 'NoneType'
2016-02-25 03:08:33,202 [virtwho.main DEBUG] MainProcess(1469):MainThread @virtwho.py:send_current_report:166 - Report from "env/cmdline" failed to sent

Expected results:
It shouldn't show TypeError exception in virt-who log, Retry-After should get correct type.

Additional info:
Please see the detail error info in attachment virt-who.log
Comment 1 Liushihui 2016-02-25 04:41 EST
Created attachment 1130456 [details]
virt-who log
Comment 2 Radek Novacek 2016-02-25 04:45:25 EST
This should be fixed in virt-who-0.16-5.el6.noarch.
Comment 4 Liushihui 2016-03-23 04:48:56 EDT
Verified it on virt-who-0.16-7.el6 since it will show normal log when virt-who received 429 from candlepin. Therefore, verify it.

Verified version:
virt-who-0.16-7.el6
subscription-manager-1.16.8-7.el6.x86_64
python-rhsm-1.16.6-1.el6.x86_64

Verified process:
1.Register system to stage candlepin
2.Configure virt-who monitor esx and hyperv as the following:
[root@sgi-xe500-01 ~]# cat /etc/virt-who.d/virt
[test-esx1]
type=esx
server=10.73.2.95
username=Administrator@vsphere.local
password=Welcome1!
owner=ACME_Corporation
env=Library
hypervisor_id=hostname
[root@sgi-xe500-01 ~]# cat /etc/sysconfig/virt-who  | grep -v ^# | grep -v ^$
VIRTWHO_DEBUG=1
VIRTWHO_INTERVAL=2
VIRTWHO_HYPERV=1
VIRTWHO_HYPERV_OWNER=ACME_Corporation
VIRTWHO_HYPERV_ENV=Library
VIRTWHO_HYPERV_SERVER=10.73.5.212
VIRTWHO_HYPERV_USERNAME=administrator
VIRTWHO_HYPERV_PASSWORD=Welcome1
3. Restart virt-who service and monitor virt-who's log
[root@sgi-xe500-01 ~]# service virt-who restart
[root@sgi-xe500-01 ~]# tail -f /var/log/rhsm/rhsm.log

2016-03-23 04:45:32,966 [virtwho.main DEBUG] MainProcess(22631):MainThread @virtwho.py:send_report:175 - 429 received, waiting 60 seconds until sending again

Result:
It will show normal log when received 429.
Comment 6 errata-xmlrpc 2016-05-10 19:57:38 EDT
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.

https://rhn.redhat.com/errata/RHEA-2016-0859.html

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