8000 postdataV1 api returns http error 400 on a valid data file · Issue #31 · deanhiller/databus · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
postdataV1 api returns http error 400 on a valid data file #31
Open
@kbrems

Description

@kbrems

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0