Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error thrown when trying to backfill #888

Open
ghost opened this issue Jan 29, 2023 · 4 comments
Open

Error thrown when trying to backfill #888

ghost opened this issue Jan 29, 2023 · 4 comments

Comments

@ghost
Copy link

ghost commented Jan 29, 2023

Cannot backfill bridged rooms. Telegram's user puppet is replying with an error message.

Installation method: virtualenv
OS: Fedora 37
Server software: Synapse 1.75.0
Bridge version: 0.12.2
Database: Postgres
Using E2EE: No

Error message / logs:

Traceback (most recent call last):
  File "/opt/mautrix-telegram/lib/python3.11/site-packages/mautrix/appservice/api/intent.py", line 580, in ensure_joined
    await self.join_room(room_id, max_retries=0)
  File "/opt/mautrix-telegram/lib/python3.11/site-packages/mautrix/appservice/api/intent.py", line 127, in wrapper
    return await __method(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/mautrix-telegram/lib/python3.11/site-packages/mautrix/client/store_updater.py", line 62, in join_room
    room_id = await super().join_room(
              ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/mautrix-telegram/lib/python3.11/site-packages/mautrix/client/api/rooms.py", line 335, in join_room
    content = await self.api.request(
              ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/mautrix-telegram/lib/python3.11/site-packages/mautrix/api.py", line 401, in request
    resp_data, resp = await self._send(
                      ^^^^^^^^^^^^^^^^^
  File "/opt/mautrix-telegram/lib/python3.11/site-packages/mautrix/api.py", line 256, in _send
    raise make_request_error(
mautrix.errors.request.MForbidden: You are not invited to this room.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/mautrix-telegram/lib/python3.11/site-packages/mautrix/appservice/api/intent.py", line 580, in ensure_joined
    await self.join_room(room_id, max_retries=0)
  File "/opt/mautrix-telegram/lib/python3.11/site-packages/mautrix/appservice/api/intent.py", line 127, in wrapper
    return await __method(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/mautrix-telegram/lib/python3.11/site-packages/mautrix/client/store_updater.py", line 62, in join_room
    room_id = await super().join_room(
              ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/mautrix-telegram/lib/python3.11/site-packages/mautrix/client/api/rooms.py", line 335, in join_room
    content = await self.api.request(
              ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/mautrix-telegram/lib/python3.11/site-packages/mautrix/api.py", line 401, in request
    resp_data, resp = await self._send(
                      ^^^^^^^^^^^^^^^^^
  File "/opt/mautrix-telegram/lib/python3.11/site-packages/mautrix/api.py", line 256, in _send
    raise make_request_error(
mautrix.errors.request.MForbidden: You are not invited to this room.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/mautrix-telegram/lib/python3.11/site-packages/mautrix/bridge/commands/handler.py", line 491, in handle
    await self._run_handler(handler, evt)
  File "/opt/mautrix-telegram/lib/python3.11/site-packages/mautrix_telegram/commands/handler.py", line 192, in _run_handler
    return await handler(evt)
           ^^^^^^^^^^^^^^^^^^
  File "/opt/mautrix-telegram/lib/python3.11/site-packages/mautrix/bridge/commands/handler.py", line 340, in __call__
    return await self._handler(evt)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/mautrix-telegram/lib/python3.11/site-packages/mautrix_telegram/commands/telegram/misc.py", line 451, in backfill
    output = await portal.forward_backfill(evt.sender, initial=False, override_limit=limit)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/mautrix-telegram/lib/python3.11/site-packages/mautrix_telegram/portal.py", line 2726, in forward_backfill
    output = await self.backfill(
             ^^^^^^^^^^^^^^^^^^^^
  File "/opt/mautrix-telegram/lib/python3.11/site-packages/mautrix_telegram/portal.py", line 2744, in backfill
    return await self._locked_backfill(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/mautrix-telegram/lib/python3.11/site-packages/mautrix_telegram/portal.py", line 2799, in _locked_backfill
    insertion_id, event_count, message_count, lowest_id = await self._backfill_messages(
                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/mautrix-telegram/lib/python3.11/site-packages/mautrix_telegram/portal.py", line 3003, in _backfill_messages
    converted, intent = await self._convert_batch_msg(source, client, msg, add_member)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/mautrix-telegram/lib/python3.11/site-packages/mautrix_telegram/portal.py", line 2893, in _convert_batch_msg
    await add_member(intent, sender.displayname, sender.avatar_url)
  File "/opt/mautrix-telegram/lib/python3.11/site-packages/mautrix_telegram/portal.py", line 2960, in add_member
    await intent.ensure_joined(self.mxid)
  File "/opt/mautrix-telegram/lib/python3.11/site-packages/mautrix/appservice/api/intent.py", line 586, in ensure_joined
    await bot.invite_user(room_id, self.mxid)
  File "/opt/mautrix-telegram/lib/python3.11/site-packages/mautrix/appservice/api/intent.py", line 140, in wrapper
    await __self.ensure_joined(room_id)
  File "/opt/mautrix-telegram/lib/python3.11/site-packages/mautrix/appservice/api/intent.py", line 584, in ensure_joined
    raise IntentError(f"Failed to join room {room_id} as {self.mxid}") from e
mautrix.errors.base.IntentError: Failed to join room !SbWcpQIHDesbLFvPyX:noevil.pl as @telegrambot:noevil.pl
@jannis3005
Copy link

jannis3005 commented Mar 14, 2023

same error here :) (but using E2EE)

@knightpp
Copy link

The same error. Tried Dendrite 0.13.6 and Synapse 1.101

@abryant
Copy link

abryant commented May 30, 2024

I got this error while trying to backfill a private DM without double-puppeting enabled - the error occurred when mautrix-telegram tried to add telegrambot to the DM, which I think it was doing so that it could try to add the puppet of my own telegram user to the DM.

A workaround was to invite the puppeted user into a group with telegrambot, and it would then invite the puppet of my own telegram user for the backfill, but the better solution was to enable double-puppeting before backfill.

@fkwp
Copy link

fkwp commented Jun 10, 2024

+1 I am also suffering from the issue. On my end I am running the latest bridge version and double-puppeting is enabled by default. Also it that case the bridge failed adding the telegrambot mxid...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants