CTalvio / lemmytrixposter

Matrix/Lemmy bot to aid sharing art in posts and automating posting.
MIT License
3 stars 0 forks source link

App crashes on its own after idling for a while #1

Open AndrewHack242 opened 6 months ago

AndrewHack242 commented 6 months ago

It crashes and spits this out:

Traceback (most recent call last):
  File "/home/ahack/programming/lemmytrixposter/lemmytrixposter.py", line 946, in <module>
    matrix.run()
  File "/home/ahack/programming/lemmytrixposter/venv/lib/python3.10/site-packages/simplematrixbotlib/bot.py", line 96, in run
    asyncio.run(self.main())
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/home/ahack/programming/lemmytrixposter/venv/lib/python3.10/site-packages/simplematrixbotlib/bot.py", line 89, in main
    await self.async_client.sync_forever(timeout=3000, full_state=True)
  File "/home/ahack/programming/lemmytrixposter/venv/lib/python3.10/site-packages/nio/client/base_client.py", line 105, in wrapper
    return await func(self, *args, **kwargs)
  File "/home/ahack/programming/lemmytrixposter/venv/lib/python3.10/site-packages/nio/client/async_client.py", line 1330, in sync_forever
    await self.run_response_callbacks([await response])
  File "/usr/lib/python3.10/asyncio/tasks.py", line 571, in _wait_for_one
    return f.result()  # May raise f.exception().
  File "/home/ahack/programming/lemmytrixposter/venv/lib/python3.10/site-packages/nio/client/base_client.py", line 105, in wrapper
    return await func(self, *args, **kwargs)
  File "/home/ahack/programming/lemmytrixposter/venv/lib/python3.10/site-packages/nio/client/async_client.py", line 1173, in sync
    response = await self._send(
  File "/home/ahack/programming/lemmytrixposter/venv/lib/python3.10/site-packages/nio/client/async_client.py", line 777, in _send
    transport_resp = await self.send(
  File "/home/ahack/programming/lemmytrixposter/venv/lib/python3.10/site-packages/nio/client/async_client.py", line 291, in wrapper
    return await func(self, *args, **kwargs)
  File "/home/ahack/programming/lemmytrixposter/venv/lib/python3.10/site-packages/nio/client/async_client.py", line 855, in send
    return await self.client_session.request(
  File "/home/ahack/programming/lemmytrixposter/venv/lib/python3.10/site-packages/aiohttp/client.py", line 608, in _request
    await resp.start(conn)
  File "/home/ahack/programming/lemmytrixposter/venv/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 971, in start
    with self._timer:
  File "/home/ahack/programming/lemmytrixposter/venv/lib/python3.10/site-packages/aiohttp/helpers.py", line 735, in __exit__
    raise asyncio.TimeoutError from None
asyncio.exceptions.TimeoutError
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7f51dda44790>

I'm not very good with python, so I'm not too sure where to start with this, but it is currently preventing me from keeping the bot running at all times.

CTalvio commented 6 months ago

Reading the traceback, the problem looks to be with simplematrixbotlib library, rather than lemmytrixposter.

Edit: are you running the python script or one of the compiled executables?

AndrewHack242 commented 6 months ago

I've gotten problems with both. I first was running the linux executable, but I then switched to the python script to try to dig into it. I gave up when it started to look like it might be an issue coming from one of the underlying libraries

CTalvio commented 6 months ago

welp, I haven't had issues

I've made changes since the last release, I should put out and update anyway, maybe whatever this is is something my current version doesn't suffer from.