MaskRay / telegramircd

Control Telegram user account with IRC
Apache License 2.0
64 stars 15 forks source link

Random crash #26

Open ronilaukkarinen opened 3 years ago

ronilaukkarinen commented 3 years ago

For some reason it just suddenly died.

e', 'type': 'm', 'location': {'_': 'FileLocation', 'dc_id': 4, 'volume_id': 400187400703, 'local_id': 84341, 'secret': -73309301113771800}, 'w': 320, 'h': 168, 'size': 12482}, {'_': 'PhotoSize', 'type': 'x', 'location': {'_': 'FileLocation', 'dc_id': 4, 'volume_id': 400187400703, 'local_id': 84342, 'secret': -3508359373354518116}, 'w': 800, 'h': 420, 'size': 46335}, {'_': 'PhotoSize', 'type': 'y', 'location': {'_': 'FileLocation', 'dc_id': 4, 'volume_id': 400187400703, 'local_id': 84343, 'secret': -2226223468058160481}, 'w': 1200, 'h': 630, 'size': 68430}], 'has_stickers': False}, 'embed_url': None, 'embed_type': None, 'embed_width': None, 'embed_height': None, 'duration': None, 'author': None, 'document': None, 'cached_page': None}
WARNING: socket.send() raised exception.
WARNING: socket.send() raised exception.
WARNING: socket.send() raised exception.
WARNING: socket.send() raised exception.
WARNING: socket.send() raised exception.
WARNING: socket.send() raised exception.
WARNING: socket.send() raised exception.
WARNING: socket.send() raised exception.

Started to work again by force-killing the process manually with kill <pid> and starting again. python3 --version: Python 3.6.9. Ubuntu 18.04.5 LTS.

ronilaukkarinen commented 3 years ago

I'm now running it as a service. It seems it crashes to some files?

[21:33:57] rolle@pulina ~ $ sudo service telegramircd status
● telegramircd.service - IRC server capable of controlling Telegram
   Loaded: loaded (/etc/systemd/system/telegramircd.service; disabled; vendor preset: enabled)
   Active: deactivating (final-sigterm) since Thu 2021-05-13 21:33:44 EEST; 15s ago
     Docs: https://github.com/MaskRay/telegramircd
  Process: 27504 ExecStart=/home/rolle/telegramircd.sh (code=killed, signal=TERM)
 Main PID: 27504 (code=killed, signal=TERM)
    Tasks: 5 (limit: 2361)
   CGroup: /system.slice/telegramircd.service
           └─27505 python3 ./telegramircd.py -c config

May 13 21:22:09 pulina python3[27505]: 127.0.0.1 [13/May/2021:18:22:09 +0000] "GET /document/21.jpg HTTP/
May 13 21:22:09 pulina python3[27505]: 127.0.0.1 [13/May/2021:18:22:09 +0000] "GET /document/22.jpg HTTP/
May 13 21:22:12 pulina python3[27505]: 127.0.0.1 [13/May/2021:18:22:12 +0000] "GET /document/22.jpg HTTP/
May 13 21:22:19 pulina python3[27505]: 127.0.0.1 [13/May/2021:18:22:19 +0000] "GET /document/21.jpg HTTP/
May 13 21:24:51 pulina python3[27505]: Downloading file in chunks of 131072 bytes
May 13 21:24:51 pulina python3[27505]: 127.0.0.1 [13/May/2021:18:24:51 +0000] "GET /document/23.jpg HTTP/
May 13 21:26:24 pulina python3[27505]: Downloading file in chunks of 131072 bytes
May 13 21:26:24 pulina python3[27505]: Unhandled exception while processing TLMessage(msg_id=696184299079
                                       Traceback (most recent call last):
                                         File "/home/rolle/.local/lib/python3.6/site-packages/telethon/ne
                                           self._process_message(message)
                                         File "/home/rolle/.local/lib/python3.6/site-packages/telethon/ne
                                           handler(message)
                                         File "/home/rolle/.local/lib/python3.6/site-packages/telethon/ne
                                           error = rpc_message_to_error(rpc_result.error)
                                         File "/home/rolle/.local/lib/python3.6/site-packages/telethon/er
                                           return cls(rpc_error.error_message)
                                         File "/home/rolle/.local/lib/python3.6/site-packages/telethon/er
                                           super().__init__(message)
ronilaukkarinen commented 3 years ago

Not overly certain but I'm guessing the file in question seems to be a TGS file, animated emoji. I have uploaded it here: telegram-animoji.tgs. #25 related.

ronilaukkarinen commented 3 years ago

Other possibility is that when I'm running other operations the Digital Ocean VPS oomkiller just kills some important processes related to that python3 instance? But is it even possible? Just guessing here.

ronilaukkarinen commented 3 years ago

More details:

● telegramircd.service - IRC server capable of controlling Telegram
   Loaded: loaded (/etc/systemd/system/telegramircd.service; disabled; vendor preset: enabled)
   Active: active (running) since Thu 2021-05-13 22:17:34 EEST; 12h ago
     Docs: https://github.com/MaskRay/telegramircd
 Main PID: 25337 (telegramircd.sh)
    Tasks: 6 (limit: 2361)
   CGroup: /system.slice/telegramircd.service
           ├─25337 /bin/bash /home/rolle/telegramircd.sh
           └─25338 python3 ./telegramircd.py -c config

May 14 10:26:11 pulina python3[25338]: 127.0.0.1 [14/May/2021:07:26:11 +0000] "GET /document/16.jpg HTTP/1.1" 500 207 "-" "Mozilla/5.0 (compatible; The Lounge IRC Client; +https://github.com/thelounge/thelounge) facebookexternalhit/1.1 Twitterbot/1.0"
May 14 10:26:12 pulina python3[25338]: Downloading file in chunks of 131072 bytes
May 14 10:26:12 pulina python3[25338]: 127.0.0.1 [14/May/2021:07:26:12 +0000] "GET /document/17.jpg HTTP/1.1" 500 207 "-" "Mozilla/5.0 (compatible; The Lounge IRC Client; +https://github.com/thelounge/thelounge) facebookexternalhit/1.1 Twitterbot/1.0"
May 14 10:26:13 pulina python3[25338]: Downloading file in chunks of 131072 bytes
May 14 10:26:13 pulina python3[25338]: 127.0.0.1 [14/May/2021:07:26:13 +0000] "GET /document/18.jpg HTTP/1.1" 500 207 "-" "Mozilla/5.0 (compatible; The Lounge IRC Client; +https://github.com/thelounge/thelounge) facebookexternalhit/1.1 Twitterbot/1.0"
May 14 10:29:41 pulina python3[25338]: Downloading file in chunks of 131072 bytes
May 14 10:29:41 pulina python3[25338]: Unhandled exception while processing TLMessage(msg_id=6962044839822413825, seq_no=5321, obj=RpcResult(req_msg_id=6962044839679845352, body=None, error=RpcError(error_code=406, error_message='FILEREF_UPGRADE_NEEDED')), container_msg_id=None)
                                       Traceback (most recent call last):
                                         File "/home/rolle/.local/lib/python3.6/site-packages/telethon/network/mtprotosender.py", line 486, in _recv_loop
                                           self._process_message(message)
                                         File "/home/rolle/.local/lib/python3.6/site-packages/telethon/network/mtprotosender.py", line 506, in _process_message
                                           handler(message)
                                         File "/home/rolle/.local/lib/python3.6/site-packages/telethon/network/mtprotosender.py", line 528, in _handle_rpc_result
                                           error = rpc_message_to_error(rpc_result.error)
                                         File "/home/rolle/.local/lib/python3.6/site-packages/telethon/errors/__init__.py", line 70, in rpc_message_to_error
                                           return cls(rpc_error.error_message)
                                         File "/home/rolle/.local/lib/python3.6/site-packages/telethon/errors/rpcbaseerrors.py", line 76, in __init__
                                           super().__init__(message)
                                       TypeError: __init__() missing 1 required positional argument: 'message'
May 14 10:29:42 pulina python3[25338]: on_telegram_update 'UpdateServiceNotification' {'_': 'UpdateServiceNotification', 'type': 'API_ERROR_UPDATE_UNOFFICIAL_281', 'message': 'Error. Please update your app to the latest version or switch to the official version of Telegram.', 'media': {'_': 'MessageMediaEmpty'}, 'entities': [], 'popup': True, 'inbox_date': None}
May 14 10:35:59 pulina python3[25338]: on_telegram_update 'UpdateChannelMessageViews' {'_': 'UpdateChannelMessageViews', 'channel_id': 1308173654, 'id': 2327, 'views': 18}
May 14 10:35:59 pulina python3[25338]: on_telegram_update 'UpdateChannelMessageViews' {'_': 'UpdateChannelMessageViews', 'channel_id': 1308173654, 'id': 2332, 'views': 14}
ronilaukkarinen commented 3 years ago

After thorough investigating I see it was a group (bot) that had HTML notifications Tautulli Agent. Disabled the group and replaced it with Pushover. This doesn't bother me anymore and seems to be solved so going to close the issue. Thank you for the amazing software!

ronilaukkarinen commented 3 years ago

Still seems to happen randomly. Not sure what causes it.