Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API error: Invalid format. data.request.POST string value found, but a object is required. #197

Closed
BrianPainter opened this issue Sep 21, 2017 · 9 comments

Comments

@BrianPainter
Copy link

Getting this error on the rollbar side whenever an error is generated in my Django app. Have successfully sent a test error, and a couple of the errors do come through, but a majority of them give the error in the title. Installed with the middleware per the instructions on Django 1.9.13. Let me know what other information would be useful in debugging this.

@rokob
Copy link
Contributor

rokob commented Sep 22, 2017

The only way I can see how this could be possible looking at the way the post data is set is that if something goes wrong in one of the transforms, probably the SerializableTransform, which results in some sort of fail-safe stringification of the dictionary. This is because data.request.POST is always set as dict(some_object) so it should end up as a JSON object.

Let me look into the transforms to see where they could break down.

@BrianPainter
Copy link
Author

From what I can tell, it happens during the ShortenerTransform.

@lukas-gitl
Copy link

We have the same issue and my co-worker will provide more details shortly. This appears to be a recent regression.

@MacMcIrish
Copy link

What we've seen is that passing a dict with greater than 10 keys in the request.POST data, the 11th key and forward are truncated with a ... but the entire string is wrapped in { }.

rollbar.report_message(
    'message', payload_data={
        "request": {
            "POST": {i: i for i in range(11)}
        }
    }
)

Fails whereas

rollbar.report_message(
    'message', payload_data={
        "request": {
            "POST": {i: i for i in range(10)}
        }
    }
)

Succeeds.
Rolling back to rollbar==0.13.12 fixes the issue.

@rokob
Copy link
Contributor

rokob commented Sep 27, 2017

I am very strongly suspecting #176

@ezarowny
Copy link
Contributor

ezarowny commented Oct 3, 2017

@rokob hmm, maybe? I don't think I changed anything involving mapping types though. The only real interesting line in that PR is https://github.com/rollbar/pyrollbar/pull/176/files#diff-6022e85ab93e5271b24f7f04696aa09aR58

@rokob
Copy link
Contributor

rokob commented Oct 3, 2017

@lukas-gitl
Copy link

@ezarowny If the issue was present before, then this line certainly "activated" it for us: https://github.com/rollbar/pyrollbar/pull/176/files#diff-1fcbac3a897889dbaf8984fdfe14c99cR316

@ezarowny
Copy link
Contributor

ezarowny commented Oct 4, 2017

Yeah, it's likely that your dict objects just weren't getting shortened in the old version. Good find guys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants