Bug 495778

Summary: If the text that accompanies a Solaris patch/patch cluster contains Unicode characters, rhnpush will generate an intriguing ISE
Product: Red Hat Satellite 5 Reporter: Steve Salevan <ssalevan>
Component: SolarisAssignee: Jan Pazdziora <jpazdziora>
Status: CLOSED CURRENTRELEASE QA Contact: Steve Salevan <ssalevan>
Severity: medium Docs Contact:
Priority: medium    
Version: 530CC: bbuckingham, bperkins
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: sat530 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-10 19:41:14 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: 457000    

Description Steve Salevan 2009-04-14 18:42:00 UTC
Description of problem:
If a user attempts to push a custom patch or patch cluster and the text accompanying this patch or cluster contains a Unicode character (such as u'\xb7'), rhnpush will generate an ISE, containing the following Python traceback:

Exception Handler Information
Traceback (most recent call last):
  File "/usr/share/rhn/server/apacheUploadServer.py", line 107, in _wrapper
    ret = function(req)
  File "/usr/share/rhn/upload_server/handlers/package_push/package_push.py", line 145, in handler
    relative_path=self.rel_package_path, org_id=self.org_id)
  File "/usr/share/rhn/server/rhnPackageUpload.py", line 223, in push_package
    header_end=header_end, channels=channels)
  File "/usr/share/rhn/server/importlib/mpmSource.py", line 215, in create_package
    org_id=org_id, channels=channels)
  File "/usr/share/rhn/server/importlib/mpmSource.py", line 88, in populate
    org_id, channels)
  File "/usr/share/rhn/server/importlib/headerSource.py", line 135, in populate
    header_start, header_end)
  File "/usr/share/rhn/server/importlib/headerSource.py", line 57, in populate
    val = str(val)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xb7' in position 4: ordinal not in range(128)

Since, to the best of my knowledge, Unicode is included on modern-day Solaris machines, it seems that we're assuming we'll be receiving ASCII text from the server side, and when we don't receive it, the Unicode codec bombs.

Version-Release number of selected component (if applicable):
530-re20090409.1

How reproducible:
Always

Steps to Reproduce:
1. Create a patch or patch cluster whose accompanying text includes a Unicode character that the ascii codec cannot encode to Unicode
2. Upload this patch or patch cluster to a Solaris box registered to a Satellite
3. rhnpush that patch or patch cluster
  
Actual results:
ISE and traceback e-mail similar to attached traceback e-mail

Expected results:
Upload successful

Additional info:

Comment 4 Jan Pazdziora 2009-04-22 13:22:11 UTC
Steve, what happens when you install the patch cluster on the Solaris box manually, not via Satellite? Will it work as expected?

I wouldn't like use to change the behaviour of rhnpush this late in Satellite 5.3.0 release time, only to find out that the UTF-8 characters bomb in native Solaris toolchain.

Comment 5 Jan Pazdziora 2009-05-22 12:03:41 UTC
I've reproduced the problem.

Comment 6 Jan Pazdziora 2009-05-22 14:08:59 UTC
Fixed in Spacewalk repo, 8803cf9c8ac68f2a3146af2086d20689ab2611d6 and dd570b6d10c1e3f008c3c1e4488a402101f5ee2f.

Comment 7 Steve Salevan 2009-05-26 18:25:24 UTC
It's probably moot by this point, but upon all supported Solaris permutations, all Unicode-laden patch clusters installed successfully when the installation was performed manually.

Comment 8 Steve Salevan 2009-06-03 19:04:29 UTC
VERIFIED on 5/29 build.

Comment 9 Brandon Perkins 2009-08-25 17:27:54 UTC
Release Pending.  Looks good on latest Stage Satellite.

Comment 10 Brandon Perkins 2009-09-10 19:41:14 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-1434.html