Bug 743121 - rhn_check "show differences" fails when binary files differ
Summary: rhn_check "show differences" fails when binary files differ
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Clients
Version: 1.5
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
Assignee: Milan Zázrivec
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space16
TreeView+ depends on / blocked
 
Reported: 2011-10-03 21:55 UTC by Brian
Modified: 2011-12-22 16:47 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-22 16:47:03 UTC
Embargoed:


Attachments (Terms of Use)
Client side (corrupt) test file. (5.01 KB, application/octet-stream)
2011-10-07 20:57 UTC, Brian
no flags Details
Spacewalk side (intact) test file. (5.00 KB, application/octet-stream)
2011-10-07 20:58 UTC, Brian
no flags Details
Apache requst/error logs for XMLPRC requests (7.90 KB, text/plain)
2011-10-07 20:59 UTC, Brian
no flags Details
Raw tcpdump of XMLPRC request (13.16 KB, application/octet-stream)
2011-10-07 20:59 UTC, Brian
no flags Details

Description Brian 2011-10-03 21:55:54 UTC
Description of problem:
Our proxies have rpm files among their configuration files, and that file was corrupt on two of the proxies.  As a result, the nightly "Show differences" run never completed on those boxes.  Running rhn_check manually gave this error:
XMLRPC ProtocolError: <ProtocolError for tul1itpswapp01.corporate.local /XMLRPC: 500 Internal Server Error>

The POST to XMLRPC does convert the obvious trouble characters (ampersand, brackets), but the upper ASCII and non-printables are mostly still intact.

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

How reproducible:
If it happens, it will happen every time.

Steps to Reproduce:
1.  Add a small binary to a client's config channel
2.  Corrupt the version on the client
3.  Run a "show differences" task
  
Actual results:
rhn_check fails with
XMLRPC ProtocolError: <ProtocolError for tul1itpswapp01.corporate.local /XMLRPC: 500 Internal Server Error>

Expected results:
Show Differences should return a simple "Binary files differ" without going into the messy details.

Additional info:

Comment 1 Milan Zázrivec 2011-10-07 15:50:33 UTC
Unfortunately, I was not able to reproduce this problem w/ latest
Spacewalk (currently nightly, soon to be released as Spacewalk v1.6) -- as in
diffing the binary files works all right for me.

I'd like to ask you to provide the following info:

1. What's client & server distro & version? (RHEL 5, RHEL-6, ...)
2. rpm -qa|grep rhncfg on the client showing the problem
3. Exact reproducing procedure -- I'm interested in particular what
"Run a "show differences" task" means
4. Provided the content of the following log files from the server
(for the problematic requests):

/var/log/rhn/rhn_config_management.log
/var/log/httpd/*_log

Thank you!

Comment 2 Brian 2011-10-07 20:57:58 UTC
Created attachment 526962 [details]
Client side (corrupt) test file.

Comment 3 Brian 2011-10-07 20:58:34 UTC
Created attachment 526963 [details]
Spacewalk side (intact) test file.

Comment 4 Brian 2011-10-07 20:59:16 UTC
Created attachment 526964 [details]
Apache requst/error logs for XMLPRC requests

Comment 5 Brian 2011-10-07 20:59:54 UTC
Created attachment 526966 [details]
Raw tcpdump of XMLPRC request

Comment 6 Brian 2011-10-07 21:01:24 UTC
1. Client/Server versions -- Spacewalk 1.5 on RHEL 5.7 on both sides

2. rhncfg versions (client side):
rhncfg-actions-5.10.9-1.el5
rhncfg-5.10.9-1.el5
rhncfg-client-5.10.9-1.el5
rhncfg-management-5.10.9-1.el5

3. More procedure details
In this case, my client is one of the Spacewalk Proxy servers.  That shouldn't make a difference, but it may.
From the client command line:
* dd if=/dev/urandom of=config_test.bin bs=1k count=5
* rhncfg-manager add --channel=sw-proxy /var/www/html/pub/config_test.bin
* perl -pi -e 's/M/q%/' config_test.bin
At this point "rhncfg-client diff" produces a correct (if messy) result.
From the Spacewalk web interface:
* Go to the sw-proxy Configuration channel
* Click "Compare all files in channel to files on all subscribed systems"
* This should trigger a "Show differences between profiled config files and deployed config files" task

In my experience, clients in the sw-proxy channel that either do not have config_test.bin or have an unmodified copy of it will complete this task without issue.  The one where I mangled it with perl will eventually end the task with Failed status and an error of "This action has been picked up multiple times without a successful transaction; this action is now failed for this system."  In reality, it picked up and ran the task, but uploading the results to XMLRPC failed.  Running rhn_check manually from the command line also fails.

4.  Logs
Nothing is logged in /var/log/rhn/rhn_config_management.log for the failed task
The httpd logs are attached.  The two test files and a raw tcpdump of the XMLRPC request are also attached.

Comment 7 Milan Zázrivec 2011-10-21 09:38:36 UTC
Fixed in spacewalk.git master: 04699a1b65ef0acacd79f0ac4453280b076eabd7

In case the differences that are about to be reported to server contain
invalid UTF-8 characters, client won't report full diffs, but rather
just a string stating: 'binary files differ'.

Thank you for your bug report.

Comment 8 Milan Zázrivec 2011-12-22 16:47:03 UTC
Spacewalk 1.6 has been released.


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