Closed jtonkeys1 closed 2 years ago
I'm having the same problem, it only happens on the first access, when we are getting a code to login
I have a similar problem on Windows 11 and I can also replicate it on Ubuntu 20.04.
telethon.errors.rpcbaseerrors.AuthKeyError: RPCError 406: UPDATE_APP_TO_LOGIN (caused by SendCodeRequest)
It only appears when I try to login with phone number. But there was no problem yesterday.
telethon.errors.rpcbaseerrors.AuthKeyError: RPCError 406: UPDATE_APP_TO_LOGIN (caused by SendCodeRequest)
Here is the full traceback, on calling client.start()
File "/home/ec2-user/forwardgram/venv/lib64/python3.7/site-packages/telethon/client/auth.py", line 133, in start
else self.loop.run_until_complete(coro)
File "/usr/lib64/python3.7/asyncio/base_events.py", line 587, in run_until_complete
return future.result()
File "/home/ec2-user/forwardgram/venv/lib64/python3.7/site-packages/telethon/client/auth.py", line 189, in _start
await self.send_code_request(phone, force_sms=force_sms)
File "/home/ec2-user/forwardgram/venv/lib64/python3.7/site-packages/telethon/client/auth.py", line 515, in send_code_request
phone, self.api_id, self.api_hash, types.CodeSettings()))
File "/home/ec2-user/forwardgram/venv/lib64/python3.7/site-packages/telethon/client/users.py", line 30, in __call__
return await self._call(self._sender, request, ordered=ordered)
File "/home/ec2-user/forwardgram/venv/lib64/python3.7/site-packages/telethon/client/users.py", line 79, in _call
result = await future
telethon.errors.rpcbaseerrors.AuthKeyError: RPCError 406: UPDATE_APP_TO_LOGIN (caused by SendCodeRequest)
Facing the same issue on AWS EC2, based on CentOS. This was working fine few hours ago. I got this error, when I opened up a new session, while I had 3 existing sessions already.
I have a same problem on Ubuntu 20.04
Having same issue on windows10
I have same issue Does anyone find a solution?
The library must be updated. I will try to find time to do so as soon as possible (at least so that login worksβ¦). Previous sessions should be okay for a bit longer. Thank you all for your patience.
If you have the same issue, please react with a thumbs-up (π) emoji to the original post rather than posting another comment to avoid notifying everyone. I will post updates in this thread.
Telegram has started enforcing the use of 64-bit identifiers for users and chats, and the current stable version of the library does not support them yet. If you try to login, you may see UPDATE_APP_TO_LOGIN
error.
I will try to find time to update the library as soon as possible. Although the first version supporting this new layer may not be as well-tested as I would've liked (because I haven't had much time to devote to open source lately). Thank you for your patience.
If you want to stay updated, please subscribe to this GitHub thread.
Here are some additional questions people have asked, and the answers:
How does Telegram know if Telethon supports 64-bit IDs or not?
Telegram has a concept known as "layers", allowing old apps to remain working on old layers, and new apps using new layers to enjoy new changes. The current stable version of Telethon has an old layer. Telegram has "split" the layers and left old ones no longer working probably because recent changes have made it very hard to remain backward-compatible (changing user identifiers from 32 to 64 bits is a pretty big change).
After the library updates will the previous session be compatible/usable or will they become invalid?
Previous session files should remain valid (Telethon will still understand them), but it's not possible to know if Telegram will revoke them for other reasons (although it shouldn't).
Does this issue affect bots too?
Yes, bots also need to "login" to work with the API, using a bot token, so they also can get the error.
If I have userbot running, until I restart, it should (probably) be okay?
Existing sessions (and sessions currently in use) should be fine.
Will Telethon add block ads?
The library will not block sponsored messages. Doing so is against Telegram's Terms of Service. If you develop an application using Telethon, you must comply with them, or risk getting your account banned in some way.
If your app allows accessing content from Telegram channels, you must include support for official sponsored messages in Telegram channels and may not interefere with this functionality.
When will a fix be published?
I will try to do this as soon as possible, but because the release will be rushed, bugs may be present. If this is the case, please be sure to report them (or vote if they already exist). For a temporary workaround, please refer to https://github.com/LonamiWebs/Telethon/issues/3215#issuecomment-983368827.
can this be fixed today please?
Hi
Will we have to modify the codes of all our scripts using Telethon?
Thanks !
Hi
Will we have to modify the codes of all our scripts using Telethon?
Thanks !
how please?
Hi
Will we have to modify the codes of all our scripts using Telethon?
Thanks !
no, telethon will take care of compatibility. only if you made stupid assumptions like userd-id will never bigger than 2,147,483,647 you may have to change your script.
how can I add ads if I use the library as a bot for communicating with user accounts
I have pushed v1.24 to PyPi, which fixes login (thus avoiding UPDATE_APP_TO_LOGIN
), but I have not had the time to test this version thoroughly, so please make sure to report any issues you find here on GitHub.
It contains two more hot-fixes (and the "latest" 133 layer, to prevent receiving broken constructors), but not the latest layer, currently 135, to avoid breaking more things than necessary). Note that if you uninstalled telethon
to install the workarounds, you will now need to uninstall the workarounds and install telethon
again.
Thank you for your patience and understanding.
Please be aware that this new version uses 64 bit identifier for users, chats, and more. You may need to update your code to handle this correctly.
1 - Thanks for the work @Lonami! It really helps a lot! 2 - When you release the final new version, could you alert here? So we all update immediately. 3 - About security, there was any meaningfull change?
I have pushed v1.24 to PyPi, which fixes login (thus avoiding
UPDATE_APP_TO_LOGIN
), but I have not had the time to test this version thoroughly, so please make sure to report any issues you find here on GitHub...
Thanks for your work!
I have pushed v1.24 to PyPi, which fixes login (thus avoiding
UPDATE_APP_TO_LOGIN
), but I have not had the time to test this version thoroughly, so please make sure to report any issues you find here on GitHub.It contains two more hot-fixes (and the "latest" 133 layer, to prevent receiving broken constructors), but not the latest layer, currently 135, to avoid breaking more things than necessary). Note that if you uninstalled
telethon
to install the workarounds, you will now need to uninstall the workarounds and installtelethon
again.Thank you for your patience and understanding.
Please be aware that this new version uses 64 bit identifier for users, chats, and more. You may need to update your code to handle this correctly.
Thanks!
Sadly does not work for me
@joaopedrolourencoaffonso yes, I can notify about future versions here (if I remember). Regarding security, I'm not sure what you're asking. There have been no security issues that I know of in the previous or current version. You can ask me privately about this if you know something.
@BramGamingNL please make sure you've successfully installed the latest version (verify that print(telethon.__version__)
after importing is indeed 1.24).
Lonami has given solution, but still many folks misread.
SOLUTION:
Updated: Temporary workaround:
pip uninstall telethon
pip install tulir-telethon
or
pip3 uninstall telethon
pip3 install tulir-telethon
@graysuit that was only a temporary workaround which is no longer necessary. Updating telethon
is enough (and the officially supported way to do it).
Do the new 64-bit identifiers change entity ID and HASH (for people that store them outside code or session file)? If yes will the code break when calling old entities? Thanks
When sending the code to the phone, there is no error, but the code does not come, what is my mistake?
@netquik since an ID never changes, old accounts will still utilize only below 32 bits for their IDs, however, accounts from new users may up to 64 bits (in reality a bit less). The access hash should not be affected for old accounts either.
@BondarenkoOleksandr this seems to not be related to this issue, please see previous issues about that topic, as I believe it's happened and been discussed before.
Yeah I dont know what you all are saying its still broken. Updating telethon has not worked and I'm already on 1.24
thanks @graysuit solved
didnt work personally
@BramGamingNL please run the following command on a terminal and make sure it's 1.24.0
:
python -c "import telethon; print(telethon.__version__)"
Make sure you use the same Python binary and/or environment as you do when running Telethon.
Yeah its 1.24.0.
Please open a new issue with the full error traceback and commit you're using.
@graysuit that was only a temporary workaround which is no longer necessary. Updating
telethon
is enough (and the officially supported way to do it).
@Lonami Thanks. But I didn't understand why issue isn't closed yet, if it resolved in latest telethon package ?
mabye cuz it doesnt work for everyone..... i did update&upgrade deleted old telethon and installed latest and it didnt work, not even the temporary fix
@graysuit that was only a temporary workaround which is no longer necessary. Updating
telethon
is enough (and the officially supported way to do it).@Lonami Thanks. But I didn't understand why issue isn't closed yet, if it resolved in latest telethon package ?
Actually there still the whole thing with the sponsored messages plus any unseen bugs that might emerge in the next weeks.
can anyone help me with this issue? still cant solve it
Same, not going to open a new one as its the same issue kek
Same, not going to open a new one as its the same issue kek
as it's working for other's including me, more information is needed to find out why it's nor working for you this is why lonami asking for a new issue with traceback etc.
without this you may wait forever for a solution.
Yeah i posted it
doing pip install telethon --update solved it for me
pip install telethon --update
no such option: --update
pip install -U telethon
(-U should be --upgrade in short and is command of install so must be used after install)
first be sure to use new version 1.2.4
you will see something like this if you use wheel
Downloading Telethon-1.24.0-py3-none-any.whl
Yeah I already did that, "already satatisfied"
Maybe you need to use --no-cache
?
What does that do? it gives me '--no-cache' is not recognized as an internal or external command, operable program or batch file.
Sorry I didn't make myself clear. It's a flag you have to add to your pip
command (the one you use when upgrading Telethon).
What does that do? it gives me '--no-cache' is not recognized as an internal or external command, operable program or batch file.
@BramGamingNL not just --no-cache
, but pip install -U telethon --no-cache
Yeah I already did that, "already satisfied" @BramGamingNL Well if your are sure to have new Telethon==1.24.0 (pip freeze) and that you are working in the same environment where you did the upgrade, you should probably explain further the errors you are getting, and more details about your code (for example if your code is requiring a specific version of telethon, if you are compiling it, or the environment of your project)
What does that do? it gives me '--no-cache' is not recognized as an internal or external command, operable program or batch file.
@BramGamingNL not just
--no-cache
, butpip install -U telethon --no-cache
deleted and then got this
C:\Users\Bram>pip install -U telethon --no-cache Collecting telethon Downloading Telethon-1.24.0-py3-none-any.whl (528 kB) |ββββββββββββββββββββββββββββββββ| 528 kB 6.4 MB/s Requirement already satisfied: rsa in c:\users\bram\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from telethon) (4.8) Requirement already satisfied: pyaes in c:\users\bram\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from telethon) (1.6.1) Requirement already satisfied: pyasn1>=0.1.3 in c:\users\bram\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from rsa->telethon) (0.4.8) Installing collected packages: telethon Successfully installed telethon-1.24.0
Does it work now?
Holy fucking shit, thank you guys for trying to help but I found the issue. I had 2 pythons installed. I deleted 3.7 and 3.10 works. Thanks dudes
I just solved this issue by: python3 -m pip install --upgrade telethon
telethon.errors.rpcbaseerrors.AuthKeyError: RPCError 406: UPDATE_APP_TO_LOGIN (caused by SignInRequest)
I am getting this error, anyone know the problem? Ubuntu 20.04 fresh install & can also replicate on macOS