Skip to content

Quart ASGI treated as ASGI2 when it should be treated as ASGI3 #1135

@gtsatsis

Description

@gtsatsis

Environment

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 with app) is the crucial part to put in the bug report to sentry

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions