You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After a random amount of time, we are disconnected from steam silently
Reproduction Steps
Write a long running python script, let it run for a few days, then notice that:
incoming events do not come through anymore
trying to send a message raise an error
Expected Results
When the connection is lost, steam.py should try to reconnect or at least raise a "DisconnectEvent" of some sort.
Actual Results
The connection is silently lost. Trying to send a message yields
Traceback (most recent call last):
File "/venv/lib/python3.11/site-packages/steam/gateway.py", line 778, in send
await self.socket.send_bytes(data)
File "/venv/lib/python3.11/site-packages/aiohttp/client_ws.py", line 170, in send_bytes
await self._writer.send(data, binary=True, compress=compress)
File "/venv/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 727, in send
await self._send_frame(message, WSMsgType.BINARY, compress)
File "/venv/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 628, in _send_frame
raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/venv/lib/python3.11/site-packages/slidge/core/gateway/session_dispatcher.py", line 784, in wrapped
await cb(stanza)
File "/venv/lib/python3.11/site-packages/slidge/core/gateway/session_dispatcher.py", line 383, in on_chatstate_composing
await session.on_composing(entity, thread)
File "/venv/lib/python3.11/site-packages/legacy_module/session.py", line 47, in on_composing
await user.trigger_typing()
File "/venv/lib/python3.11/site-packages/steam/user.py", line 316, in trigger_typing
await self._state.send_user_typing(self.id64)
File "/venv/lib/python3.11/site-packages/steam/state.py", line 527, in send_user_typing
msg: friend_messages.SendMessageResponse = await self.ws.send_um_and_wait(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/venv/lib/python3.11/site-packages/steam/gateway.py", line 832, in send_um_and_wait
await self.send_proto(um)
File "/venv/lib/python3.11/site-packages/steam/gateway.py", line 786, in send_proto
await self.send(bytes(message))
File "/venv/lib/python3.11/site-packages/steam/gateway.py", line 780, in send
await self._state.handle_close()
File "/venv/lib/python3.11/site-packages/steam/state.py", line 2979, in handle_close
raise ConnectionClosed(self.ws.cm)
steam.gateway.ConnectionClosed: Connection to ext2-par1.steamserver.net:27019, has closed.
INFO:steam.state:Websocket closed, cannot reconnect.
I posted some longer logs in #207 (comment) but I think it was in the thread of a different issue?
Summary
After a random amount of time, we are disconnected from steam silently
Reproduction Steps
Write a long running python script, let it run for a few days, then notice that:
Expected Results
When the connection is lost, steam.py should try to reconnect or at least raise a "DisconnectEvent" of some sort.
Actual Results
The connection is silently lost. Trying to send a message yields
I posted some longer logs in #207 (comment) but I think it was in the thread of a different issue?
System Information
python version: 3.11.9
steam.py version: 1.0.1
aiohttp version: 3.9.5
betterproto version: 2.0.0b6
operating system info: Linux-6.1.0-18-cloud-amd64-x86_64-with-glibc2.36
Checklist
The text was updated successfully, but these errors were encountered: