Bug 1025891 - Proxy throws exception when renewing auth token
Summary: Proxy throws exception when renewing auth token
Keywords:
Status: CLOSED DUPLICATE of bug 1201380
Alias: None
Product: Spacewalk
Classification: Community
Component: Proxy Server
Version: 2.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Stephen Herr
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space27
TreeView+ depends on / blocked
 
Reported: 2013-11-01 20:21 UTC by Stephen Herr
Modified: 2017-09-28 18:08 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-30 18:07:11 UTC


Attachments (Terms of Use)

Description Stephen Herr 2013-11-01 20:21:28 UTC
Description of problem:
If the proxy's auth token is expired the next request to it will fail with SysCallError: (-1, 'Unexpected EOF') in the httpd/error_log.

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

How reproducible:
always

Steps to Reproduce:
1. have an expired auth token for the proxy in /var/cache/rhn/proxy_auth, usually by not making any requests through the proxy for a few days
2. attempt to do something through the proxy, say register a system

Actual results:
attempt will fail, error will be in log

Expected results:
attempt should succeed

Additional info:
This appears to be related to 62bfef31c610c85c2e2adb06781b17c21cdf7dff. Instead of reading request content into a variable and referencing the variable, we now pass the content directly to the request writer (and actually it looks like later modifications have read it into a variable anyway. Does that negate the point of this update?).

The problem is that the content is contained in a buffered reader, so reading it once destroys the content for future reads. In this particular case (when the auth tokens are expired) we read it the first time we sent the request upstream. Upstream comes back with a "you need to update your auth token" message, which we successfully do, and then we try to send the request again. But the second time through there is nothing left to read and the request fails.

The relevant code is in the rhnShared.py file, in the stanza following the "# Send the body too if there is a body" comment.

We may have to just revert the commit mentioned above.

Comment 1 Stephen Herr 2015-03-30 18:07:11 UTC
This issue is also reported in bug 1201380, which has additional discussion and a fix already in-place. Closing as a duplicate.

*** This bug has been marked as a duplicate of bug 1201380 ***

Comment 2 Eric Herget 2017-09-28 18:08:27 UTC
This BZ closed some time during 2.5, 2.6 or 2.7.  Adding to 2.7 tracking bug.


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