Issue #1211
closedImporting from forge is broken with python-requests 2.7.0-1.fc22
Description
Pulp carries an older version of python-requests than is available on F22 in base repositories. Pulp carries python-requests-2.4.3-1 but @System on F22 provides python-requests-2.7.0-1.fc22
When python-requests fetches the metadata from forge it is failing to decompress the gzip response from the server which causes json to fail since its processing gzip data instead of plaintext. Here is the TCP stream information as captured from wireshark during a request with python-requests-2.7.0.
GET /modules.json?q=torssh HTTP/1.1
Host: forge.puppetlabs.com
Connection: keep-alive
Accept-Encoding: gzip, deflate
Accept: */*
User-Agent: python-requests/2.7.0 CPython/2.7.10 Linux/4.1.5-200.fc22.x86_64
HTTP/1.1 200 OK
Server: nginx
Date: Fri, 21 Aug 2015 20:07:13 GMT
Content-Type: application/json;charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Status: 200 OK
Cache-Control: private, must-revalidate, max-age=0
X-Node: forge-app02-prod
X-Revision: ff29653
X-Content-Type-Options: nosniff
Vary: Accept-Encoding
Content-Encoding: gzip
b9
.......U..d.A..0.E.Bf...=.q...R....6....ww........o.P.LH ...srP.5;.{5.......r..|.8r>...h.s..d
...)..H.K+..E.BL|..j....c.Q.a.&..B. ...:.
.
uu.jX....@j..E...4X..n.mLR...[.'.......[>~)....
0
Downgrading python-requests to Pulp's 2.4.3-1 causes the response to be decoded as normal plaintext.
Updated by bmbouter over 9 years ago
I've confirmed that the downgraded library is also requesting using gzip as the content-type and the data sent over the wire is gzip encoded. This means the newer version is failing to decompress the data, and not that the data is being sent with plaintext in the newer python-requests.
python-requests is supposed to automatically decompress gzip encoded data according to its docs.
This is probably also broken in F21 since that same 2.7.0-1 is published there. See this page for info for which versions are on which distributions.
Updated by bmbouter over 9 years ago
- Status changed from NEW to CLOSED - NOTABUG
- Triaged changed from No to Yes
This was due to a broken python-urllib3 package after I upgraded to f22. I've gotten the correct packages installed on gzip decompression is working again.