moan0s / matrix-registration-bot

A bot that is used to create and manage registration tokens for a matrix server
GNU Affero General Public License v3.0
62 stars 10 forks source link

Bot dies #31

Open sgofferj opened 1 year ago

sgofferj commented 1 year ago

Version: docker Compose:

version: "3.8"
services:
  regbot:
    image: moanos/matrix-registration-bot:latest
    environment:
      LOGGING_LEVEL: DEBUG
      BOT_SERVER: "https://matrix.gofferje.net"
      BOT_USERNAME: "botname"
      BOT_PASSWORD: "<removed>"
      API_BASE_URL: 'https://matrix.gofferje.net'
      API_TOKEN: "<removed>"

networks:
  default:
    external:
      name: web_services

Log:

2023-07-08 09:34:29,317 DEBUG:('SELECT "t1"."id", "t1"."account", "t1"."user_id", "t1"."device_id", "t1"."shared" FROM "accounts" AS "t1" WHERE (("t1"."user_id" = ?) AND ("t1"."device_id" = ?)) LIMIT ? OFFSET ?', ['@botname:gofferje.net', '<removed>', 1, 0])

Traceback (most recent call last):

  File "/opt/venv/bin/matrix-registration-bot", line 8, in <module>

    sys.exit(run_bot())

Connected to https://matrix.gofferje.net as @botname:gofferje.net (<removed>)

This bot's public fingerprint ("Session key") for one-sided verification is: 5M37 ptwg QhYk IDAc Pigu kybM LWDO i723 DHtQ skXT 5cM

             ^^^^^^^^^

  File "/opt/venv/lib/python3.11/site-packages/matrix_registration_bot/bot.py", line 201, in run_bot

    bot.run()

  File "/opt/venv/lib/python3.11/site-packages/simplematrixbotlib/bot.py", line 88, in run

    asyncio.run(self.main())

  File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run

    return runner.run(main)

           ^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run

    return self._loop.run_until_complete(task)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete

    return future.result()

           ^^^^^^^^^^^^^^^

  File "/opt/venv/lib/python3.11/site-packages/simplematrixbotlib/bot.py", line 81, in main

    await self.async_client.sync_forever(timeout=3000, full_state=True)

  File "/opt/venv/lib/python3.11/site-packages/nio/client/base_client.py", line 111, in wrapper

    return await func(self, *args, **kwargs)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/opt/venv/lib/python3.11/site-packages/nio/client/async_client.py", line 1232, in sync_forever

    await self.run_response_callbacks([await response])

                                       ^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/asyncio/tasks.py", line 605, in _wait_for_one

    return f.result()  # May raise f.exception().

           ^^^^^^^^^^

  File "/opt/venv/lib/python3.11/site-packages/nio/client/base_client.py", line 111, in wrapper

    return await func(self, *args, **kwargs)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/opt/venv/lib/python3.11/site-packages/nio/client/async_client.py", line 1074, in sync

    response = await self._send(

               ^^^^^^^^^^^^^^^^^

  File "/opt/venv/lib/python3.11/site-packages/nio/client/async_client.py", line 778, in _send

    transport_resp = await self.send(

                     ^^^^^^^^^^^^^^^^

  File "/opt/venv/lib/python3.11/site-packages/nio/client/async_client.py", line 303, in wrapper

    return await func(self, *args, **kwargs)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/opt/venv/lib/python3.11/site-packages/nio/client/async_client.py", line 850, in send

    return await self.client_session.request(

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/opt/venv/lib/python3.11/site-packages/aiohttp/client.py", line 560, in _request

    await resp.start(conn)

  File "/opt/venv/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 894, in start

    with self._timer:

  File "/opt/venv/lib/python3.11/site-packages/aiohttp/helpers.py", line 721, in __exit__

    raise asyncio.TimeoutError from None
moan0s commented 1 year ago

Hi, sorry for the late response. Could there be any reason for the bot to loose the connection after some time?

sgofferj commented 1 year ago

Shouldn't be. At least in the logs of my NodeRED matrix bot I don't see any disconnects which would coincide.