I have a wierd 504 error occuring in Apache + mod_wsgi when I post a specific SVG string. The backend application is Python Flask, but it does not seem to get to the application at all.

Here is one request that returns a 504 error:

curl 'https://some.domain.com/api/export/png' --data 'svg=%22%3E%28style' 

And here is another one that returns with 200:

curl 'https://some.domain.com/api/export/png' --data 'svg=%22%3E%28styl' 

The difrrerence is that I only removed one character from the POST data

The SVG data is cut down to the smallest one that could produce an error. The original SVG string is much larger.

The error that appears in the apache error log is:

[Tue Jun 09 14:27:26 2015] [error] [client] (104)Connection  reset by peer: mod_wsgi (pid=19254): Unable to get bucket brigade for request., referer: https://some.domain.com/
[Tue Jun 09 14:27:26 2015] [error] [client] mod_wsgi (pid=19252): Exception occurred processing WSGI script '/var/www/ade/src/interface.wsgi'.
[Tue Jun 09 14:27:26 2015] [error] [client] IOError: failed to write data

I it is interestig that the the error appears in the error log imidietly after I make the request, before the post data upload finishes.

Here are the version numbers we have:

Apache/2.2.22 (Ubuntu) 

Any clues what might be causing this?


Look in your httpd.conf file and increase the Timeout value.

Timeout 600

Save the file and restart apache.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.