Description
I have an Android app that sends data files every minute to databus. Every once in a while I get back an http error 400 (bad request). However when I try to send this file again either through the same code or via curl, it uploads fine.
When I looked at the databus log file for the time period of the error I see
WARN: There was a problem parsing the JSON request.
org.codehaus.jackson.JsonParseException: Unexpected end-of-input: expected close marker for ARRAY (from [Source: java.io.StringReader@898e150; line: 1, column: 1])
at [Source: java.io.StringReader@898e150; line: 1, column: 24607]
at org.codehaus.jackson.JsonParser._constructError(JsonParser.java:1433) ~[jackson-core-asl-1.9.8.jar:1.9.8]
But the file is valid json (I ran it through jsonlint and it also sends correctly the 2nd time). Given that databus is reporting the error on the first character, and this is a 26K file, my guess is that the problem is really some kind of temporary network connection issue and it is not actually getting the complete file, or not getting any file in the http POST, but the databus code is not catching that at a higher level and is sending bad or empty data to the parser, which generates the 400 error.
The problem is that then I can't detect the difference between a legitimately bad file and a temporary connection error, in which case I want to retry sending the file.