Jump to content

Recommended Posts

Posted

Hello,

I am hosting a Telegram bot on Johnny using the Python library it has installed, and it has been working for quite a while. However, yesterday it started consistently crashing. I'm having a hard time figuring out what's wrong, since I can't find any real error messages. One thing that I noticed, however, is that if I print out the bot object when running the script on my PC, I get "Bot[token=<my API key>]", but in Heliohost I just get "Bot()", although I imagine this might not mean anything. Has anyone else had issues with this recently?

Posted

I haven't heard anything, but then people do ask for things like module installs on occasion, so the environment is subject to changing. Also, these are in the logs for your account. I'm not exactly sure what would suddenly start causing them, but suspect high load could be to blame as it is a common cause of timeouts. They seem to have started regularly occurring on Feb 4. 

Krydos would know more about this.

2024-02-11 13:46:07 Error 2001:470:1:1ee::2009   (70007)The timeout specified has expired: AH00574: ap_content_length_filter: apr_bucket_read() failed       Apache error
2024-02-11 13:46:07 Error 2001:470:1:1ee::2009   (70007)The timeout specified has expired: AH02550: Failed to flush CGI output to client       Apache error
2024-02-11 13:46:07 Error 2001:470:1:1ee::2009   7970#0: *329872 upstream timed out (110: Connection timed out) while reading upstream       nginx error
Posted

I was able to get some better logs for you. Here is what is happening:

Heliohost rules!
Bot()
wut
Traceback (most recent call last):
  File "/usr/local/python3.10/lib/python3.10/site-packages/anyio/_core/_sockets.py", line 186, in connect_tcp
    addr_obj = ip_address(remote_host)
  File "/usr/local/python3.10/lib/python3.10/ipaddress.py", line 54, in ip_address
    raise ValueError(f'{address!r} does not appear to be an IPv4 or IPv6 address')
ValueError: 'api.telegram.org' does not appear to be an IPv4 or IPv6 address

Maybe you could try connecting to 149.154.167.220 directly which is the IPv4 for api.telegram.org since it seems like it's expecting an IPv4 or IPv6 not a domain name.

Posted

Is that possible, using the python library? I took a look around at the module's source code and it seems like "api.telegram.org" is hard-coded into pretty much every request. Is this issue only happening to me? Because, if the base URL is indeed not configurable in the module, I think this would make it unusable for everyone. Is there some sort of Python version conflict or trouble with another module maybe? The bot worked for the better part of a year.

Posted

Your the only person who has mentioned a telegram bot not working anymore. Not sure if anyone else is even running a telegram bot though so who knows?

  • Krydos changed the title to [Solved] Telegram bot stopped working
  • Krydos locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...