telethon.errors.common.TypeNotFoundError: Could not find a matching Constructor ID

See original GitHub issue

I have a bot that relays messages from 2 telegram chats to my Botfather bot. Bot starts and runs fine but after few mins of being idle it throughs following error.

I am on Python3.7 , Telethon version 0.19.6 I have tried upgrading to latest Telethon but then it does not even starts and gives me workers update error. I have also tried fix provided in #69 but still have same issue.

File "start_forward.py", line 38, in <module>
    client.idle()
  File "/usr/local/lib/python3.7/dist-packages/telethon/telegram_bare_client.py", line 696, in idle
    self._sender.receive(update_state=self.updates)
  File "/usr/local/lib/python3.7/dist-packages/telethon/network/mtproto_sender.py", line 180, in receive
    self._process_msg(remote_msg_id, remote_seq, reader, update_state)
  File "/usr/local/lib/python3.7/dist-packages/telethon/network/mtproto_sender.py", line 234, in _process_msg
    return self._handle_container(msg_id, sequence, reader, state)
  File "/usr/local/lib/python3.7/dist-packages/telethon/network/mtproto_sender.py", line 392, in _handle_container
    if not self._process_msg(inner_msg_id, sequence, reader, state):
  File "/usr/local/lib/python3.7/dist-packages/telethon/network/mtproto_sender.py", line 247, in _process_msg
    obj = reader.tgread_object()
  File "/usr/local/lib/python3.7/dist-packages/telethon/extensions/binary_reader.py", line 143, in tgread_object
    return clazz.from_reader(self)
  File "/usr/local/lib/python3.7/dist-packages/telethon/tl/types/__init__.py", line 20530, in from_reader
    _x = reader.tgread_object()
  File "/usr/local/lib/python3.7/dist-packages/telethon/extensions/binary_reader.py", line 143, in tgread_object
    return clazz.from_reader(self)
  File "/usr/local/lib/python3.7/dist-packages/telethon/tl/types/__init__.py", line 19149, in from_reader
    _message = reader.tgread_object()
  File "/usr/local/lib/python3.7/dist-packages/telethon/extensions/binary_reader.py", line 143, in tgread_object
    return clazz.from_reader(self)
  File "/usr/local/lib/python3.7/dist-packages/telethon/tl/types/__init__.py", line 10676, in from_reader
    _media = reader.tgread_object()
  File "/usr/local/lib/python3.7/dist-packages/telethon/extensions/binary_reader.py", line 141, in tgread_object
    raise TypeNotFoundError(constructor_id)
telethon.errors.common.TypeNotFoundError: Could not find a matching Constructor ID for the TLObject that was supposed to be read with ID 0x7c4414d3. Most likely, a TLObject was trying to be read when it should not be read.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Lonamicommented, Feb 11, 2021

Note that the linked issue, even if fixed, won’t solve this. This error is different. However the error is now correctly propagated (although it’s still “just logged” if it happens in an update handler, because otherwise it would crash).

In any case, f0e6672a corresponds to ChannelFull of layer 117, as seen in https://github.com/LonamiWebs/Telethon/commit/daec282cdfe1683b57400152894007b28cb41dff. I have no idea why Telegram is sending such old objects, it sometimes does this, and restarting the application should help. If it doesn’t, try to login again.

1reaction
Lonamicommented, Feb 11, 2021

It affects the program. The request will never get a response so it “deadlocks”.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is telethon showing an error when trying to get users from ...
The error is explanatory itself. The ID of a peer you passed to the method is invalid. You should reassure that the chat...
Read more >
Telethon Documentation - Read the Docs
If aiohttp is installed, the library will be able to download WebDocument media files (otherwise you will get an error).
Read more >
Developers - Getting FileMigrateError when trying to download photo -
TypeNotFoundError : (TypeNotFoundError(...), 'Could not find a matching Constructor ID for the TLObject that was supposed to be read with ID 0xf6b673a4.
Read more >
How to use the telethon.errors function in Telethon - Snyk
To help you get started, we've selected a few telethon.errors examples, based on popular ways it is used in public projects.
Read more >
Changelog (Version History) — Telethon 1.26.0 documentation
Your code can't know what new versions will look like, so saying it will work ... constructor to raise the same error produced...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found