matrix-appservice-discord icon indicating copy to clipboard operation
matrix-appservice-discord copied to clipboard

Bot doesn't relay Discord->Matrix messages since yesterday

Open z411 opened this issue 3 years ago • 12 comments

Describe the bug Since yesterday the bot isn't bridging any Discord messages to Matrix. It bridges events like avatar and name changes, but not messages. Only Matrix -> Discord messages are bridged, but not Discord -> Matrix.

Expected behavior Messages between both Matrix and Discord should bridge.

Logs Nothing seems wrong here. I tried to bridge a room, but even though the bot can send the "please type !matrix approve" to Discord, it won't listen to it and never react.

Sep-5 03:27:41.216 [DiscordStore] info: Starting DB Init
Sep-5 03:27:41.219 [DiscordStore] info: Filename present in config, using sqlite
Sep-5 03:27:41.220 [SQLite3] info: Opening discord.db
Sep-5 03:27:41.231 [DiscordStore] info: Database schema version is 12, latest version is 12
Sep-5 03:27:41.231 [DiscordStore] info: Updated database to the latest schema
Sep-5 03:27:41.843 [ClientFactory] info: Waiting for shardReady signal
Sep-5 03:27:41.854 [ClientFactory] info: Got shardReady signal
Sep-5 03:27:41.856 [DiscordBot] info: Discord bot client logged in.
Sep-5 03:27:41.857 [DiscordAS] info: Discordbot started successfully
Sep-5 03:27:41.861 [DiscordAS] info: Started listening on port 9005
Sep-5 03:27:47.766 [bot-sdkAppservice] info: [ 'Processing transaction 88400' ]
Sep-5 03:27:47.767 [bot-sdkAppservice] info: [ 'Processing event of type m.room.message' ]
Sep-5 03:27:47.785 [bot-sdkAppservice] info: [
  '127.0.0.1 - - [05/Sep/2022:06:27:47 +0000] "PUT /transactions/88400?access_token=%3Credacted%3E HTTP/1.1" 200 2 "-" "Synapse/1.66.0"\n'
]
Sep-5 03:28:37.076 [bot-sdkAppservice] info: [ 'Processing transaction 88401' ]
Sep-5 03:28:37.077 [bot-sdkAppservice] info: [ 'Processing event of type m.room.message' ]
Sep-5 03:28:37.098 [bot-sdkAppservice] info: [
  '127.0.0.1 - - [05/Sep/2022:06:28:37 +0000] "PUT /transactions/88401?access_token=%3Credacted%3E HTTP/1.1" 200 2 "-" "Synapse/1.66.0"\n'
]
Sep-5 03:28:37.279 [bot-sdkAppservice] info: [ 'Processing transaction 88402' ]
Sep-5 03:28:37.280 [bot-sdkAppservice] info: [ 'Processing event of type m.room.message' ]
Sep-5 03:28:37.287 [bot-sdkAppservice] info: [
  '127.0.0.1 - - [05/Sep/2022:06:28:37 +0000] "PUT /transactions/88402?access_token=%3Credacted%3E HTTP/1.1" 200 2 "-" "Synapse/1.66.0"\n'
]
Sep-5 03:28:44.736 [bot-sdkAppservice] info: [ 'Processing transaction 88403' ]
Sep-5 03:28:44.737 [bot-sdkAppservice] info: [ 'Processing event of type m.room.message' ]
Sep-5 03:28:44.858 [bot-sdkAppservice] info: [
  '127.0.0.1 - - [05/Sep/2022:06:28:44 +0000] "PUT /transactions/88403?access_token=%3Credacted%3E HTTP/1.1" 200 2 "-" "Synapse/1.66.0"\n'
]
Sep-5 03:29:00.939 [bot-sdkAppservice] info: [ 'Processing transaction 88404' ]
Sep-5 03:29:00.939 [bot-sdkAppservice] info: [ 'Processing event of type m.room.message' ]
Sep-5 03:29:00.953 [bot-sdkAppservice] info: [
  '127.0.0.1 - - [05/Sep/2022:06:29:00 +0000] "PUT /transactions/88404?access_token=%3Credacted%3E HTTP/1.1" 200 2 "-" "Synapse/1.66.0"\n'
]
Sep-5 03:29:00.967 [MatrixCommandHandler] info: Bridging matrix room !YdeurdghOSjTARrhBj:bienvenidoainternet.org to 780149015542235136/816504907536007198
Sep-5 03:29:01.072 [bot-sdkAppservice] info: [ 'Processing transaction 88405' ]
Sep-5 03:29:01.073 [bot-sdkAppservice] info: [ 'Processing event of type m.room.message' ]
Sep-5 03:29:01.079 [bot-sdkAppservice] info: [
  '127.0.0.1 - - [05/Sep/2022:06:29:01 +0000] "PUT /transactions/88405?access_token=%3Credacted%3E HTTP/1.1" 200 2 "-" "Synapse/1.66.0"\n'
]

As seen in the logs, the homeserver is now Synapse/1.66 since I updated it to see if that was the issue. The problem started suddenly when no change was made to the server at all.

z411 avatar Sep 05 '22 06:09 z411

Experiencing the same issue. Perhaps Discord has gone through with requiring higher "intents" in their API to read messages? So annoying...

luphoria avatar Sep 05 '22 14:09 luphoria

Glad to know I'm not the only one. It also seems to me Discord might've changed something on their end...

z411 avatar Sep 05 '22 18:09 z411

It's my speculation that's what happened because that's what they have been pushing for with their "intents API" for the new slash-command bots

luphoria avatar Sep 05 '22 18:09 luphoria

image I found that I already had Message Content Intent enabled. This will probably have to be fixed upstream :(

luphoria avatar Sep 05 '22 18:09 luphoria

Same here. I tried enabling the intents and also kicking out and re-inviting the bot to the Discord guild to no avail. It keeps relaying name and avatar changes though, it's really weird.

z411 avatar Sep 05 '22 18:09 z411

@luphoria I managed to fix the issue. I updated the bot (git pull), recompiled it, and recreated the discord-registration.yaml file with the node build/src/discordas.js -r -u "http://localhost:9005" -c config.yaml command then copied it again to the Synapse installation. I also deleted discord.db (although this shouldn't be done but it didn't do any harm in my case) then restarted and rebridged all the roms. Everything works perfectly now. Apparently something got fixed, and I had updated but I had to recreate the discord-registration.yaml file. Tell me if it works for you.

z411 avatar Sep 06 '22 02:09 z411

@luphoria I managed to fix the issue. I updated the bot (git pull), recompiled it, and recreated the discord-registration.yaml file with the node build/src/discordas.js -r -u "http://localhost:9005" -c config.yaml command then copied it again to the Synapse installation. I also deleted discord.db (although this shouldn't be done but it didn't do any harm in my case) then restarted and rebridged all the roms. Everything works perfectly now. Apparently something got fixed, and I had updated but I had to recreate the discord-registration.yaml file. Tell me if it works for you.

I don't know how to do any of this, I just bundled the matrix-as-discord with the ansible playbook. But i will get around to trying to tinker this soon

luphoria avatar Sep 12 '22 02:09 luphoria

same problem here ... (but not for all bridged channels it looks like)

verymilan avatar Oct 02 '22 17:10 verymilan

I had to set usePrivilegedIntents: true today in order to get Discord ----> Matrix messages flowing so this is likely still a general issue for people.

Services were setup today on the most recent Synapse ("1.70.1") / bridging client version (commit: ac5180ed11e67ea9c1e6467941148b90dd122fb5) using docker.

Aterfax avatar Nov 02 '22 01:11 Aterfax

Thank you, I'll try enabling this.

z411 avatar Nov 02 '22 02:11 z411

Thank you, I'll try enabling this.

Make sure to also enable it on the Discord bot permissions as shown a bit further above at https://discord.com/developers/applications/$YOUR_BOT_ID/bot :

image

Aterfax avatar Nov 02 '22 02:11 Aterfax

I can confirm that this helped, thanks!

verymilan avatar Nov 02 '22 14:11 verymilan