-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Timeout on TelegramClient.connect() #172
Comments
I must say this issue was nicely written out, haha, a pleasure to read. Are you using Windows? I only have a Linux machine to test it on, and I know most people having trouble connecting use Windows. It seems to be the same issue as #61. I wonder if changing the socket to blocking would solve the problem, or using the socket's timeout (which I don't use because I need to be able to These are the changes between the two versions. After reviewing every change introduced, I couldn't find anything that modified the Does it work if you downgrade to |
Haha good to hear! I'm using OSX (Sierra 10.12.5). I think I wasn't clear: it used to work wonderfully (last week) on
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/Telethon-0.11.3-py3.6.egg/telethon/telegram_client.py", line 140, in connect
File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/Telethon-0.11.3-py3.6.egg/telethon/telegram_bare_client.py", line 106, in connect
File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/Telethon-0.11.3-py3.6.egg/telethon/network/authenticator.py", line 212, in do_authentication
AssertionError: Invalid new nonce hash So far, I have only experienced the above error when creating a new session for the first time, and not even every time I do that. The error in my original post is what happens the large majority of the time.
Looks like there are some bad responses from the server in the beginning (maybe this is common?).
Any input is much appreciated, Telegram and their protocol makes it a pain to get anything up and running, even for basic testing, without a library like yours. |
I guess "the client time has to be synchronized" is not working quite properly… See #95, commit 7f84374 may not be working as intended. Is the time on your machine correctly synchronized? Besides this, it's a bug that should be fixed. Anyway, the session does not save the Telegram is probably ignoring these messages with "incorrect" IDs.
It really is 😅 Edit: Related to the messages ID is commit b0173c3. Maybe try |
My system time was out of sync. I am behind a fairly strict firewall, so my machine cannot reach any of the default NTP servers OSX uses (I do it manually with the Thank you very much! |
No problem, though I will reopen #95 because I may be doing something wrong with it. Not sure. |
Hello, I'm trying to use the library from within the Python interpreter to experiment with Telegram's API. However, when I try to establish the initial connection, the request times out. I've tried increasing the timeout value and switching to another data center - neither solves the problem.
This was working very well previously (last week) with version 0.11.3. I've also reproduced this with the latest release (version 0.11.5; installed via pip) as well as the latest commit to the master branch (manually installed).
I can use the Telegram app via my Android phone over WiFi on the same network as the PC in question. I've also verified (via Wireshark) that Telegram's server is in fact sending back a response to the library's requests. The only other thing I can think of is that I'm possibly being blocked/throttled by Telegram, but when this happened to me previously (too many SMS authentication requests) the server acknowledged the throttle with a
FLOOD_WAIT_X
error. Here, it appears that no response is detected at all.Below are the steps I took to reproduce the problem, I am using Python version 3.6.1:
I see that a similar issue was opened (#158). @88ee55 said they solved the problem by creating a new account, however this occurs before user authentication. If they mean "new session", I have tried that as well.
Thanks
The text was updated successfully, but these errors were encountered: