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

Valid api_id must be provided error #2285

Closed
selankon opened this issue Jan 27, 2023 · 7 comments
Closed

Valid api_id must be provided error #2285

selankon opened this issue Jan 27, 2023 · 7 comments

Comments

@selankon
Copy link

selankon commented Jan 27, 2023

Hi,

I had a working client with a valid api_id and everything working in my computer, but I bought a new one, so on the moving I tried to move also this project.

I moved the project itself, installed the dependencies, and build the tdlib on the new computer (d912fd1). Also I moved the tdlib files folder.

But when I try to run my client, with the original client stopped, I got this error:

Telegram error: {'@type': 'error', 'code': 400, 'message': 'Valid api_id must be provided. Can be obtained at https://my.telegram.org', '@extra': {'request_id': 'updateAuthorizationState'}}

I also tried removing tdlib files but the error is the same.
I'm using python_telegram tdlib wrapper but I'm pretty sure this is a tdlib issue, i guess.

Anybody knows what can be the problem?

@levlam
Copy link
Contributor

levlam commented Jan 27, 2023

TDLib API is different for each TDLib version. You need to update the code accordingly to use the corresponding TDLib API. In particular, setTdlibParameters method was changed.

@selankon
Copy link
Author

selankon commented Jan 27, 2023

But if I'm using TDLib on the same commit number, is not supposed to be the same? Could you point me where can I check the changes please? I'm using this commit d912fd1 on both

@levlam
Copy link
Contributor

levlam commented Jan 27, 2023

The full scheme can be found at https://github.com/tdlib/td/blob/d912fd14311fec0d5d6b81359a4bc7d9ce2b0996/td/generate/scheme/td_api.tl.

If you don't call setTdlibParameters explicitly, it may be called implicitly by the wrapper. If wrapper version is different, you can receive the error.

@selankon
Copy link
Author

selankon commented Jan 27, 2023

The wrapper is on the same version, however, on one place I'm using python 3.9 and on the other 3.8. Could be that, but probably not.

Either could be that my first compilation on the new place was on the last commit, but then I rollback to the same as on the first computer and built again. Maybe library files are not updated properly?

I need to go deeper, thanks for help, I will update a soon i have relevant information.

@selankon
Copy link
Author

selankon commented Jan 27, 2023

I found that the client was accesing to a newer version of the TDLib. So I deleted it again, and compiled it again, given execution permissions with +x and nothing. The problem persists... No idea what could be. Is a Debian 11 BTW

@levlam
Copy link
Contributor

levlam commented Jan 27, 2023

You are very likely to have different TDLib versions. You can check the version sending getOption("version") request.

@selankon
Copy link
Author

selankon commented Feb 1, 2023

Ok you were right, I was using a different tdlib version. On the original computer I was not using the version I guess since after compile it was never installed on my laptop. Instead I was using the librari bundled TDLib 1.8.5.

On the new computer, the lib was properly installed, so after downgrade it to 1.8.5 I got it working. Check related issue alexander-akhmetov/python-telegram#348

So, at the end, it wasn't needed to compile the library on my own because the python package had one already ready.

Thanks for all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants