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

Bot dies #31

Open
sgofferj opened this issue Jul 9, 2023 · 2 comments
Open

Bot dies #31

sgofferj opened this issue Jul 9, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@sgofferj
Copy link

sgofferj commented Jul 9, 2023

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
Copy link
Owner

moan0s commented Jul 24, 2023

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

@moan0s moan0s added the bug Something isn't working label Jul 24, 2023
@sgofferj
Copy link
Author

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

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

2 participants