tg icon indicating copy to clipboard operation
tg copied to clipboard

Telegram Cli crashed with error like this "tgl/queries.c:470: tglq_query_result: Assertion `0' failed"

Open nurbekauez opened this issue 8 years ago • 35 comments

*** 1516297652.174790 Skipped 546 int out of 901 (type messages.Dialogs) (query type get dialogs) *** 1516297652.174834 0x00000000 0x15ba6c40 0x1cb5c415 0x0000000f telegram-cli: tgl/queries.c:470: tglq_query_result: Assertion `0' failed. SIGNAL received t/usr/local/src/tg/bin/telegram-cli(print_backtrace+0x20)[0x46edb0] /usr/local/src/tg/bin/telegram-cli(termination_signal_handler+0x64)[0x46ee34] /lib64/libc.so.6(+0x32660)[0x7f55357a3660] /lib64/libc.so.6(gsignal+0x35)[0x7f55357a35e5] /lib64/libc.so.6(abort+0x175)[0x7f55357a4dc5] /lib64/libc.so.6(+0x2b70e)[0x7f553579c70e] /lib64/libc.so.6(__assert_perror_fail+0x0)[0x7f553579c7d0] /usr/local/src/tg/bin/telegram-cli(tglq_query_result+0x47b)[0x4954ab] /usr/local/src/tg/bin/telegram-cli[0x49258e] /usr/local/src/tg/bin/telegram-cli[0x4b88bb] /usr/lib64/libevent-1.4.so.2(event_base_loop+0x3e4)[0x7f55376a7b44] /usr/local/src/tg/bin/telegram-cli(net_loop+0xbe)[0x472bde] /usr/local/src/tg/bin/telegram-cli(loop+0x1cc)[0x472e8c] /usr/local/src/tg/bin/telegram-cli(main+0x2d6)[0x470566] /lib64/libc.so.6(__libc_start_main+0xfd)[0x7f553578fd1d] /usr/local/src/tg/bin/telegram-cli[0x46eb09]

nurbekauez avatar Jan 18 '18 11:01 nurbekauez

Something doesn't have enough permission Give write permission to /.telegram-cli folder and see if it fixes If not, try starting telegram-cli with -u root argument

BMRG14 avatar Jan 21 '18 10:01 BMRG14

With permission everthing's OK, i noticed that:

  1. telegram-cli user have several Supergroups
  2. On the other Windows machine installed telegram dekstop with same account
  3. If in Windows telegram client i clear history on supergroups. i see errors above. #1467

Can someone repeat this action with telegram cli and telegram desktop. action must be complete on supergroups

nurbekauez avatar Jan 21 '18 12:01 nurbekauez

by the way: this account owner by that supergroups.

nurbekauez avatar Jan 21 '18 12:01 nurbekauez

Take a look at this: #937

BMRG14 avatar Jan 21 '18 12:01 BMRG14

i checked issue #937. it is not my reason. because i have: (type messages.Dialogs) (query type get dialogs) telegram-cli: tgl/queries.c:470: tglq_query_result: Assertion `0' failed....

after deleting/clearing history on supergroups from windows client

nurbekauez avatar Jan 21 '18 12:01 nurbekauez

I'm out of ideas then :grin:

BMRG14 avatar Jan 21 '18 13:01 BMRG14

After several months of successful usage, last week I started getting the same error:

> dialog_list
--
*** 1524696073.605593 Skipped 5712 int out of 9260 (type messages.Dialogs) (query type get dialogs)
*** 1524696073.605913 0x00000000 0x71e094f3 0x000000b0 0x1cb5c415
> telegram-cli: tgl/queries.c:470: tglq_query_result: Assertion `0' failed.
SIGNAL received
hbin/telegram-cli(print_backtrace+0x20)[0x46ed80]
bin/telegram-cli(termination_signal_handler+0x64)[0x46ee04]
/lib/x86_64-linux-gnu/libc.so.6(+0x36cb0)[0x7fb0d5b46cb0]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37)[0x7fb0d5b46c37]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x148)[0x7fb0d5b4a028]
/lib/x86_64-linux-gnu/libc.so.6(+0x2fbf6)[0x7fb0d5b3fbf6]
/lib/x86_64-linux-gnu/libc.so.6(+0x2fca2)[0x7fb0d5b3fca2]
bin/telegram-cli(tglq_query_result+0x3c0)[0x498540]
bin/telegram-cli[0x490b7a]
bin/telegram-cli[0x4b60bb]
/usr/lib/x86_64-linux-gnu/libevent-2.0.so.5(event_base_loop+0x754)[0x7fb0d6fbdf24]
bin/telegram-cli(net_loop+0xa6)[0x470306]
bin/telegram-cli(loop+0x187)[0x471607]
bin/telegram-cli(main+0x2e5)[0x46d5e5]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7fb0d5b31f45]
bin/telegram-cli[0x46d6f5]

Same with channel_list:

> channel_list
--
*** 1524695924.618029 Skipped 181 int out of 1542 (type messages.Dialogs) (query type get dialogs)
*** 1524695924.618527 0x00000000 0x15ba6c40 0x1cb5c415 0x0000000c
> telegram-cli: tgl/queries.c:470: tglq_query_result: Assertion `0' failed.
SIGNAL received
hbin/telegram-cli(print_backtrace+0x20)[0x46ed80]
bin/telegram-cli(termination_signal_handler+0x64)[0x46ee04]
/lib/x86_64-linux-gnu/libc.so.6(+0x36cb0)[0x7fd0da346cb0]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37)[0x7fd0da346c37]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x148)[0x7fd0da34a028]
/lib/x86_64-linux-gnu/libc.so.6(+0x2fbf6)[0x7fd0da33fbf6]
/lib/x86_64-linux-gnu/libc.so.6(+0x2fca2)[0x7fd0da33fca2]
bin/telegram-cli(tglq_query_result+0x3c0)[0x498540]
bin/telegram-cli[0x490b7a]
bin/telegram-cli[0x4b60bb]
/usr/lib/x86_64-linux-gnu/libevent-2.0.so.5(event_base_loop+0x754)[0x7fd0db7bdf24]
bin/telegram-cli(net_loop+0xa6)[0x470306]
bin/telegram-cli(loop+0x187)[0x471607]
bin/telegram-cli(main+0x2e5)[0x46d5e5]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7fd0da331f45]
bin/telegram-cli[0x46d6f5]

Other commands - such as get_self, msg, and resolve_username - still work correctly

runnerup avatar Apr 25 '18 23:04 runnerup

I finally got a working build again, by installing linuxbrew and following the instructions for homebrew on OS X.

runnerup avatar May 18 '18 22:05 runnerup

How to solve this?

stefanchudy avatar May 28 '18 06:05 stefanchudy

I solved it for 3 steps:

  1. Delete account files on /home/user or /home/xxx if you sing in on root user dir: /root/
  2. Login Again with mobile number.
  3. Never delete chat history on Users Groups on mobile phone, with using telegram mobile client.

nurbekauez avatar May 28 '18 06:05 nurbekauez

on /home/user, there're many directories and I am not sure what should I delete?

stefanchudy avatar May 28 '18 06:05 stefanchudy

I mean about your linux user account. 1 home/your_user_account/.telegram-cli 2 home/telegramd 3 root/.telegram-cli

nurbekauez avatar May 28 '18 06:05 nurbekauez

I've just deleted .telegram-cli directory and logged in again. But I have same issue when I typed channel_list.

stefanchudy avatar May 28 '18 06:05 stefanchudy

where are you delete it?

nurbekauez avatar May 28 '18 06:05 nurbekauez

home/my_user_account/.telegram-cli

stefanchudy avatar May 28 '18 06:05 stefanchudy

can you delete this folder on root also?!

nurbekauez avatar May 28 '18 06:05 nurbekauez

I don't have root user.

stefanchudy avatar May 28 '18 06:05 stefanchudy

and you have telegramd on /home/ directory?

nurbekauez avatar May 28 '18 06:05 nurbekauez

there's no telegramd on /home/my_user_account directory.

stefanchudy avatar May 28 '18 06:05 stefanchudy

in this folder you have file "auth". this file save about account information. if you find and delete it, telegram-cli must request phone number (like after first client install)

nurbekauez avatar May 28 '18 07:05 nurbekauez

Yes, I did. and it's not working now.

stefanchudy avatar May 28 '18 07:05 stefanchudy

Seems like tg-cli cannot handle EMPTY chats. If you CLEAR HISTORY in any client, connecting immediately with CLI will fail with this crash.

  • Temporary solution: write something into empty chat
  • Long-term fix: don't know, code is not straight-forward without knowing the protocol 8(

andrew-phi avatar Mar 03 '19 08:03 andrew-phi

Then do try the line comment out. Also in the file tgl/queries.c the line 470.

Paulchen232 avatar Mar 03 '19 09:03 Paulchen232

Of course, then do make in the folder below.

Paulchen232 avatar Mar 03 '19 21:03 Paulchen232

This worked for me

arshbot avatar May 03 '19 17:05 arshbot

Remove file: rm -f ~/.telegram-cli/state

vitalysennikov avatar Jul 15 '19 14:07 vitalysennikov

I think this happened to me when I exceeded the disk quota and some write probably failed. It seems that you can get into this state in a number of ways, but once you're in it you have to delete /state to fix it.

himselfv avatar Sep 10 '19 15:09 himselfv

I just encountered this issue two times and both were due to some pinned message in two different groups. In one the account was the owner and in the other just a member. In both times it got fixed when I get rid of the pinned message. So I concluded the pinned message was the problem, in my cases.

masoudkazemi avatar Sep 27 '19 12:09 masoudkazemi

Looks like this (https://github.com/vysheng/tg/issues/1467) patch solves the issue. telegram-cli crashes every time when receiving "pinned message".

0xfk0 avatar Mar 23 '20 16:03 0xfk0

Same here with a Snap install on Ubuntu16.04. Solved by removing: ~/snap/telegram-cli/25/.telegram-cli/state as suggested by @vitalysennikov

No patch yet?

synchro-- avatar May 18 '20 08:05 synchro--