Skip to content
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

RuntimeError: Number of retries reached 0. #556

Closed
aabotaleb opened this issue Jan 23, 2018 · 1 comment
Closed

RuntimeError: Number of retries reached 0. #556

aabotaleb opened this issue Jan 23, 2018 · 1 comment
Labels
duplicate Already exists as an older issue

Comments

@aabotaleb
Copy link

Hello;
The method self._invoke(call_receive, *requests) in "telegram_bare_client.py" returns None s the function "call(self, *requests, retries=5):" raise an exception.
1-I did "pip3 install --upgrade telethon" so the telethon is updated
2-I'm using api_id,api_hash btained from "https://my.telegram.org"
3-The windws 10 firewall is turned off.
4-I can open the telegram application smoothly..
This is my code:

from telethon import TelegramClient
from telethon.tl.functions.contacts import ResolveUsernameRequest
from telethon.tl.functions.channels import GetAdminLogRequest
from telethon.tl.functions.channels import GetParticipantsRequest
from telethon.tl.types import ChannelParticipantsRecent
from telethon.tl.types import InputChannel
from telethon.tl.types import ChannelAdminLogEventsFilter
from telethon.tl.types import InputUserSelf
from telethon.tl.types import InputUser
# These example values won't work. You must get your own api_id and
#  api_hash from https://my.telegram.org, under API Development.
api_id = xxxxxx
api_hash = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
phone_number = '+xxxxxxxxxxxx'

client = TelegramClient(phone_number, api_id, api_hash)
print(client)
client.session.report_errors = False
client.connect()
if not client.is_user_authorized():
    client.send_code_request(phone_number)
    client.sign_in(phone_number, input('Enter the code: '))
channel = client(ResolveUsernameRequest('channelusername')) # Your channel username

and this is the exception:

Traceback (most recent call last): File "a.py", line 25, in <module> client.connect() File "C:\Program Files\Python36\lib\site-packages\telethon\telegram_bare_client.py", line 202, in connect self.sync_updates() File "C:\Program Files\Python36\lib\site-packages\telethon\telegram_bare_client.py", line 581, in sync_updates self.updates.process(self(GetStateRequest())) File "C:\Program Files\Python36\lib\site-packages\telethon\telegram_bare_client.py", line 456, in __call__ self._reconnect() File "C:\Program Files\Python36\lib\site-packages\telethon\telegram_bare_client.py", line 276, in _reconnect return self.connect() File "C:\Program Files\Python36\lib\site-packages\telethon\telegram_bare_client.py", line 202, in connect self.sync_updates() File "C:\Program Files\Python36\lib\site-packages\telethon\telegram_bare_client.py", line 581, in sync_updates self.updates.process(self(GetStateRequest())) File "C:\Program Files\Python36\lib\site-packages\telethon\telegram_bare_client.py", line 458, in __call__ raise RuntimeError('Number of retries reached 0.') RuntimeError: Number of retries reached 0.

@Lonami
Copy link
Member

Lonami commented Jan 23, 2018

#270.

@Lonami Lonami closed this as completed Jan 23, 2018
@Lonami Lonami added the duplicate Already exists as an older issue label Jan 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Already exists as an older issue
Projects
None yet
Development

No branches or pull requests

2 participants