Bug 669208 - register with an empty /var/lib/rhsm/facts/facts.json file throws traceback
Summary: register with an empty /var/lib/rhsm/facts/facts.json file throws traceback
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager
Version: 6.1
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: rc
: ---
Assignee: Adrian Likins
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks: Entitlement-Beta
TreeView+ depends on / blocked
 
Reported: 2011-01-12 21:24 UTC by John Sefler
Modified: 2011-05-19 13:38 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-05-19 13:38:50 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2011:0611 normal SHIPPED_LIVE new package: subscription-manager 2011-05-18 17:56:21 UTC

Description John Sefler 2011-01-12 21:24:37 UTC
Description of problem:
While attempting to verify bugzilla 667953 I ran into another traceback when the client is rhel6


Version-Release number of selected component (if applicable):
[root@jsefler-onprem01 ~]# rpm -q subscription-manager
subscription-manager-0.93.11-1.git.0.91f3f0d.el6.x86_64
[root@jsefler-onprem01 ~]# rpm -q python-rhsm
python-rhsm-0.94.13-1.git.0.e2a615d.el6.noarch
[root@jsefler-onprem01 ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 6.0 (Santiago)


Steps to Reproduce:
[root@jsefler-onprem01 ~]# echo "" > /var/lib/rhsm/facts/facts.json
[root@jsefler-onprem01 ~]# subscription-manager register --username testuser1 --password password --force
not all arguments converted during string formatting

^^^ Expected a successful registration
  

[root@jsefler-onprem01 ~]# tail -f /var/log/rhsm/rhsm.log

2011-01-12 16:22:40,513 [INFO] __init__() @connection.py:288 - Using certificate authentication: key = /etc/pki/consumer/key.pem, cert = /etc/pki/consumer/cert.pem, ca = /etc/rhsm/ca/, insecure = False
2011-01-12 16:22:40,513 [INFO] __init__() @connection.py:291 - Connection Established: host: jsefler-f12-candlepin.usersys.redhat.com, port: 8443, handler: /candlepin
2011-01-12 16:22:40,514 [INFO] __init__() @connection.py:277 - Using basic authentication as: testuser1
2011-01-12 16:22:40,514 [INFO] __init__() @connection.py:291 - Connection Established: host: jsefler-f12-candlepin.usersys.redhat.com, port: 8443, handler: /candlepin
2011-01-12 16:22:40,620 [ERROR] handle_exception() @managercli.py:44 - exception caught in subscription-manager
2011-01-12 16:22:40,622 [ERROR] handle_exception() @managercli.py:45 - not all arguments converted during string formatting
Traceback (most recent call last):
  File "/usr/sbin/subscription-manager", line 76, in <module>
    sys.exit(abs(main() or 0))
  File "/usr/sbin/subscription-manager", line 67, in main
    return managercli.CLI().main()
  File "/usr/share/rhsm/managercli.py", line 729, in main
    cmd.main()
  File "/usr/share/rhsm/managercli.py", line 155, in main
    self._do_command()
  File "/usr/share/rhsm/managercli.py", line 345, in _do_command
    handle_exception(_("Error during registration.") % e, e)
TypeError: not all arguments converted during string formatting

Comment 2 Adrian Likins 2011-01-13 16:59:58 UTC
commit 5e35d2cd76a8c64543fc029ddafc899264669b3e
Author: Adrian Likins <alikins@redhat.com>
Date:   Wed Jan 12 17:33:20 2011 -0500

    669208: Fix for exception handler on register
    
    Unused string formating args.

Comment 3 Adrian Likins 2011-01-13 17:01:02 UTC
commit 7452533d19f019ce6cf7a31ca409d934c9dda3af
Author: Adrian Likins <alikins@redhat.com>
Date:   Wed Jan 12 16:36:04 2011 -0500

    669208: JSONDecodeError doesn't exist on simplejson 2.0.9 (aka, RHEL6)
    
    Fix a name exception on JSONDecodeError that tries to catch
    json loading errors on facts load. The name exception was getting
    swallowed by a busted exception handler.



Both above commits are part of the fix.

Comment 4 spandey 2011-01-20 11:44:00 UTC
Tested with IT env and premises candlepin with empty facts.json file 

Verify using following subscription manager rpm 

subscription-manager-firstboot-0.93.13-1.el6.x86_64
subscription-manager-0.93.13-1.el6.x86_64
subscription-manager-gnome-0.93.13-1.el6.x86_64

Successfully registered to IT ENV 
No error message displayed on console
No error message recored in rhsm.log 


Successfully registered to premises 
No error message displayed on console
No error message recored in rhsm.log 


Working fine Moving defect status from ON_QA to Verified

Comment 5 errata-xmlrpc 2011-05-19 13:38:50 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2011-0611.html


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