R
Railwayβ€’5mo ago
SlowSloth

ValueError: 'api.telegram.org' does not appear to be an IPv4 or IPv6 address

ValueError: 'api.telegram.org' does not appear to be an IPv4 or IPv6 address
ValueError: 'api.telegram.org' does not appear to be an IPv4 or IPv6 address
I tried to deploy a telegram bot using https://python-telegram-bot.org seems that telegram doesn;t like railway server?
python-telegram-bot
A Python framework for the Telegram Bot API
Solution:
but it's very possible that telegram is blocking you, unfortunately there's not much you can do about that without railway supporting static ip's (yet) besides deploy your code into another project and hoped you don't get the same banned shared ip
Jump to solution
15 Replies
Percy
Percyβ€’5mo ago
Project ID: 69cef118-decb-439c-b240-1b205cf11059
SlowSloth
SlowSlothβ€’5mo ago
69cef118-decb-439c-b240-1b205cf11059
Attacler/Bart
Attacler/Bartβ€’5mo ago
is the image based on Alpine? if so, you can try adding ENABLE_ALPINE_PRIVATE_NETWORKING=true to your env
SlowSloth
SlowSlothβ€’5mo ago
It's python:3.12-slim so it's FROM debian:12-slim but let me try that env btw I love you guys' work on railway πŸ‘ I get the same error
Traceback (most recent call last):

File "/usr/local/lib/python3.12/site-packages/anyio/_core/_sockets.py", line 192, in connect_tcp

addr_obj = ip_address(remote_host)

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

File "/usr/local/lib/python3.12/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
Traceback (most recent call last):

File "/usr/local/lib/python3.12/site-packages/anyio/_core/_sockets.py", line 192, in connect_tcp

addr_obj = ip_address(remote_host)

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

File "/usr/local/lib/python3.12/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
Attacler/Bart
Attacler/Bartβ€’5mo ago
then i dont know, hope Brody/Fragly have a good idea
Brody
Brodyβ€’5mo ago
I don't think api.telegram.org is a private networking domain
Solution
Brody
Brodyβ€’5mo ago
but it's very possible that telegram is blocking you, unfortunately there's not much you can do about that without railway supporting static ip's (yet) besides deploy your code into another project and hoped you don't get the same banned shared ip
SlowSloth
SlowSlothβ€’5mo ago
Yeah, there's this as well. It seems to use the same lib.
SlowSloth
SlowSlothβ€’5mo ago
No description
SlowSloth
SlowSlothβ€’5mo ago
I'm closing the issue. Thanks!
Brody
Brodyβ€’5mo ago
im talking about deploying your code into another project
SlowSloth
SlowSlothβ€’5mo ago
Yes, i get it but I'm deploying to my VM for now instead of rouletting IPs.
Brody
Brodyβ€’5mo ago
ah gotcha
SlowSloth
SlowSlothβ€’5mo ago
πŸ˜„ thanks for the support
Brody
Brodyβ€’5mo ago
happy to help!
Want results from more Discord servers?
Add your server
More Posts