question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"There was an error parsing the body" after upgrade to 1.10

See original GitHub issue

How do you use Sentry?

Sentry Saas (sentry.io)

Version

1.10

Steps to Reproduce

Hi! We have a number of Python microservices which are built on top of fastapi. We use Sentry for error reporting. THis is how we initialize the sentry integration:

            from sentry_sdk.integrations.starlette import StarletteIntegration
            from sentry_sdk.integrations.fastapi import FastApiIntegration

            sentry_sdk.init(
                dsn=dsn,
                environment=env,
                integrations=[
                    StarletteIntegration(),
                    FastApiIntegration(),
                ],
                traces_sample_rate=0,
                send_default_pii=False,
            )

sentry-sdk was updated today to 1.10 during some of our recent deployments and we started getting “400 Bad request” error for all post requests with text “There was an error parsing the body”:

curl -X 'POST' \
>   'http://127.0.0.1:8012/api/tasks/create' \
>   -H 'accept: application/json' \
>   -H 'Content-Type: application/json' \
>   -d '{
>   "environment": "production",
>   "profile": "desktop-windows-10-chrome"
> }'
{"detail":"There was an error parsing the body"}

We reverted sentry-sdk back to 1.9.10 and the error disappeared.

Expected Result

Everything works fine:)

Actual Result

400 Bad request error with text “There was an error parsing the body”

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:9
  • Comments:15 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
gitierrezcommented, Oct 26, 2022

A bug fix version was released: https://github.com/getsentry/sentry-python/releases/tag/1.10.1

Please test with the new version and tell me if it is working!

I had the same issue, upgrading to 1.10.1 fixed it - thanks @antonpirker !!

1reaction
antonpirkercommented, Oct 21, 2022

A bug fix version was released: https://github.com/getsentry/sentry-python/releases/tag/1.10.1

Please test with the new version and tell me if it is working!

Read more comments on GitHub >

github_iconTop Results From Across the Web

"There was an error parsing the body" error on requesting ...
Thus, when sending the request through Postman, you should go to Body , then choose raw , and finally, select JSON from the...
Read more >
InvalidUsage(“Failed when parsing body as json”) when trying ...
Rasa version: 1.10.11 Python version: 3.6.9 Operating system: Ubuntu 18.04 ... when I attempt to using empty json it's the same error ***....
Read more >
Fix packs for DataPower Gateway version 2018.4.1 - IBM
Lists of fixes in fix packs for IBM DataPower Gateway version 2018.4.1.
Read more >
body-parser | Yarn - Package Manager
Node.js body parsing middleware. Parse incoming request bodies in a middleware before your handlers, available under the req.body property. Note As ...
Read more >
Square Node SDK Post Requests return error 'Expected ...
Hello, I've been getting the following error since Sunday when using the Node SDK. It seems like this is only happening on requests...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found