"There was an error parsing the body" after upgrade to 1.10
See original GitHub issueHow 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:
- Created a year ago
- Reactions:9
- Comments:15 (9 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had the same issue, upgrading to 1.10.1 fixed it - thanks @antonpirker !!
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!