What's the cause of ModSecurity's 'Error reading request body'


I see this error in my logs sometimes. I’ve tried to figure out what’s causing it, but I can’t find a definitive answer. Some people just say ignore it because it’s a client-side problem. Does anyone have any other insights?

[Sun Dec 25 05:13:05 2011] [error] [client] ModSecurity: Error reading request body: End of file found [hostname "example.com"] [uri "/ajax/Session.dispatch.json"] [unique_id "TvchXUt33DMAAG0fX7kAAAAH"]


Just FYI in case someone has this error. In my case, it seems to be that Internet Explorer (mostly) will occasionally post an Ajax call and not send the parameterised data. It sends the headers and keeps the connection open until it times out, thus making an incomplete request. Forcing the connection to close from the server seems to help, but may have an impact on performance, although this shouldn’t apply in my case as it only happens during Ajax requests where the delay between requests would normally be longer than the keep-alive interval. I’ve roughly followed the idea suggested here.

Hopefully the errors will go away now!