Closed TheNamelessWonderer closed 1 year ago
Out of interest, what does your registration file namespace section look like?
It is the default:
namespaces:
aliases:
- exclusive: true
regex: '#_discord_.*'
rooms: []
users:
- exclusive: true
regex: '@_discord_.*'
I regenerated the discord-registration.yaml file and changed the regex to @_discord_.*:domain.org
. This seems to have fixed it! Not sure if this should be added to the readme or not. I'll close it for now and will reopen it if it happens again. Thank you!
Thanks, this seemed to fix the issue on my end too. If your discord database has old t2bot.io profiles, the bridge tries to use those as well even you dont own them.
Reopening this as it is happening to other people. I think either the readme needs to be updated or the program that generates the file needs to be changed.
Just ran into this as well.. How are t2bot.io profiles getting into my DB in the first place?
edit: sqlite3 db/discord.db .dump | grep -i t2bot
returns no matches, so maybe there's some incorrect user lookup or fallback being used?
For completeness, here are the errors I see in debug.log:
Aug-15 00:14:06.920 [bot-sdkAppservice] ESC[32minfoESC[39m: [ 'Processing transaction 47324' ]
Aug-15 00:14:06.923 [bot-sdkAppservice] ESC[32minfoESC[39m: [ 'Processing event of type m.room.member' ]
Aug-15 00:14:06.946 [bot-sdkMatrixHttpClient] ESC[31merrorESC[39m: [
'(REQ-1004)',
{
errcode: 'M_FORBIDDEN',
error: 'Application service has not registered this user (@_discord_795964964799119391:t2bot.io)'
}
]
Aug-15 23:24:10.298 [bot-sdkAppservice] ESC[32minfoESC[39m: [ 'Processing transaction 47324' ]
Aug-15 23:24:10.299 [bot-sdkAppservice] ESC[32minfoESC[39m: [ 'Processing event of type m.room.member' ]
Aug-15 23:24:10.310 [bot-sdkMatrixHttpClient] ESC[31merrorESC[39m: [
'(REQ-1006)',
{
errcode: 'M_FORBIDDEN',
error: 'Application service cannot masquerade as this user (@_discord_795964964799119391:t2bot.io).'
}
]
Neither 795964964799119391
nor t2bot
appear in my DB, and it's not clear to me where the UID is coming from.
It'll be from another room on your server - the hint is "Processing event of type m.room.member". Essentially, because of the wide namespace in the registration, the bridge is being sent events related to any discord bridge and the bridge appears to have forgotten it's not supposed to do anything with ones not from its server.
ahh, indeed, updating the registration file as mentioned in https://github.com/matrix-org/matrix-appservice-discord/issues/831#issuecomment-1213460270 fixes the issue. (I forgot that the setup guide tells to copy that file into the homeserver config file, and I forgot to change both copies)
Resetting / clearing the DB does not seem to be necessary.
Describe the bug The bridge is crashing with M_FORBIDDEN error. I do not use t2bot.io so I don't know why this error is appearing.
To Reproduce Steps to reproduce the behavior:
Expected behavior The bot should not crash
Logs
Additional context The bridge has been working fine for months before this error. Now it won't join rooms or sent from matrix to discord. Discord to matrix works fine though.