8go / 8go/matrix-commander

The persistent listener "crashes" once every 5 minutes.

Abierto
#206 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
754
Forks
69
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

I tried using the following command to start listening to an account's messages in all joined rooms (these rooms are unencrypted), but the command only lasted a 5 minutes before crashing due to an error. If this command is automatically rerun after a crash, it will crash periodically every 5 minutes.
The app and Synapse are running in Docker, and the target account does not go through the login and authentication process in the app; instead, an access token for the account is generated from MAS and passed to the app. The credentials file uses a LAN IP address (with `http://`) pointing to the Synapse instance.

Command:
```
--debug --debug --verbose --verbose --store /data/store --credentials /data/credentials.json --listen forever --room-invites list+join
```

Error Log (I'm not sure if this entry is related to crashes):
```
nio.responses: Error validating response: 'one_time_key_counts' is a required property
```
The above information only appeared during the first run (when the database for the corresponding account is first created), at a frequency of every few seconds. It did not appear in subsequent runs.

```
DEBUG: matrix-commander: Here is the traceback.
Traceback (most recent call last):
File "/usr/local/lib64/python3.11/site-packages/aiohttp/client_reqrep.py", line 1036, in start
message, payload = await protocol.read() # type: ignore[union-attr]
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib64/python3.11/site-packages/aiohttp/streams.py", line 667, in read
await self._waiter
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/app/matrix_commander/matrix_commander.py", line 4496, in action_listen
await listen_forever(gs.client)
File "/app/matrix_commander/matrix_commander.py", line 4044, in listen_forever
await client.sync_forever(timeout=30000, full_state=True)
File "/usr/local/lib/python3.11/site-packages/nio/client/base_client.py", line 116, in wrapper
return await func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/nio/client/async_client.py", line 1388, in sync_forever
await self.run_response_callbacks([await response])
^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/asyncio/tasks.py", line 615, in _wait_for_one
return f.result() # May raise f.exception().
^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/nio/client/base_client.py", line 116, in wrapper
return await func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/nio/client/async_client.py", line 1232, in sync
response = await self._send(
^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/nio/client/async_client.py", line 834, in _send
transport_resp = await self.send(
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/nio/client/async_client.py", line 307, in wrapper
return await func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/nio/client/async_client.py", line 912, in send
return await self.client_session.request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib64/python3.11/site-packages/aiohttp/client.py", line 728, in _request
await resp.start(conn)
File "/usr/local/lib64/python3.11/site-packages/aiohttp/client_reqrep.py", line 1031, in start
with self._timer:
File "/usr/local/lib64/python3.11/site-packages/aiohttp/helpers.py", line 671, in __exit__
raise asyncio.TimeoutError from exc_val
TimeoutError
```
The above log was the last one given before the crash.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

The crash occurs in the persistent listener due to a timeout error in aiohttp during sync_forever. Start by examining the sync logic in matrix_commander.py around line 4044 and the async_client.py from nio. Look at the network configuration and timeout settings, and consider whether the issue is related to the initial 'one_time_key_counts' validation error. Reproduce the crash in a Docker environment with the provided command to see the exact timing and error pattern.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python
Área
backend-api-design, cli
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
30/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.