Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection to steam silently lost #570

Open
3 tasks done
truenicoco opened this issue Jun 1, 2024 · 0 comments
Open
3 tasks done

Connection to steam silently lost #570

truenicoco opened this issue Jun 1, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@truenicoco
Copy link

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:

  • 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?

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

  • I have searched the issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my username, password, shared/identity secrets and refresh/access tokens from display, if visible.
@truenicoco truenicoco added the bug Something isn't working label Jun 1, 2024
Gobot1234 added a commit that referenced this issue Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant