Hello fellow UWSGI supporters,

I'm struggling with an issue in my PHP software (namely Pimcore).

The PHP stuff is served through an Haproxy -> Nginx -> UWSGI stack that
runs without a hitch since 18 months.

A few days ago, after a Pimcore software update to version 2.3.0, users
reported corrupted file downloads, and I noticed something weird with
Content-Length.  Let me illustrate the problem with an example from the
logs.

>From uwsgi logs:

[pid: 15215|app: -1|req: -1/15] 127.0.0.1 () {32 vars in 567 bytes} [Mon
Dec  8 14:58:50 2014] GET
/admin/asset/get-image-thumbnail/id/8280/treepreview/true_dc=1418043520956/download/true
=> generated *13950* bytes in 4364 msecs (HTTP/1.1 200) 8 headers in 256
bytes (0 switches on core 0)

>From nginx logs:

127.0.0.1 - - [08/Dec/2014:14:58:54 +0100] "GET
/admin/asset/get-image-thumbnail/id/8280/treepreview/true_dc=1418043520956/download/true
HTTP/1.1" 200 *12032* "-" "curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0
OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3"

As you can see there is a discrepancy between the response length reported
by uwsgi, and the one from nginx.  It should be the same.

The output of curl is also surprising:

$ curl -i -b pimcore_admin_sid=something
http://localhost/admin/asset/get-image-thumbnail/id/8280/treepreview/true_dc=1418043520956/download/true
HTTP/1.1 200 OK
Server: nginx/1.1.19
Date: Mon, 08 Dec 2014 13:58:54 GMT
Content-Type: image/pjpeg

*Content-Length: 2*Connection: keep-alive
Content-Disposition: attachment; filename="320.336g-1.pjpeg"
Cache-Control: public, max-age=300
Expires: Mon, 08 Dec 2014 15:03:54 +0100
Pragma:
X-Powered-By: pimcore


As you can see the reported Content-Length this time is 2 bytes!  And
please notice there are two blank lines in the response.

How is it possible that the Content-Length is different in three places?

I couldn't find a way to make this problem 100% reproducible, so this is
particularly difficult to resolve.

Your help would be appreciated to narrow down what is causing this.

UWSGI config file: https://gist.github.com/jbq/6840da7bb0e5de1fff85
Nginx config file: https://gist.github.com/jbq/76ebfd526f2ba8b60166

Best regards,
-- 
Jean-Baptiste Quenot
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to