https://dagster.io/ logo
#ask-community
Title
# ask-community
k

Kim Henriksen

03/23/2022, 5:35 PM
I have tried to setup Dagit behind a proxy, but havn't been successful, I managed to get Dagit running behind my proxy, and even websockets seems to work, except for one detail, when I close my browser, refresh or change page, an exceptions occurs. Does anyone have a complete working Nginx example I can follow? My current Nginx config looks something like this:
Copy code
map $http_upgrade $proxy_connection_upgrade {
    default Upgrade;
    ''      close;
}

location /dagit {
	include snippets/dagit.conf;
}


snippets/dagit.conf:

proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $proxy_connection_upgrade;
proxy_http_version 1.1;
proxy_pass <http://localhost:3000>;
This is the exception I see:
Copy code
dagit      | Traceback (most recent call last):
dagit      |   File "/opt/dagster/lib/python3.7/site-packages/dagit/graphql.py", line 249, in _handle_async_results
dagit      |     operation_id,
dagit      |   File "/opt/dagster/lib/python3.7/site-packages/dagit/graphql.py", line 270, in _send_message
dagit      |     return await websocket.send_json(data)
dagit      |   File "/opt/dagster/lib/python3.7/site-packages/starlette/websockets.py", line 173, in send_json
dagit      |     await self.send({"type": "websocket.send", "text": text})
dagit      |   File "/opt/dagster/lib/python3.7/site-packages/starlette/websockets.py", line 85, in send
dagit      |     await self._send(message)
dagit      |   File "/opt/dagster/lib/python3.7/site-packages/uvicorn/protocols/websockets/websockets_impl.py", line 269, in asgi_send
dagit      |     raise RuntimeError(msg % message_type)
dagit      | RuntimeError: Unexpected ASGI message 'websocket.send', after sending 'websocket.close'.
dagit      | Task exception was never retrieved
dagit      | future: <Task finished coro=<_handle_async_results() done, defined at /opt/dagster/lib/python3.7/site-packages/dagit/graphql.py:232> exception=RuntimeError("Unexpected ASGI message 'websocket.send', after sending 'websocket.close'.")>
dagit      | Traceback (most recent call last):
dagit      |   File "/opt/dagster/lib/python3.7/site-packages/dagit/graphql.py", line 234, in _handle_async_results
dagit      |     async for result in results:
dagit      |   File "/opt/dagster/lib/python3.7/site-packages/dagit/graphql.py", line 289, in async_gen
dagit      |     i = await queue.get()
dagit      |   File "/usr/local/lib/python3.7/asyncio/queues.py", line 159, in get
dagit      |     await getter
dagit      | concurrent.futures._base.CancelledError
dagit      | 
dagit      | During handling of the above exception, another exception occurred:
dagit      | 
dagit      | Traceback (most recent call last):
dagit      |   File "/opt/dagster/lib/python3.7/site-packages/dagit/graphql.py", line 249, in _handle_async_results
dagit      |     operation_id,
dagit      |   File "/opt/dagster/lib/python3.7/site-packages/dagit/graphql.py", line 270, in _send_message
dagit      |     return await websocket.send_json(data)
dagit      |   File "/opt/dagster/lib/python3.7/site-packages/starlette/websockets.py", line 173, in send_json
dagit      |     await self.send({"type": "websocket.send", "text": text})
dagit      |   File "/opt/dagster/lib/python3.7/site-packages/starlette/websockets.py", line 85, in send
dagit      |     await self._send(message)
dagit      |   File "/opt/dagster/lib/python3.7/site-packages/uvicorn/protocols/websockets/websockets_impl.py", line 269, in asgi_send
dagit      |     raise RuntimeError(msg % message_type)
dagit      | RuntimeError: Unexpected ASGI message 'websocket.send', after sending 'websocket.close'.
13 Views