Quart ASGI treated as ASGI2 when it should be treated as ASGI3
See original GitHub issueEnvironment
How do you use Sentry? Sentry SaaS (sentry.io)
Which SDK and version? sentry-sdk 1.1.0 (pypi)
Steps to Reproduce
Using the Quart framework, and the ASGI integration provided in the SDK (docs), as well as following the Quart middleware documentation, quart_app.asgi_app
is treated as an ASGI 2 app while it should be treated as an ASGI 3 app.
Expected Result
The SDK should work, providing request context for errors.
Actual Result
It seems like integrations/asgi.py#L53 is causing quart_app.asgi_app
to report as an ASGI 2 application, erroring out with _run_asgi2() takes 2 positional arguments but 4 were given
.
Additionally, creating a new variable based on quart_app
, instead of quart_app.asgi_app
(sentry_app = SentryAsgiMiddleware(quart_app
) and serving that seems to work.
Quoting @pgjones from the Quart Gitter
Ideally it should work with the
app.asgi_app
, which I think (if it works withapp
) is the crucial part to put in the bug report to sentry
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:10 (7 by maintainers)
Top GitHub Comments
I think this is still a sentry bug, however Sentry now ships a Quart integration which doesn’t trigger this bug.
I’m 100% sure I found that somewhere on the internet so don’t credit me for that 😛