RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1745768 - UnicodeDecodeError: 'ascii' codec can't decode byte 0xb2 in position 13: ordinal not in range(128)
Summary: UnicodeDecodeError: 'ascii' codec can't decode byte 0xb2 in position 13: ordi...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: virt-who
Version: 7.7
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: rc
: ---
Assignee: candlepin-bugs
QA Contact: Eko
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-08-26 21:09 UTC by Joniel Pasqualetto
Modified: 2023-10-06 18:30 UTC (History)
12 users (show)

Fixed In Version: virt-who-0.26.3-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-31 19:09:00 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github candlepin virt-who pull 236 0 'None' closed 1745768: Make message unicode safe 2020-09-24 15:24:23 UTC
Red Hat Knowledge Base (Solution) 4375471 0 None None None 2020-07-26 16:51:18 UTC
Red Hat Product Errata RHBA-2020:0990 0 None None None 2020-03-31 19:09:12 UTC

Description Joniel Pasqualetto 2019-08-26 21:09:21 UTC
Description of problem:

virt-who fails when using a username in format "DOMAIN\username" with a hyperv type backend.

Version-Release number of selected component (if applicable):

virt-who-0.24.7-1.el7.noarch

How reproducible:
Always

Steps to Reproduce:
1. Create a virt-who config and in the username put it like this:

username=DOMAIN\username

2. Run virt-who in debug mode:

virt-who -od -c test.conf

~~~
2019-08-26 17:00:49,297 [virtwho.main ERROR] MainProcess(31538):Thread-2 @virt.py:run:421 - Thread 'virt-who-config-7' fails with exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/virtwho/virt/virt.py", line 412, in run
    self._run()
  File "/usr/lib/python2.7/site-packages/virtwho/virt/virt.py", line 367, in _run
    data_to_send = self._get_data()
  File "/usr/lib/python2.7/site-packages/virtwho/virt/virt.py", line 963, in _get_data
    return self._get_report()
  File "/usr/lib/python2.7/site-packages/virtwho/virt/virt.py", line 951, in _get_report
    return HostGuestAssociationReport(self.config, self.getHostGuestMapping())
  File "/usr/lib/python2.7/site-packages/virtwho/virt/hyperv/hyperv.py", line 564, in getHostGuestMapping
    "root/virtualization")
  File "/usr/lib/python2.7/site-packages/virtwho/virt/hyperv/hyperv.py", line 420, in Enumerate
    body = self.post(data)
  File "/usr/lib/python2.7/site-packages/virtwho/virt/hyperv/hyperv.py", line 382, in post
    response = self.connection.post(self.url, body, headers=headers)
  File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 520, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 477, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 595, in send
    r = dispatch_hook('response', hooks, r, **kwargs)
  File "/usr/lib/python2.7/site-packages/requests/hooks.py", line 41, in dispatch_hook
    _hook_data = hook(hook_data, **kwargs)
  File "/usr/lib/python2.7/site-packages/virtwho/virt/hyperv/hyperv.py", line 240, in handle_response
    return self.retry_ntlm_negotiate(response, **kwargs)
  File "/usr/lib/python2.7/site-packages/virtwho/virt/hyperv/hyperv.py", line 126, in retry_ntlm_negotiate
    negotiate = base64.b64encode(self.ntlm.negotiate_message(self.username)).decode('utf-8')
  File "/usr/lib/python2.7/site-packages/virtwho/virt/hyperv/ntlm.py", line 495, in negotiate_message
    data = NegotiateMessage(self.domain, self.workstation).data
  File "/usr/lib/python2.7/site-packages/virtwho/virt/hyperv/ntlm.py", line 202, in data
    return self._format()
  File "/usr/lib/python2.7/site-packages/virtwho/virt/hyperv/ntlm.py", line 263, in _format
    return OutgoingMessage._format(self) + self.domain + self.workstation
UnicodeDecodeError: 'ascii' codec can't decode byte 0xb2 in position 13: ordinal not in range(128)
~~~


Actual results:
Execution fails and virt-who does not update guest mappings.

Expected results:
virt-who would support the syntax.

Additional info:

using username@DOMAIN or only username seems to work fine

Comment 10 yuefliu 2019-09-23 07:36:28 UTC
Verified the bug with virt-who-0.26.3-1.el7.noarch, virt-who reports hyperv mapping normally with username=domain\username.

Comment 13 errata-xmlrpc 2020-03-31 19:09:00 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.

https://access.redhat.com/errata/RHBA-2020:0990


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