Bug 1198817 - Upload of redhat-logos RPM to custom RHEL5 repository causes UnicodeDecodeError
Summary: Upload of redhat-logos RPM to custom RHEL5 repository causes UnicodeDecodeError
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Update Infrastructure for Cloud Providers
Classification: Red Hat
Component: RHUA
Version: 2.1.3
Hardware: x86_64
OS: Linux
high
high
Target Milestone: ---
: 3.0.0
Assignee: RHUI Bug List
QA Contact: Radek Bíba
URL:
Whiteboard:
Depends On: 1306404 1306411
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-03-04 21:20 UTC by Rob Leadbeater
Modified: 2020-03-11 14:53 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-07-09 12:58:08 UTC
Target Upstream Version:


Attachments (Terms of Use)
Upload failure in RHUI 3 (5.43 KB, text/plain)
2016-09-05 12:59 UTC, Radek Bíba
no flags Details

Description Rob Leadbeater 2015-03-04 21:20:00 UTC
Description of problem:
When attempting to upload RPM redhat-logos-4.9.16-1.noarch.rpm to a custom repository, upload fails with an UnicodeDecodeError.

Version-Release number of selected component (if applicable):
rh-rhui-tools-2.1.37-2.el6.noarch

How reproducible:
Always

Steps to Reproduce:
1. Create a new custom repository
2. Attempt to upload redhat-logos-4.9.16-1.noarch.rpm to this repository
3.

Actual results:
Upload fails with the following error: 

An unexpected error has occurred during the last operation.
More information can be found in /root/.rhui/rhui.log.

The last line of rhui.log:
UnicodeDecodeError: 'utf8' codec can't decode byte 0xa9 in position 10: invalid start byte

Expected results:
RPM is uploaded into the repository without error.

Additional info:

Screen output from rhui-manager:

rhui (repo) => c

Unique ID for the custom repository (alphanumerics, _, and - only):
5Server-x86_64-Test

Display name for the custom repository [5Server-x86_64-Test]:


Path at which the repository will be served [5Server-x86_64-Test]:


Algorithm to use when calculating the checksum values for repository metadata:
* Select "sha256" for RHEL6:
* Select "sha1" for either RHEL5 or RHEL6:

  1  - sha256
  2  - sha1
Enter value (1-2) or 'b' to abort: 2

Should the repository require an entitlement certificate to access? (y/n)
y

Based on the repository's relative path, the suggested entitlement path is:
  5Server-$basearch-Test

Path that should be used when granting an entitlement for this repository. This
may use yum variable substitutions (e.g. $basearch) to group this together with
other repositories that share the entitlement [5Server-$basearch-Test]:


Should the repository require clients to perform a GPG check and
verify packages are signed by a GPG key? (y/n)
n

The following repository will be created:
  ID:              5Server-x86_64-Test
  Name:            5Server-x86_64-Test
  Path:            5Server-x86_64-Test
  Entitlement:     5Server-$basearch-Test
  GPG Check        No
  Red Hat GPG Key: No
Proceed? (y/n) y

Successfully created repository 5Server-x86_64-Test

rhui (repo) => u

Select the repositories to upload the package into:
  -  1 : 5Server-x86_64-Test
Enter value (1-1) to toggle selection, 'c' to confirm selections, or '?' for more commands: 1

Select the repositories to upload the package into:
  x  1 : 5Server-x86_64-Test
Enter value (1-1) to toggle selection, 'c' to confirm selections, or '?' for more commands: c


Enter the location of the packages to upload. If the location is an RPM,
the file will be uploaded. If the location is a directory, all RPMs in that
directory will be uploaded:
/root/packages/

The following RPMs will be uploaded:
  redhat-logos-4.9.16-1.noarch.rpm
Proceed? (y/n) y


Uploading /root/packages/redhat-logos-4.9.16-1.noarch.rpm...

An unexpected error has occurred during the last operation.
More information can be found in /root/.rhui/rhui.log.


/root/.rhui/rhui.log:

Connecting to RHUA [rhua2.test.com]...
Successfully connected to [rhua2.test.com]
Unexpected error caught at the shell level
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/rhui/tools/shell.py", line 86, in safe_listen
    self.listen(clear=first_run)
  File "/usr/lib/python2.6/site-packages/rhui/tools/shell.py", line 112, in listen
    Shell.listen(self)
  File "/usr/lib/python2.6/site-packages/rhui/common/shell.py", line 186, in listen
    item.func(*args, **item.kwargs)
  File "/usr/lib/python2.6/site-packages/rhui/tools/screens/repo.py", line 637, in upload
    self.pulp.upload(repo_ids, rpm)
  File "/usr/lib/python2.6/site-packages/rhui/tools/pulp_api.py", line 442, in upload
    uploaded = self.upload_api.import_content(metadata, upload_id)
  File "/usr/lib/python2.6/site-packages/pulp/client/api/upload.py", line 183, in import_content
    return self.server.POST(path, uploadinfo)[1]
  File "/usr/lib/python2.6/site-packages/pulp/client/api/server.py", line 324, in POST
    return self._request('POST', path, body=body)
  File "/usr/lib/python2.6/site-packages/pulp/client/api/server.py", line 262, in _request
    body = json.dumps(body)
  File "/usr/lib64/python2.6/json/__init__.py", line 230, in dumps
    return _default_encoder.encode(obj)
  File "/usr/lib64/python2.6/json/encoder.py", line 367, in encode
    chunks = list(self.iterencode(o))
  File "/usr/lib64/python2.6/json/encoder.py", line 309, in _iterencode
    for chunk in self._iterencode_dict(o, markers):
  File "/usr/lib64/python2.6/json/encoder.py", line 275, in _iterencode_dict
    for chunk in self._iterencode(value, markers):
  File "/usr/lib64/python2.6/json/encoder.py", line 309, in _iterencode
    for chunk in self._iterencode_dict(o, markers):
  File "/usr/lib64/python2.6/json/encoder.py", line 275, in _iterencode_dict
    for chunk in self._iterencode(value, markers):
  File "/usr/lib64/python2.6/json/encoder.py", line 294, in _iterencode
    yield encoder(o)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xa9 in position 10: invalid start byte

Comment 1 Rob Leadbeater 2015-03-04 21:24:04 UTC
Checksum of RPM has been validated:

# sha256sum /root/packages/redhat-logos-4.9.16-1.noarch.rpm
5cd4b1c705035e254f9487209251515de4355f7e6df12c31d0def86a3f22c10a  /root/packages/redhat-logos-4.9.16-1.noarch.rpm

Comment 4 Rob Leadbeater 2015-03-05 09:55:04 UTC
This appears to be related to the upload routine not correctly handling a copyright symbol in the redhat-logos RPM header.

# rpm -q --info -p redhat-logos-4.9.16-1.noarch.rpm
warning: redhat-logos-4.9.16-1.noarch.rpm: Header V3 DSA/SHA1 Signature, key ID 37017186: NOKEY
Name        : redhat-logos                 Relocations: (not relocatable)
Version     : 4.9.16                            Vendor: Red Hat, Inc.
Release     : 1                             Build Date: Thu 04 Jan 2007 07:13:34 PM GMT
Install Date: (not installed)               Build Host: altix1.build.redhat.com
Group       : System Environment/Base       Source RPM: redhat-logos-4.9.16-1.src.rpm
Size        : 16488020                         License: Copyright © 1999-2006 Red Hat, Inc.  All rights reserved.
Signature   : DSA/SHA1, Wed 17 Jan 2007 05:50:25 PM GMT, Key ID 5326810137017186
Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
Summary     : Red Hat-related icons and pictures.
Description :
The redhat-logos package (the "Package") contains files of the Red Hat
"Shadow Man" logo and the RPM logo (the "Logos").  Red Hat, the Red
Hat "Shadow Man" logo, RPM, and the RPM logo are trademarks or
registered trademarks of Red Hat, Inc. in the United States and other
countries.

See the included COPYING file for information on copying and
redistribution.

Comment 7 Radek Bíba 2016-09-05 12:59:06 UTC
Created attachment 1197941 [details]
Upload failure in RHUI 3

Reproduced with RHUI 2:

====
Uploading /mnt/p/redhat-logos-4.9.16-1.noarch.rpm...

An unexpected error has occurred during the last operation.
More information can be found in /root/.rhui/rhui.log.
====

Seems to work fine in RHUI 3 at first sight:

====
Uploading /mnt/p/redhat-logos-4.9.16-1.noarch.rpm to server...
Associating /mnt/p/redhat-logos-4.9.16-1.noarch.rpm has been queued, task will run at the next available time slot.
====

However, the package doesn't get added to the repo. A traceback gets logged instead; see the attachment.

Comment 8 Radek Bíba 2016-09-05 12:59:54 UTC
Moving out of ON_QA based on the previous comment.


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