ehForwarderBot / efb-telegram-master

EFB Telegram Master Channel, a channel for EH Forwarder Bot.
GNU Affero General Public License v3.0
223 stars 78 forks source link

[BUG] efb-wizard connection error when asking for token #91

Closed aisuneko closed 4 years ago

aisuneko commented 4 years ago

Describe the bug
A clear and concise description of what the bug is. "Connection refused" when asking to input token.

To Reproduce
Steps to reproduce the behavior: Go through efb-wizard.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Version information (please complete the following information):

EH Forwarder Bot Version: 2.0.0b25 Python Version: 3.7.5 (default, Nov 1 2019, 02:16:32) [Clang 11.0.0 (clang-1100.0.33.8)]

Master: Telegram Master (blueset.telegram) 2.0.0b38

Slave: WeChat Slave (blueset.wechat) 2.0.0a37

Middleware: GnuPG Middleware (blueset.gpg) 1.0.1.post1

Additional context
Add any other context about the problem here.

urllib3 HTTPError HTTPSConnectionPool(host='api.telegram.org',
port=443): Max retries exceeded with url:
/bot1045277308:AAFE86tiOxMoisNqfRRtTiQdyYDr83Mz3Mg/getMe (Caused by Ne
wConnectionError('<telegram.vendor.ptb_urllib3.urllib3.connection.Veri
fiedHTTPSConnection object at 0x10e8bc390>: Failed to establish a new
connection: [Errno 61] Connection refused'))
blueset commented 4 years ago

Please make sure that you can connect to the Telegram Bot API (https://api.telegram.org) on your server.

aisuneko commented 4 years ago

@blueset I COULD connect to the bot API. (ping works, at least, for the non-https domain.) However, under a working proxy the error still occurs.

$ ping api.telegram.org
PING api.telegram.org (149.154.167.220): 56 data bytes
64 bytes from 149.154.167.220: icmp_seq=0 ttl=52 time=379.456 ms
64 bytes from 149.154.167.220: icmp_seq=1 ttl=52 time=290.878 ms
64 bytes from 149.154.167.220: icmp_seq=2 ttl=52 time=290.661 ms
^C
--- api.telegram.org ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 290.661/320.332/379.456/41.807 ms

$ ping https://api.telegram.org
PING https://api.telegram.org (75.126.150.210): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
^C
--- https://api.telegram.org ping statistics ---
3 packets transmitted, 0 packets received, 100.0% packet loss
blueset commented 4 years ago

First of all, ping only ensures that you can receive ICMP responses from the server specified, it does not check any HTTP or rather TCP connections.

Your first ping seems has resolved the server to the correct IP, so there is no problem about DNS by far.

Please check if you can query Telegram Bot API by running the following command:

curl -i https://api.telegram.org/bot1045277308:AAFE86tiOxMoisNqfRRtTiQdyYDr83Mz3Mg/getMe

If that has returned the proper response, please run efb-wizard, as well as ehforwarderbot after you finish the configuration, in the exact same settings, that includes same network connection, same environment variables, behind same proxy (if any) and so on.

I have tested just now on my local machine, that ETM setup wizard is doing its job properly on detecting connectivity to Telegram server.