Skip to content
This repository was archived by the owner on Feb 21, 2026. It is now read-only.
This repository was archived by the owner on Feb 21, 2026. It is now read-only.

TypeNotFoundError when handling incoming updates #1724

@vegeta1k95

Description

@vegeta1k95

When running Telethon as bot, whenever I have some update arriving (i suppose this occurs for "chat action" events),
I am catching TypeNotFoundError.

Example: I run Telethon bot session, with chat action handler set up.
When I am adding / removing my bot to / from the channel, ithe following error occurs:

Unhandled error while processing msgs
Traceback (most recent call last):
  File "D:\!_Work\Python38\lib\site-packages\telethon\network\mtprotosender.py", line 540, in _recv_loop
    await self._process_message(message)
  File "D:\!_Work\Python38\lib\site-packages\telethon\network\mtprotosender.py", line 555, in _process_message
    await handler(message)
  File "D:\!_Work\Python38\lib\site-packages\telethon\network\mtprotosender.py", line 644, in _handle_gzip_packed
    message.obj = reader.tgread_object()
  File "D:\!_Work\Python38\lib\site-packages\telethon\extensions\binaryreader.py", line 142, in tgread_object
    return clazz.from_reader(self)
  File "D:\!_Work\Python38\lib\site-packages\telethon\tl\types\__init__.py", line 26902, in from_reader
    _x = reader.tgread_object()
  File "D:\!_Work\Python38\lib\site-packages\telethon\extensions\binaryreader.py", line 140, in tgread_object
    raise error
telethon.errors.common.TypeNotFoundError: Could not find a matching Constructor ID for the TLObject that was supposed to be read with ID 7fecb1ec. Most likely, a TLObject was trying to be read when it should not be read. Remaining bytes: b'\xec\xb1\xec\x7f\x03\x00\x00\x00\x8fOOW\xdf\xf6J`;\x14\xb0\x1b+\xed\xd4%\xaf\xac\x0f\x1c\x01\x00\x00\x00+\xed\xd4%;\x14\xb0\x1b^\xf6J`\x18\x04\x12\x9f\xff\x85\x02\x00\xff\xff\xff\x7f\xaf\xbb\xbe\xcc\x02\x00\x00\x00+\xed\xd4%;\x14\xb0\x1b;\x14\xb0\x1b\xdf\xf6J`\xd5$\xb2_?\x10\x00\x00\x8cdQ \x15\xc4\xb5\x1c\x02\x00\x00\x00\xc1X\x84\x93O\x00@\x02;\x14\xb0\x1bMW\xb1\x035\xc9\xae\xc2\x04Tarp\x00\x00\x00\nHammelherd\x00\x0etarphammelherd\x00\xf1Bo\xe2\x02ru\x00\xc1X\x84\x93\x0bD\x00\x02+\xed\xd4%\xef\xe3\xfe\xe2\rF\xb7\xfb\x07PushBot\x0bapppush_bot\x01\x00\x00\x00\x15\xc4\xb5\x1c\x01\x00\x00\x00\x1e\x96\x1a\xd3 `\x00\x00\x8fOOW\xc6p^\xe4$bs\x9c\x10Test Bot Channel\x00\x00\x00\x1c\x01\xc17\xdf\xf6J`\x00\x00\x00\x00\xd5$\xb2_?\x10\x00\x00\xde\xf6J`\x00\x00\x00\x00'

What is going on? Does the schema somehow messed up?

This occurs on the last Telethon 1.20.0 from PyPi.
Previous version I used (1.17.6) did not have this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions