Bug 602591 - wget of packages from WebUI via RHN Proxy returns 0 bytes RPM package
Summary: wget of packages from WebUI via RHN Proxy returns 0 bytes RPM package
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite Proxy 5
Classification: Red Hat
Component: Server
Version: 530
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Miroslav Suchý
QA Contact: Garik Khachikyan
URL:
Whiteboard:
Depends On: 604167
Blocks: sat531-blockers
TreeView+ depends on / blocked
 
Reported: 2010-06-10 09:19 UTC by Vishal Gaikwad
Modified: 2018-10-27 12:00 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 604167 (view as bug list)
Environment:
Last Closed: 2010-06-29 09:17:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2010:0502 0 normal SHIPPED_LIVE Red Hat Network Satellite bug fix update 2010-06-29 09:17:48 UTC

Description Vishal Gaikwad 2010-06-10 09:19:14 UTC
Description of problem:
wget RPM from client to RHN Satellite via RHN Proxy returns 0 byte file

Version-Release number of selected component (if applicable):
RHN Proxy 530

How reproducible:
Always

Steps to Reproduce:
1. Setup a RHN Proxy 5.3 connected to RHN Satellite 530
2. From the Satellite WebUI, click Channels -> Packages -> Select any package's download link
3. Replace the RHN Satellite's FQDN with RHN Proxy's FQDN
4. wget http://rhn-proxy-fqdn/download/package/92ae189222b8301fb35a07d1ba393ff67517a713/1276023102650/1/14044/acpid-1.0.4-5.i386.rpm

Actual results:

-rw-rw-r-- 1 xxxx xxxx        0 2010-06-10 12:46 acpid-1.0.4-5.i386.rpm

A zero byte rpm package

Expected results:
Full/actual size of the RPM package

Additional info:
A wget of the same package using RHN Satellite's FQDN works fine.

Comment 8 Miroslav Suchý 2010-06-15 12:47:54 UTC
Problem is in:
2010/06/15 08:14:08 -04:00 2840 127.0.0.1: proxy/rhnShared._forwardServer2Client
2010/06/15 08:14:08 -04:00 2840 127.0.0.1: proxy/rhnShared._determineHTTPBodySize('headers: ', [('transfer-encoding', 'chunked'), ('set-cookie', 'JSESSIONID=8A60B7AA0C6FE2019F25949F394F0CEF; Path=/rhn; Secure'), ('keep-alive', 'timeout=15, max=400'), ('connection', 'Keep-Alive'), ('date', 'Tue, 15 Jun 2010 12:13:00 GMT'), ('content-type', 'application/octet-stream;charset=UTF-8')])
2010/06/15 08:14:08 -04:00 2840 127.0.0.1: proxy/rhnShared._forwardHTTPBody('Response body size: ', 0)
2010/06/15 08:14:08 -04:00 2840 127.0.0.1: proxy/apacheHandler.handler('Leaving with status code 0',)


where _forwardHTTPBody forward 0 bytes of body.
This is due missing content lenght in response from satellite:

$ GET -sSed http://morbo.rdu.redhat.com/download/package/11bad99a0e3360de514e17b3d818b01152999f13/1276639949993/1/38976/kmod-kvm-83-105.el5_4.27.x86_64.rpm
GET http://morbo.rdu.redhat.com/download/package/11bad99a0e3360de514e17b3d818b01152999f13/1276639949993/1/38976/kmod-kvm-83-105.el5_4.27.x86_64.rpm --> 200 OK
Connection: close
Date: Tue, 15 Jun 2010 12:19:02 GMT
Content-Type: application/octet-stream;charset=UTF-8
Client-Date: Tue, 15 Jun 2010 12:19:04 GMT
Client-Peer: 10.11.242.126:80
Client-Response-Num: 1
Client-Transfer-Encoding: chunked
Set-Cookie: JSESSIONID=5E5E363195FB04E8D4BFC058EE8EDAEE; Path=/rhn

Note that even with fix from 
https://bugzilla.redhat.com/show_bug.cgi?id=578854#c2
it did not work. The data however get from rhnRedirect to squid, but squid thinks:
2010/06/15 08:36:01| Oversized chunk header on port 33548, url http://127.0.0.1/download/package/bcdb679c2b84b60f43fb147546dae17fcfb49d71/1276641267091/1/38906/kmod-kvm-83-105.el5.x86_64.rpm
and immediately release the data from cache. And rhnBroker will not forward those data anyway (reason is still unknown to me).

But correct fix should be to send Content-Length from Satellite server.

Comment 11 Tomas Lestach 2010-06-15 14:26:26 UTC
Adding "Content-Length" to response header for different download contents

spacewalk.git: a66747190151e01e482b30e7d627f7f833947f70

Comment 12 Miroslav Suchý 2010-06-24 08:43:26 UTC
cherrypicked to satellite.git as commit 3a7066013955f958a7668c3d928a47259d3f428e

Comment 15 Garik Khachikyan 2010-06-28 08:23:03 UTC
# VERIFIED

Checked against Satellites installed on RHEL4, RHEL5. (with arch-s i386 x86_64).

The rpm, Solaris pkg, patch and patch cluster stuff retrieval is successful (with content length not 0) through RHN Proxy now.

Packages fixing the issue:
---
spacewalk-java-0.5.44-84
spacewalk-java-config-0.5.44-84
spacewalk-java-lib-0.5.44-84
spacewalk-taskomatic-0.5.44-84
---

Comment 17 errata-xmlrpc 2010-06-29 09:17:51 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/RHBA-2010-0502.html


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