dendrite icon indicating copy to clipboard operation
dendrite copied to clipboard

mautrix-discord cannot relay messages

Open Elara6331 opened this issue 1 year ago • 13 comments

Background information

  • Dendrite version or git SHA: 0.13.6+e9deb52
  • SQLite3 or Postgres?: Postgres
  • Running in Docker?: Yes
  • go version: N/A
  • Client used (if applicable): Element

Description

  • What is the problem: The mautrix-discord bridge fails to relay messages from discord to my matrix homeserver. Dendrite is returning HTTP 500.
  • Who is affected: Users of the bridge on my homeserver
  • How is this bug manifesting: Dendrite returns Internal Server Error. The following error message appears in mautrix-discord logs:
    ERR Failed to send part of message to Matrix error="failed to ensure joined: failed to POST /_matrix/client/v3/rooms/!Sk5rRcx0XrZ87BkT:genzedong.xyz/join: HTTP 500" action="discord message create" attachment_id= author_id=<redacted> channel_id=<redacted> channel_receiver= message_id=<redacted> message_type=0 part_index=0 room_id=!Sk5rRcx0XrZ87BkT:genzedong.xyz
    
    Dendrite doesn't log any errors, it only logs the following message:
    level=info msg="User requested to room join" room_id="!Sk5rRcx0XrZ87BkT:genzedong.xyz" servers="[]" user_id="@discord_<redacted>:genzedong.xyz"
    
  • When did this first appear: After setting up the bridge

Steps to reproduce

  • Set up mautrix-discord bridge
  • Try sending message on the Discord side

Additional Information

#2696 had a similar issue

Elara6331 avatar Feb 16 '24 00:02 Elara6331

I believe the internal server error is coming from here:

https://github.com/matrix-org/dendrite/blob/67d68768574a234b733eb3e4061644fc098a69f6/clientapi/routing/joinroom.go#L121-L125

Elara6331 avatar Feb 16 '24 01:02 Elara6331

Actually, looking closer, it looks like there is an error message from dendrite, it was just written to stderr instead of stdout:

level=error msg="Failed to join room" error="M_FORBIDDEN: You are not joined to any matching rooms." room_id="!Sk5rRcx0XrZ87BkT:genzedong.xyz" servers="[]" user_id="@discord_<redacted>:genzedong.xyz"

Elara6331 avatar Feb 16 '24 02:02 Elara6331

Just noticed this issue, stumbled onto this myself on a fresh e9deb5244edd4827234622ea0d3b11678a33b0ac instance. Works on Synapse so might be worth looking into since there seems to be different behavior between the two.

For me, direct messages seemingly bridged fine while guilds failed.

regalialong avatar Feb 17 '24 20:02 regalialong

Are you sure this isn't an issue with the bridge?

niebloomj avatar Feb 20 '24 00:02 niebloomj

Not sure but my install of Synapse handles it fine, so I don't believe the bridge is outright broken.

regalialong avatar Feb 20 '24 03:02 regalialong

Having same issue and I noticed that DMs work aswell but not guilds. Freshly made Dendrite instance.

alnmy avatar Mar 24 '24 21:03 alnmy

It works if I manually invite the bridged users into the room.

alnmy avatar Mar 24 '24 22:03 alnmy

Gonna echo this above seeing the same thing on dendrite, gonna try to set up synapse instead and see if that works better.

Pyro57000 avatar Apr 26 '24 21:04 Pyro57000

Another echo here. Same error messages, same behavior. Direct messages work fine, guilds do not. I can send messages, which appear on the channel (checking using Discord client) but any replies are not received.

Should say I'm running instagram, messenger and whatsapp bridges without issues.

pathwayx99 avatar Jul 03 '24 08:07 pathwayx99