Bug 747024

Summary: traceback when calling subscription-manager config
Product: Red Hat Enterprise Linux 6 Reporter: John Sefler <jsefler>
Component: subscription-managerAssignee: Adrian Likins <alikins>
Status: CLOSED ERRATA QA Contact: IDM QE LIST <seceng-idm-qe-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.2CC: bkearney, skallesh, spandey, wpoteat
Target Milestone: rcKeywords: Reopened
Target Release: ---   
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:26:02 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    

Description John Sefler 2011-10-18 15:26:54 UTC
Description of problem:
This may be a corner case, but it is also regression in behavior...
Something has verify recently changed to affect the subscription-manager output from the following....

[root@jsefler-onprem-62server ~]# subscription-manager config --remove=non-existing-section.parameter
exception caught in subscription-manager
[root@jsefler-onprem-62server ~]# 


Prior output was...
[root@jsefler-onprem-62server ~]# subscription-manager config --remove=non-existing-section.parameter
No section: 'non-existing-section'



[root@jsefler-onprem-62server ~]# tail -f /var/log/rhsm/rhsm.log
2011-10-18 11:14:08,092 [INFO]  @connection.py:350 - Using certificate authentication: key = /etc/pki/consumer/key.pem, cert = /etc/pki/consumer/cert.pem, ca = /etc/rhsm/ca/, insecure = False
2011-10-18 11:14:08,094 [DEBUG]  @connection.py:188 - Loading CA PEM certificates from: /etc/rhsm/ca/
2011-10-18 11:14:08,094 [DEBUG]  @connection.py:171 - Loading CA certificate: '/etc/rhsm/ca/candlepin-stage.pem'
2011-10-18 11:14:08,094 [DEBUG]  @connection.py:171 - Loading CA certificate: '/etc/rhsm/ca/jsefler-onprem-62candlepin.pem'
2011-10-18 11:14:08,095 [DEBUG]  @connection.py:171 - Loading CA certificate: '/etc/rhsm/ca/redhat-uep.pem'
2011-10-18 11:14:08,096 [WARNING]  @connection.py:383 - Error fetching supported resources, this UEPConnection is likely not usable:
2011-10-18 11:14:08,096 [ERROR]  @connection.py:385 - No such file or directory
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 376, in _load_supported_resources
    resources_list = self.conn.request_get("/")
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 252, in request_get
    return self._request("GET", method)
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 191, in _request
    context.load_cert(self.cert_file, keyfile=self.key_file)
  File "/usr/lib64/python2.6/site-packages/M2Crypto/SSL/Context.py", line 76, in load_cert
    m2.ssl_ctx_use_cert(self.ctx, certfile)
SSLError: No such file or directory
2011-10-18 11:14:08,097 [INFO]  @connection.py:362 - Connection Established: host: jsefler-onprem-62candlepin.usersys.redhat.com, port: 8443, handler: /candlepin
2011-10-18 11:14:08,097 [ERROR]  @managercli.py:65 - exception caught in subscription-manager
2011-10-18 11:14:08,097 [ERROR]  @managercli.py:66 - No section: 'non-existing-section'
Traceback (most recent call last):
  File "/usr/sbin/subscription-manager", line 78, in <module>
    sys.exit(abs(main() or 0))
  File "/usr/sbin/subscription-manager", line 69, in main
    return managercli.CLI().main()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 1370, in main
    cmd.main()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 233, in main
    self._do_command()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 1126, in _do_command
    self._validate_options()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 1118, in _validate_options
    for key, value in cfg.items(section):
  File "/usr/lib/python2.6/site-packages/iniparse/compat.py", line 267, in items
    raise NoSectionError(section)
NoSectionError: No section: 'non-existing-section'



Version-Release number of selected component (if applicable):
[root@jsefler-onprem-62server ~]# rpm -q subscription-manager
subscription-manager-0.96.15-1.git.7.fbf42c7.el6.x86_64


How reproducible:


Steps to Reproduce:
1. above
2.
3.
  
Actual results:


Expected results:


Additional info:
This test discovery comes from an automated test that has been passing for some time.

Comment 1 Bryan Kearney 2011-10-18 15:50:22 UTC

*** This bug has been marked as a duplicate of bug 746264 ***

Comment 3 John Sefler 2011-10-30 03:21:16 UTC
The following branch commits by alikins fix this bug...

RHEL6.2 branch commit ed5f1172f33db33e97cbc5a6d3fe10ee97039557 by Adrian Likins
master branch commit bc4d620ae1a475a15cd89dcbc20742e2d45a9d79 by Adrian Likins

747024: restore previous behaviour for unhandled exceptions

As part of the change to handle unicode strings in error
messages, handle exception was changed to just pass
in handle_exceptions passed in msg. This changed behaviour
for some error cases, so return that, but ignore msgs
passed to systemExit that do not have string reprs.

Comment 4 John Sefler 2011-10-30 03:42:46 UTC
Verifying Version...
[root@jsefler-onprem-62server ~]# rpm -q subscription-manager
subscription-manager-0.96.17-1.el6.x86_64

[root@jsefler-onprem-62server ~]# subscription-manager config --remove=non-existing-section.parameter
No section: 'non-existing-section'
[root@jsefler-onprem-62server ~]# 


^^^ The original behavior has been restored after committed fix in comment 3

moving to VERIFIED

Comment 6 errata-xmlrpc 2011-12-06 17:26:02 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