Bug 906000

Summary: UnicodeDecodeError traceback when registering to an org containing international chars
Product: Red Hat Enterprise Linux 7 Reporter: John Sefler <jsefler>
Component: subscription-managerAssignee: Alex Wood <awood>
Status: CLOSED WORKSFORME QA Contact: IDM QE LIST <seceng-idm-qe-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.0CC: awood
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-15 17:03:56 UTC Type: Bug
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: 863175    

Description John Sefler 2013-01-30 15:28:16 UTC
Description of problem:


Version-Release number of selected component (if applicable):
[root@jsefler-7 ~]# rpm -q subscription-manager python
subscription-manager-1.8.1-1.git.2.23579a5.el7.x86_64
python-2.7.3-13.el7.x86_64


How reproducible:


Steps to Reproduce:
[root@jsefler-7 ~]# subscription-manager register --username=testuser1 --org="富 酒吧"
Password: 
Traceback (most recent call last):
  File "/usr/lib64/python2.7/logging/handlers.py", line 77, in emit
    if self.shouldRollover(record):
  File "/usr/lib64/python2.7/logging/handlers.py", line 156, in shouldRollover
    msg = "%s\n" % self.format(record)
  File "/usr/lib64/python2.7/logging/__init__.py", line 723, in format
    return fmt.format(record)
  File "/usr/lib64/python2.7/logging/__init__.py", line 467, in format
    s = self._fmt % record.__dict__
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 13: ordinal not in range(128)
Logged from file managercli.py, line 1045
Organization 富 酒吧 does not exist.

  
Actual results:
above


Expected results:
expect the same resulst as a rhel6 subscription-manager...
[root@jsefler-6 ~]# subscription-manager register --username=testuser1 --org="富 酒吧"
Password: 
Organization 富 酒吧 does not exist.


Additional info:
[root@jsefler-7 ~]# tail -f /var/log/rhsm/rhsm.log
2013-01-30 10:22:30,844 [DEBUG]  @profile.py:95 - Loading current RPM profile.
2013-01-30 10:22:30,973 [INFO]  @managercli.py:291 - Client Versions: {'python-rhsm': '1.8.1-1.git.1.e5c1539.el7', 'subscription-manager': '1.8.1-1.git.2.23579a5.el7'} 
2013-01-30 10:22:30,975 [INFO]  @connection.py:587 - Using certificate authentication: key = /etc/pki/consumer/key.pem, cert = /etc/pki/consumer/cert.pem, ca = /etc/rhsm/ca/, insecure = False
2013-01-30 10:22:30,975 [INFO]  @connection.py:598 - Connection Built: host: jsefler-f14-candlepin.usersys.redhat.com, port: 8443, handler: /candlepin
2013-01-30 10:22:30,976 [INFO]  @connection.py:594 - Using no auth
2013-01-30 10:22:30,977 [INFO]  @connection.py:598 - Connection Built: host: jsefler-f14-candlepin.usersys.redhat.com, port: 8443, handler: /candlepin
2013-01-30 10:22:30,978 [DEBUG]  @connection.py:394 - Loading CA PEM certificates from: /etc/rhsm/ca/
2013-01-30 10:22:30,979 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/candlepin-stage.pem'
2013-01-30 10:22:30,980 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/redhat-uep.pem'
2013-01-30 10:22:30,981 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/jsefler-f14-7candlepin.pem'
2013-01-30 10:22:30,982 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/jsefler-f14-candlepin.pem'
2013-01-30 10:22:30,982 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/
2013-01-30 10:22:31,079 [DEBUG]  @connection.py:435 - Response status: 200
2013-01-30 10:22:31,081 [DEBUG]  @connection.py:614 - Server supports the following resources:
2013-01-30 10:22:31,082 [DEBUG]  @connection.py:615 - {'': '/', 'hypervisors': '/hypervisors', 'serials': '/serials', 'consumers': '/consumers', 'migrations': '/migrations', 'content': '/content', 'entitlements': '/entitlements', 'statistics/generate': '/statistics/generate', 'status': '/status', 'jobs': '/jobs', 'users': '/users', 'subscriptions': '/subscriptions', 'rules': '/rules', 'consumertypes': '/consumertypes', 'activation_keys': '/activation_keys', 'atom': '/atom', 'owners': '/owners', 'roles': '/roles', 'admin': '/admin', 'events': '/events', 'products': '/products', 'pools': '/pools', 'crl': '/crl'}
2013-01-30 10:22:31,084 [DEBUG]  @connection.py:394 - Loading CA PEM certificates from: /etc/rhsm/ca/
2013-01-30 10:22:31,085 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/candlepin-stage.pem'
2013-01-30 10:22:31,086 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/redhat-uep.pem'
2013-01-30 10:22:31,089 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/jsefler-f14-7candlepin.pem'
2013-01-30 10:22:31,094 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/jsefler-f14-candlepin.pem'
2013-01-30 10:22:31,097 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/status
2013-01-30 10:22:31,123 [DEBUG]  @connection.py:435 - Response status: 200
2013-01-30 10:22:31,132 [DEBUG]  @connection.py:394 - Loading CA PEM certificates from: /etc/rhsm/ca/
2013-01-30 10:22:31,134 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/candlepin-stage.pem'
2013-01-30 10:22:31,135 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/redhat-uep.pem'
2013-01-30 10:22:31,137 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/jsefler-f14-7candlepin.pem'
2013-01-30 10:22:31,139 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/jsefler-f14-candlepin.pem'
2013-01-30 10:22:31,140 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/status
2013-01-30 10:22:31,167 [DEBUG]  @connection.py:435 - Response status: 200
2013-01-30 10:22:31,170 [INFO]  @managercli.py:302 - Server Versions: {'candlepin': '0.7.24-1', 'server-type': 'This system is currently not registered.'} 
2013-01-30 10:22:31,173 [INFO]  @managercli.py:291 - Client Versions: {'python-rhsm': '1.8.1-1.git.1.e5c1539.el7', 'subscription-manager': '1.8.1-1.git.2.23579a5.el7'} 
2013-01-30 10:22:36,452 [INFO]  @connection.py:576 - Using basic authentication as: testuser1
2013-01-30 10:22:36,452 [INFO]  @connection.py:598 - Connection Built: host: jsefler-f14-candlepin.usersys.redhat.com, port: 8443, handler: /candlepin
2013-01-30 10:22:36,664 [DEBUG]  @cert_sorter.py:116 - Sorting product and entitlement cert status for: 2013-01-30 15:22:36.663838+00:00
2013-01-30 10:22:36,667 [DEBUG]  @cert_sorter.py:169 - Installed product IDs: ['99000']
2013-01-30 10:22:36,667 [DEBUG]  @cert_sorter.py:122 - valid entitled products: []
2013-01-30 10:22:36,667 [DEBUG]  @cert_sorter.py:123 - expired entitled products: []
2013-01-30 10:22:36,668 [DEBUG]  @cert_sorter.py:124 - partially entitled products: []
2013-01-30 10:22:36,668 [DEBUG]  @cert_sorter.py:125 - unentitled products: ['99000']
2013-01-30 10:22:36,668 [DEBUG]  @cert_sorter.py:126 - future products: []
2013-01-30 10:22:36,668 [DEBUG]  @cert_sorter.py:127 - partial stacks: []
2013-01-30 10:22:36,668 [DEBUG]  @cert_sorter.py:128 - valid stacks: []
2013-01-30 10:22:36,669 [DEBUG]  @connection.py:394 - Loading CA PEM certificates from: /etc/rhsm/ca/
2013-01-30 10:22:36,670 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/candlepin-stage.pem'
2013-01-30 10:22:36,670 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/redhat-uep.pem'
2013-01-30 10:22:36,671 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/jsefler-f14-7candlepin.pem'
2013-01-30 10:22:36,671 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/jsefler-f14-candlepin.pem'
2013-01-30 10:22:36,672 [DEBUG]  @connection.py:415 - Making request: POST /candlepin/consumers?owner=%E5%AF%8C+%E9%85%92%E5%90%A7
2013-01-30 10:22:36,769 [DEBUG]  @connection.py:435 - Response status: 400

Comment 2 John Sefler 2013-01-30 21:59:11 UTC
Here's another occurance of the same traceback using activationkey names with international chars...

[root@jsefler-7 ~]# subscription-manager register --force --org=admin --activationkey="使 용 Ф ব্ ಬ ഉ ବ୍ டு వా Й Ó"
The system with UUID 8ee7eeb9-6bc3-4091-9f29-4a0aa2a4686f has been unregistered
Traceback (most recent call last):
  File "/usr/lib64/python2.7/logging/handlers.py", line 77, in emit
    if self.shouldRollover(record):
  File "/usr/lib64/python2.7/logging/handlers.py", line 156, in shouldRollover
    msg = "%s\n" % self.format(record)
  File "/usr/lib64/python2.7/logging/__init__.py", line 723, in format
    return fmt.format(record)
  File "/usr/lib64/python2.7/logging/__init__.py", line 467, in format
    s = self._fmt % record.__dict__
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 16: ordinal not in range(128)
Logged from file managercli.py, line 1045
Activation key '使 용 Ф ব্ ಬ ഉ ବ୍ டு వా Й Ó' not found for organization 'admin'.

Comment 3 Alex Wood 2013-02-14 21:03:33 UTC
I can't replicate this with subscription-manager-1.8.2-1.el7.x86_64.  Can you please try the latest RHEL 7 nightly and test again?

Comment 4 John Sefler 2013-02-15 17:03:56 UTC
(In reply to comment #3)
> I can't replicate this with subscription-manager-1.8.2-1.el7.x86_64.  Can
> you please try the latest RHEL 7 nightly and test again?

Agreed. I also cannot reproduce with a newer subscription-manager...

[root@jsefler-7 ~]# rpm -q subscription-manager
subscription-manager-1.8.2-1.git.20.c213b88.el7.x86_64
[root@jsefler-7 ~]# subscription-manager register --username=testuser1 --org="富 酒吧"
Password: 
Organization 富 酒吧 does not exist.
[root@jsefler-7 ~]# subscription-manager register --force --org=admin --activationkey="使 용 Ф ব্ ಬ ഉ ବ୍ டு వా Й Ó"
Activation key '使 용 Ф ব্ ಬ ഉ ବ୍ டு వా Й Ó' not found for organization 'admin'.
[root@jsefler-7 ~]# 


Moving STATUS to CLOSED.