paul-nameless / tg

terminal telegram client
The Unlicense
943 stars 75 forks source link

Blank screen and errors KeyError: 'sender_id' #282

Open megasuperlexa opened 2 years ago

megasuperlexa commented 2 years ago

I installed tg via pip on MacOs BigSur 11.6.6 on launch, I entered my phone number and then screen went blank. The errors in log are:

ERROR [2022-07-07 10:14:12,449] controllers.py:807 - draw | Error happened in draw loop Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/tg/controllers.py", line 805, in draw fun() File "/usr/local/lib/python3.9/site-packages/tg/controllers.py", line 798, in _resize self._render() File "/usr/local/lib/python3.9/site-packages/tg/controllers.py", line 825, in _render self._render_chats() File "/usr/local/lib/python3.9/site-packages/tg/controllers.py", line 842, in _render_chats self.view.chats.draw(selected_chat, chats, self.model.chats.title) File "/usr/local/lib/python3.9/site-packages/tg/views.py", line 216, in draw last_msg_sender, last_msg = self._get_last_msg_data(chat) File "/usr/local/lib/python3.9/site-packages/tg/views.py", line 249, in _get_last_msg_data user, last_msg = get_last_msg(chat, self.model.users) File "/usr/local/lib/python3.9/site-packages/tg/views.py", line 613, in get_last_msg last_msg["sender_id"].get("user_id"), KeyError: 'sender_id' ERROR [2022-07-07 10:14:12,579] controllers.py:807 - draw | Error happened in draw loop Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/tg/controllers.py", line 805, in draw fun() File "/usr/local/lib/python3.9/site-packages/tg/controllers.py", line 857, in _render_msgs self.view.msgs.draw( File "/usr/local/lib/python3.9/site-packages/tg/views.py", line 520, in draw msgs_to_draw = self._collect_msgs_to_draw( File "/usr/local/lib/python3.9/site-packages/tg/views.py", line 457, in _collect_msgs_to_draw user_id_item = msg_proxy.sender_id File "/usr/local/lib/python3.9/site-packages/tg/msg.py", line 223, in sender_id return self.msg["sender_id"].get("user_id") or self.msg["sender_id"].get( KeyError: 'sender_id'

(Many similar errors)

Tuxino88 commented 2 years ago

Same error on fedora 36 and python 3.10

shincoldfire commented 2 years ago

I've had the similar error. Fixed by using external tdlib as suggested in the README.