Bug 789182

Summary: [ALL LANG] [RHSM CLI] identity --regenerate module with wrong username or password produces traceback : "UnicodeEncodeError: 'ascii' codec can't encode characters in position..".
Product: Red Hat Enterprise Linux 5 Reporter: Lijun Li <lijli>
Component: subscription-managerAssignee: Alex Wood <awood>
Status: CLOSED ERRATA QA Contact: Entitlement Bugs <entitlement-bugs>
Severity: high Docs Contact:
Priority: unspecified    
Version: 5.8CC: awood, bkearney, cduryee, fsharath, jsefler, lijli, qe-i18n-bugs
Target Milestone: rcKeywords: i18n
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: The logging of unicode strings. Consequence: A traceback would be printed to the console. Fix: Properly handling logging messages as unicode. Result: No tracebacks are produced.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-08 03:48:51 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: 771748, 807971    
Attachments:
Description Flags
identity module --regenerate with wrong username or password produces traceback none

Description Lijun Li 2012-02-10 02:54:03 UTC
Description of problem:
identity module --regenerate with wrong username or password produces traceback : "UnicodeEncodeError: 'ascii' codec can't encode characters in position..".

Version-Release number of selected component (if applicable):
subscription-manager-0.98.14-1.el5

How reproducible:
100%

Steps to Reproduce:
1. Install rhel5.8 build via
http://download.englab.nay.redhat.com/pub/rhel/rel-eng/RHEL5.8-Server-20120202.0/5/x86_64/os/

2.(Run the command when the system IS registered)

$ sudo subscription-manager identity --regenerate

(Run with wrong option)
$ sudo subscription-manager identity --regenerate --username=wrong_USERNAME --password=wrong_PASSWORD --force

  
Actual results:
identity module --regenerate with wrong username or password produces traceback : "UnicodeEncodeError: 'ascii' codec can't encode characters in position..".

Expected results:
Should no traceback.

Additional info:

Comment 1 Lijun Li 2012-02-10 02:57:25 UTC
Created attachment 560750 [details]
identity module --regenerate  with wrong username or password produces traceback

Comment 2 Bryan Kearney 2012-03-08 17:24:07 UTC
This is fixed in the 0.99.X branch. Please test this with the first DEV build of 5.9.

Comment 4 RHEL Program Management 2012-04-02 10:19:46 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 6 Alex Wood 2012-05-10 18:45:10 UTC
*** Bug 814849 has been marked as a duplicate of this bug. ***

Comment 7 Alex Wood 2012-05-18 20:15:36 UTC
commit 3fde08c67d791e099ddfd97639b4a8892f0d9b7b
Author: Alex Wood <awood>
Date:   Thu May 17 10:20:59 2012 -0400

    789182: Fix UnicodeEncodeError when logging.
    
    Strings sent to the logger that may have unicode text in them
    must be prefaced with a "u".

Comment 9 Sharath Dwaral 2012-06-19 21:46:23 UTC
Description of problem:
identity module --regenerate with wrong username or password produces traceback : "UnicodeEncodeError: 'ascii' codec can't encode characters in position..".

Version-Release number of selected component (if applicable):
RHEL 5.9
# rpm -qa | grep subscription-manager
subscription-manager-migration-1.0.4-1.git.0.0fe81f8.el5
subscription-manager-1.0.4-1.git.0.0fe81f8.el5
subscription-manager-migration-data-1.11.1.1-1.git.2.c7fbafe.el5
subscription-manager-gui-1.0.4-1.git.0.0fe81f8.el5
subscription-manager-firstboot-1.0.4-1.git.0.0fe81f8.el5

How reproducible:
100%

Steps to Reproduce:

# sudo subscription-manager identity --regenerate --username=wrong_USERNAME --password=wrong_PASSWORD --force
Invalid Credentials

Actual Result:
As shown above

Expected Result:
Should display Invalid Credentials

Moving bug to Verified State

Comment 11 errata-xmlrpc 2013-01-08 03:48:51 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-0033.html