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 2029395 - insights-client --register --verbose throwing error UnicodeEncodeError: 'ascii' codec can't encode character '\ufffd' in position 94: ordinal not in range(128)
Summary: insights-client --register --verbose throwing error UnicodeEncodeError: 'asci...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: insights-client
Version: 8.5
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: 8.8
Assignee: Link Dupont
QA Contact: Pavol Kotvan
URL:
Whiteboard:
Depends On:
Blocks: 2130596 2141087
TreeView+ depends on / blocked
 
Reported: 2021-12-06 11:56 UTC by Shivam Gupta
Modified: 2023-05-16 09:35 UTC (History)
15 users (show)

Fixed In Version: insights-client-3.1.7-10.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2130596 2141087 (view as bug list)
Environment:
Last Closed: 2023-05-16 08:30:42 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHCLOUD-18740 0 None None None 2022-04-05 17:24:46 UTC
Red Hat Issue Tracker RHCLOUD-21394 0 None None None 2022-09-29 13:55:27 UTC
Red Hat Issue Tracker RHELPLAN-104823 0 None None None 2021-12-06 11:56:51 UTC
Red Hat Product Errata RHBA-2023:2803 0 None None None 2023-05-16 08:31:06 UTC

Description Shivam Gupta 2021-12-06 11:56:22 UTC
Description of problem: insights-client --register --verbose is throwing error messages while using it in kickstart file:-

--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib64/python3.6/logging/__init__.py", line 996, in emit
    stream.write(msg)
UnicodeEncodeError: 'ascii' codec can't encode character '\ufffd' in position 94: ordinal not in range(128)
Call stack:
  File "/usr/lib/python3.6/site-packages/insights_client/run.py", line 18, in <module>
    sys.exit(phase())
  File "/etc/insights-client/rpm.egg/insights/client/phase/v1.py", line 32, in _f
    func(client, config)
  File "/etc/insights-client/rpm.egg/insights/client/phase/v1.py", line 129, in update
    client.update()
  File "/etc/insights-client/rpm.egg/insights/client/__init__.py", line 258, in update
    egg_paths = self.fetch()
  File "/etc/insights-client/rpm.egg/insights/client/__init__.py", line 157, in fetch
    force)
  File "/etc/insights-client/rpm.egg/insights/client/__init__.py", line 72, in _init_connection
    return func(self, *args, **kwargs)
  File "/etc/insights-client/rpm.egg/insights/client/__init__.py", line 208, in _fetch
    response = self.connection.get(url)
  File "/etc/insights-client/rpm.egg/insights/client/connection.py", line 195, in get
    return self._http_request(url, 'GET', **kwargs)
  File "/etc/insights-client/rpm.egg/insights/client/connection.py", line 191, in _http_request
    logger.log(NETWORK, "HTTP Response Text: %s", res.text)
Message: 'HTTP Response Text: %s'
Arguments: ('PK\x03\x04\n\x00\x00\x00\x00\x00\x00\x00!L\ufffd\x06\ufffd2\x01\x00\x00\x00\x01\x00\x00\x00\x1d\x00\x00\x00EGG-INFO/dependency_links.txt\nPK\x03\x04\x14\x00\x00\x00\x08\x00\x00\x00!L\ufffd\ufffd\u02e0\ufffd\x00\x00\x00\ufffd\x01\x00\x00\x19\x00\x00\x00EGG-INFO/entry_points.txte\ufffdQ\x0e\ufffd \x0c\ufffd\ufffd=\ufffd\x17\ufffd\x070\ufffdI\ufffd\u0150\ufffdic\ufffd\ufffd\x83\ufffd\ufffd\t\ufffd!<\ufffd\ufffd\ufffd_\ufffd\ufffd@\ufffd\n\ufffd\x10\ufffdG}w\ufffd\ufffd.\ufffd\u03de\ufffd\u04b2F\x1d2\x19Cr\ufffd\ufffdn\ufffdXk\ufffd<y\x13\x14\ufffdh\r\ufffd\ufffd\x07\ufffd\u06e8(\ufffdG\ufffd\ufffdZ\x13f\ufffd\ufffd\ufffd\x19U\ufffd\ufffd\ufffd;\ufffd\x08[;\ufffd\x08\ufffd\x1a\ufffd\ufffd\ufffd\ufffd7a\ufffd\x1bS}\ufffdI\ufffd\ufffd\ufffdt\x1aUO\ufffd\ufffd\ufffde\ufffdb\ufffdz\x1c\ufffd\ufffdrx\\pa,\ufffd)\x12\x0f\x19g\ufffd\ufffd\x01PK\x03\x04\x14\x00\x00\x00\x08\x00\x00\x00!L\ufffd\x1f@@@



Version-Release number of selected component (if applicable): 
- insights-client-3.1.7-1.el8_5.noarch
- RHEL8.5

Comment 7 Link Dupont 2022-06-17 10:31:44 UTC
The upstream fix to the CDN has been deployed, and HTTP responses now set the correct content-type header.

$ sudo curl -I --cacert /etc/insights-client/cert-api.access.redhat.com.pem --cert /etc/pki/consumer/cert.pem --key /etc/pki/consumer/key.pem https://cert-api.access.redhat.com/r/insights/v1/static/release/insights-core.egg
HTTP/1.1 200 OK
Accept-Ranges: bytes
ETag: "337703f5efb120315953fecf1cba5ce5:1655130703.369429"
Last-Modified: Mon, 13 Jun 2022 14:31:34 GMT
Server: AkamaiNetStorage
Content-Length: 1276395
Date: Fri, 17 Jun 2022 10:28:52 GMT
Connection: keep-alive
Content-Type: application/zip

Comment 28 Link Dupont 2022-11-08 15:32:10 UTC
Steps to Reproduce:

1) rm /var/lib/insights/last_stable.egg*
2) rm /etc/insights-client/insights-core.etag
3) insights-client --verbose


Additional info:

Because the egg used during the first run of insights-client is /etc/insights-client/rpm.egg, and because the etag file does not exist, and because /etc/insights-client/rpm.egg does not contain the fixes to the logging that were made after insights-client-3.1.7 was released, when insights-client downloads the latest egg, it erroneously logs it. This is why it is only occurring during first boot, kickstart %post scriptlets, etc.

This will require an updated RPM in order to fix.

Comment 40 errata-xmlrpc 2023-05-16 08:30:42 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 (insights-client bug fix and enhancement update), 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-2023:2803


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