Aaron Taylor
02/19/2025, 8:36 AMPREFECT_DEBUG_MODE=1
):
00:29:29.713 | WARNING | prefect.events.clients - Unable to connect to '<ws://127.0.0.1:4200/api/events/in>'. Please check your network settings to ensure websocket connections to the API are allowed. Otherwise event data (including task run data) may be lost. Reason: connect() received a ssl argument for a ws:// URI, use a wss:// URI to enable TLS. Set PREFECT_DEBUG_MODE=1 to see the full error.
Traceback (most recent call last):
File ".venv/lib/python3.12/site-packages/prefect/events/clients.py", line 375, in _reconnect
self._websocket = await self._connect.__aenter__()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".venv/lib/python3.12/site-packages/websockets/legacy/client.py", line 635, in __aenter__
return await self
^^^^^^^^^^
File ".venv/lib/python3.12/site-packages/prefect/events/clients.py", line 141, in _proxy_connect
super().__init__(self.uri, **self._kwargs)
File ".venv/lib/python3.12/site-packages/websockets/legacy/client.py", line 480, in __init__
raise ValueError(
ValueError: connect() received a ssl argument for a ws:// URI, use a wss:// URI to enable TLS
Any idea what might be causing this and what we could do to resolve it?Aaron Taylor
02/19/2025, 8:38 AMIn [1]: import prefect.events.clients
In [2]: c = prefect.events.clients.PrefectEventsClient(api_url='<http://127.0.0.1:4200/api>')
In [3]: await c._reconnect()
In [4]: pong = await c._websocket.ping()
In [5]: await pong
Out[5]: 4.019266250019427
In [6]: c._events_socket_url
Out[6]: '<ws://127.0.0.1:4200/api/events/in>'
Aaron Taylor
02/19/2025, 11:44 PMPREFECT_API_TLS_INSECURE_SKIP_VERIFY
which we had used in development config. Removing that variable resolves this issue!