3

I'm trying to debug an issue in my app and looking for suggestions or troubleshooting tips.

My app consists of a mobile app submitting data over HTTPS to apache (which is using mod_proxy to forward onto a django server). However, I've added logging at the django layer and it seems to indicate that the 400 is coming directly from Apache and not getting forwarded at all.

Also this only happens for a very small subset of POSTs. Due to the infrequency of the problem and the fact that it has been coming from phones that I don't have access to it has been difficult to reproduce and debug.

What types of things should I be looking at to troubleshoot this? I had found this post but I am already on Apache 2.2.22 so that doesn't appear to be the issue.

Because of the volume of requests I'm hesitant to add full logging to every request (though maybe I can do some conditional logging?).

Looking for suggestions on:

  • What the root problem could be. E.g. what types of problems introduce intermittent 400s like this
  • How to get more information on the server side to help diagnose, given that I can't get access to the client data.
1
  • I get a 400 error when a header (ex: Cookie) exceeds the size my apache was built for (currently in my binaries it is set to approx 8k) interesting is that I would have expected a HTTP 413 , but it returns http 400
    – user260052
    Dec 16, 2014 at 21:08

1 Answer 1

5

From RFC2616, a 400 is a Bad Request:

The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications.

So there is something about the request is causing the 400. Things you can try:

  • examine your apache error logs; you can also increase the log level from warn (default) to debug, and then examine the error logs
  • examine the tcpdump of such a request (many tutorials are available on the web) -- this might be your best option for finding the root cause.

Here is a blog post on troubleshooting 400 errors on IIS that might also be helpful.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .