Bug 704697

Summary: Error getting subscription: %s / Serial number must be > 0
Product: Red Hat Enterprise Linux 6 Reporter: John Sefler <jsefler>
Component: subscription-managerAssignee: Bryan Kearney <bkearney>
Status: CLOSED ERRATA QA Contact: John Sefler <jsefler>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.2CC: cduryee, jmolet, spandey
Target Milestone: rc   
Target Release: 6.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 17:14:16 UTC Type: ---
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: 682238    
Attachments:
Description Flags
circled error %s message and traceback none

Description John Sefler 2011-05-14 04:38:17 UTC
Description of problem:
There are two problems here, but i think one of them is already fixed by a newer version of m2crypto.  Anyway...
On an i386 provisioned box from beaker, I am getting an error when subscribing to a subscription.

Problem 1: Using the subscription-manager-gui, an error occurs when subscribing.  From the attached screenshot, the error message is not getting populated in the error dialog:
Error getting subscription: %s

The corresponding traceback is:
Traceback (most recent call last):
  File "/usr/lib/python2.4/logging/handlers.py", line 71, in emit
    if self.shouldRollover(record):
  File "/usr/lib/python2.4/logging/handlers.py", line 149, in shouldRollover
    msg = "%s\n" % self.format(record)
  File "/usr/lib/python2.4/logging/__init__.py", line 617, in format
    return fmt.format(record)
  File "/usr/lib/python2.4/logging/__init__.py", line 405, in format
    record.message = record.getMessage()
  File "/usr/lib/python2.4/logging/__init__.py", line 272, in getMessage
    msg = str(self.msg)
TypeError: __str__ returned non-string (type NoneType)


Problem 2: Using the command line tool, you will also see an error when subscribing...

[root@dell-pe2550-01 ~]# subscription-manager list --avail
+-------------------------------------------+
    Available Subscriptions
+-------------------------------------------+


ProductName:       	Red Hat Employee Subscription
ProductId:         	SYS0395                  
PoolId:            	8a85f9812ede00af012edf01c89f5cf9
Quantity:          	9993                     
Expires:           	10/07/2011               

[root@dell-pe2550-01 ~]# subscription-manager subscribe --pool=8a85f9812ede00af012edf01c89f5cf9
Entitlement Certificate(s) update failed due to the following reasons:
	- Serial number must be > 0
	- Serial number must be > 0


Version-Release number of selected component (if applicable):
Verifying Version on i686...
[root@dell-pe2550-01 ~]# rpm -qa | grep subscription-manager
subscription-manager-0.95.5.15-1.el5
subscription-manager-gnome-0.95.5.15-1.el5
subscription-manager-firstboot-0.95.5.15-1.el5

[root@dell-pe2550-01 ~]# subscription-manager facts --list | grep uname
uname.machine: i686
uname.nodename: dell-pe2550-01.rhts.eng.bos.redhat.com
uname.release: 2.6.18-259.el5
uname.sysname: Linux
uname.version: #1 SMP Fri Apr 29 01:10:46 EDT 2011

[root@dell-pe2550-01 ~]# rpm -q m2crypto
m2crypto-0.16-7.el5


I suspect a newer version of m2crypto will fix the subscribe errors.  However, it may avoid the problem of the error string not getting populated in the error message dialog:  
  Error getting subscription: %s

PS. I don't think the i386 arch is a factor in this bugzilla.

Comment 1 John Sefler 2011-05-14 04:48:34 UTC
Created attachment 498900 [details]
circled error %s message and traceback

Comment 2 John Sefler 2011-05-14 04:55:00 UTC
yes - installing newer m2crypto fixed the command line subscribe...

[root@dell-pe2550-01 ~]# rpm -q m2crypto
m2crypto-0.16-8.el5
[root@dell-pe2550-01 ~]# subscription-manager unsubscribe --all[root@dell-pe2550-01 ~]# subscription-manager subscribe --pool=8a85f9812ede00af012edf01c89f5cf9
[root@dell-pe2550-01 ~]# 


In fact,the error messages string "Error getting subscription: %s" is indeed avoided in the subscription-manager-gui with the newer version of m2crypto.

Therefore we could use a fix for problem 1 and to test it, we need to install  m2crypto-0.16-7.el5 and NOT a newer version of it.

Comment 4 Chris Duryee 2011-08-15 18:32:23 UTC
John,

I tested this with subscription-manager 700098a master and python-rhsm d42033a master. I then altered python-rhsm to make the "Serial number must be > 0" error happen every time.

However, I was unable to reproduce the issue described in the bug (the %s message in sm-gui). Marking as MODIFIED since I'm assuming this was fixed via some other bugfix. Let me know if you need any help reproducing the issue.

Comment 5 J.C. Molet 2011-08-16 17:33:36 UTC
I cannot reproduce this bug on any system.  I am marking it verified as it seems to be a non issue as of:

subscription-manager-0.96.5-1.git.51.ac50478.el6.x86_64
subscription-manager-firstboot-0.96.5-1.git.51.ac50478.el6.x86_64
python-rhsm-0.96.8-1.git.5.d42033a.el6.noarch
subscription-manager-gnome-0.96.5-1.git.51.ac50478.el6.x86_64

Comment 6 errata-xmlrpc 2011-12-06 17:14:16 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-2011-1695.html