Skip to content

Conversation

@girum-air
Copy link
Contributor

No description provided.

girumb and others added 4 commits October 13, 2025 14:09
…y-failing-with-a-ProtocolError-when-accessed-via-the-revproxy-Django-view
…y-failing-with-a-ProtocolError-when-accessed-via-the-revproxy-Django-view
@rhunwicks
Copy link
Contributor

@girum-air I get INFO messages in my local environment that say [2025-10-14 03:03:56,774] INFO [uvicorn.error:94] ASGI 'lifespan' protocol appears unsupported.

We also have some debug messages:

[2025-10-14 03:48:56,946] DEBUG [uvicorn.error:1236] % sending keepalive ping
[2025-10-14 03:48:56,946] DEBUG [uvicorn.error:1160] > PING 'ɐ\x04\x06' [text, 4 bytes]
[2025-10-14 03:48:56,948] DEBUG [uvicorn.error:1154] < PONG 'ɐ\x04\x06' [text, 4 bytes]
[2025-10-14 03:48:56,948] DEBUG [uvicorn.error:1247] % received keepalive pong

And some very freqyent info messages:

[14/Oct/2025 03:48:57] INFO [revproxy.view:78] ProxyView created
[14/Oct/2025 03:48:57] INFO [revproxy.response:54] Normalizing response headers
[14/Oct/2025 03:48:57] INFO [revproxy.response:58] Checking for invalid cookies

And some possible problem views:

[14/Oct/2025 03:48:58] INFO [revproxy.response:44] Starting streaming HTTP Response, buffering amount="65536 bytes"
[14/Oct/2025 03:48:58] INFO [revproxy.response:54] Normalizing response headers
[14/Oct/2025 03:48:58] INFO [revproxy.response:58] Checking for invalid cookies

/usr/local/lib/python3.12/site-packages/django/core/handlers/asgi.py:332: Warning: StreamingHttpResponse must consume synchronous iterators in order to serve them asynchronously. Use an asynchronous iterator instead.

and

[14/Oct/2025 03:48:59] WARNING [urllib3.connectionpool:327] Connection pool is full, discarding connection: dagster_webserver. Connection pool size: 1

…ith-a-ProtocolError-when-accessed-via-the-revproxy-Django-view' of github.com-work2:FEWS-NET/HEA-Database-Development into HEA-752/Dagster-GraphQL-API-is-intermittently-failing-with-a-ProtocolError-when-accessed-via-the-revproxy-Django-view
@girum-air girum-air requested a review from rhunwicks October 14, 2025 08:40
@girum-air girum-air self-assigned this Oct 14, 2025
@girum-air
Copy link
Contributor Author

@rhunwicks I think the first two issues are just more info logs by the web socket and revproxy view, we can supress them. The connection pool filling issue seem requiring us increasing the max pool size. But the 3rd warning realted to the StreamingHttpResponse, I think require an aync support by the view which seems a more involved change I couldn't get to make it work, but can we ignore that for now as it is warning only?

name = "common"
verbose_name = _("common")

def ready(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems very non-standard.

My reading around this is that it's not an error, even if we would get better performance if we increased the pool max_size.

Do we know if the message is caused by the regular proxy or by the websockets one?

I am tempted to suppress the log message, but otherwise leave it all alone for now. Perhaps we start a new MR based on the original one, but without these commits.

"urllib3": {"handlers": ["console", "logfile"], "level": "INFO", "propagate": False},
"common.models": {"handlers": ["console", "logfile"], "level": "INFO", "propagate": False},
"common.signals": {"handlers": ["console", "logfile"], "level": "INFO", "propagate": False},
"uvicorn.error": {"handlers": ["console"], "level": "WARNING", "propagate": False},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure that we want to lose all INFO messages. Just the overly chatty ones.

Would this be better using a custom logging filter to suppress specific messages?

We need to be certain that the logger is still capturing regular new page requests.

@rhunwicks
Copy link
Contributor

I agree we can ignore the StreamingRequest for now.

…y-failing-with-a-ProtocolError-when-accessed-via-the-revproxy-Django-view
@rhunwicks
Copy link
Contributor

@girum-air how can we tell from the Chrome DevTools that the GraphQL query is using a websocket rather than a regular request?

Do we have debug logging in our consumer or elsewhere that lets us see what code is coming via channels vs a regular http request?

Is there a setting in Dagster that controls whether it uses websockets or http polling for the GraphQL queries?

@girum-air
Copy link
Contributor Author

girum-air commented Oct 15, 2025

@girum-air how can we tell from the Chrome DevTools that the GraphQL query is using a websocket rather than a regular request?

Yes @rhunwicks under Socket we can see the graphql name for a ws request - ws://localhost:8000/pipelines/graphql

Do we have debug logging in our consumer or elsewhere that lets us see what code is coming via channels vs a regular http request?

Yes, we have in the Consumer class, when connection happens e.g.:

[15/Oct/2025 21:54:29] INFO [common.consumers:16] WebSocket connection attempt: /pipelines/graphql
app-1                | [15/Oct/2025 21:54:29] INFO [common.consumers:27] User gbizuayehu authenticated
app-1                | [15/Oct/2025 21:54:29] INFO [common.consumers:53] Connecting to upstream: ws://dagster_webserver:3000/pipelines/graphql
app-1                | [15/Oct/2025 21:54:29] INFO [common.consumers:65] Connected to upstream
app-1                | [15/Oct/2025 21:54:29] INFO [uvicorn.error:273] 192.168.65.1:63995 - "WebSocket /pipelines/graphql" [accepted]

Is there a setting in Dagster that controls whether it uses websockets or http polling for the GraphQL queries?

Yes there is, Disable WebSockets in the setting but doesn't seem to work reliablty, it is also still an experimental feature.

…y-failing-with-a-ProtocolError-when-accessed-via-the-revproxy-Django-view
air-github-actions-user pushed a commit that referenced this pull request Oct 30, 2025
…/Dagster-GraphQL-API-is-intermittently-failing-with-a-ProtocolError-when-accessed-via-the-revproxy-Django-view

Hea 752/dagster graph ql api is intermittently failing with a protocol error when accessed via the revproxy django view
@air-github-actions-user air-github-actions-user merged commit 0e74c37 into main Oct 30, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants