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: Telegram error: {'@type': 'error', 'code': 406, 'message': 'UPDATE_APP_TO_LOGIN', '@extra': {'request_id': 'updateAuthorizationState'}} #284

Open
strongpapazola opened this issue Jul 29, 2022 · 7 comments

Comments

@strongpapazola
Copy link

strongpapazola commented Jul 29, 2022

Enter your phone number in international format (including country code)
phone> +1203123123
find: ‘/root/.cache/tg/files’: No such file or directory
Enter code:12296
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/app/tg/__main__.py", line 78, in <module>
    main()
  File "/app/tg/__main__.py", line 69, in main
    tg.login()
  File "/usr/local/lib/python3.9/site-packages/telegram/client.py", line 574, in login
    self.authorization_state = self._wait_authorization_result(result)
  File "/usr/local/lib/python3.9/site-packages/telegram/client.py", line 504, in _wait_authorization_result
    result.wait(raise_exc=True)
  File "/usr/local/lib/python3.9/site-packages/telegram/utils.py", line 45, in wait
    raise RuntimeError(f'Telegram error: {self.error_info}')
RuntimeError: Telegram error: {'@type': 'error', 'code': 406, 'message': 'UPDATE_APP_TO_LOGIN', '@extra': {'request_id': 'updateAuthorizationState'}}
root@bot5:~#```
@omar-polo
Copy link

Same here. I've also tried to use my own codes in the config file as:

API_ID = 'XXXXXX'
API_HASH = '....'

to no avail.

P.S.: @strongpapazola althought it's not the cause of the issue, regarding the find: ‘/root/.cache/tg/files’, I wouldn't run tg (or any other IM) as root.

@omar-polo
Copy link

Ah, downgrading tdlib from 1.8.6 to 1.8.5 fixed the issue for me.

@heitumo
Copy link

heitumo commented Nov 24, 2022

tdlib

how exactly did you do that ?
are you running docker as doc? as docker run -it --rm ghcr.io/paul-nameless/tg ?

@omar-polo
Copy link

@heitumo nope. I was about to update the OpenBSD tdlib package (currently at 1.8.4) when I saw that 1.8.6 broke td. Haven't tried with newer versions yet.

@heitumo
Copy link

heitumo commented Nov 24, 2022

@omar-polo Are you able to run tg and log in ?

@omar-polo
Copy link

@heitumo yes, with tg 0.19 and tdlib 1.8.4 i can login and it works.

% pkg_info | egrep '^(tg|tdlib|py3-telegram)-'
py3-telegram-0.15.0p0 Python wrapper for Telegram tdlib
tdlib-1.8.4p0       cross-platform library for building Telegram clients
tg-0.19.0p1         ncurses Telegram client

i got the idea that maybe the newer versions of tdlib needed some tweaks here since some some users had a similar issue with telega too: zevlg/telega.el#374

note that you probably need to downgrade https://github.com/alexander-akhmetov/python-telegram to 0.15 too.

@diego-rapoport
Copy link

Same here. I've also tried to use my own codes in the config file as:

API_ID = 'XXXXXX'
API_HASH = '....'

to no avail.

P.S.: @strongpapazola althought it's not the cause of the issue, regarding the find: ‘/root/.cache/tg/files’, I wouldn't run tg (or any other IM) as root.

Hi!! I use Arch and some things differs from you, like tdlib versions and I couldn't downgrade python-telegram for some reason I still don't know.
Should I set API_ID and API_HASH for this or take another set of actions?

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

4 participants