sentry-python: "There was an error parsing the body" after upgrade to 1.10
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”
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 9
- Comments: 15 (9 by maintainers)
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!
Had a symilar issue after the upgrade, on an application using fastapi:
Fixing to previous version resolved the issue.