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

Slack users are invited and leave constantly #711

Open
LudvigHz opened this issue Oct 25, 2022 · 3 comments
Open

Slack users are invited and leave constantly #711

LudvigHz opened this issue Oct 25, 2022 · 3 comments
Labels
S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect Bugs, crashes, hangs, vulnerabilities, or other reported problems.

Comments

@LudvigHz
Copy link

When teamSync is enabled, the matrix-bot version of members of a slack channel are invited and leave constantly. For a slack workspace with ~100 members, this has over the course of a couple months gotten to the point that there are 40GB(!!) worth of events in our synapse postgres database.

There doesn't seem to be a lot of patterns to when and who gets invited and leaves, but it does seem to happen a lot more every time the service is restarted.
F.ex. in element, a channel will be filled with "User x was invited, joined and left..." with about ~100 of the invited, joined and left in the course of a minute (when service is restarted). i.e. a couple thousand events in total.

In normal use, there will be maybe between 2 - 100 invited, joined and left events every day. (no one has left or joined the channel in slack during this time)

Note that none of these users are linked to a matrix account, and they "exist" only in slack.

The appservice logs also have a lot of these messages at the time the issues appear:

Oct 25 10:06:10 matrix matrix-appservice-slack[2506778]: Oct-25 10:06:10.422 INFO bridge 172.18.0.6 - - [25/Oct/2022:10:06:10 +0000] "PUT /transactions/7475931?access_token=<REDACTED> HTTP/1.1" 200 2 "-" "Synapse/1.63.1"
Oct 25 10:06:10 matrix matrix-appservice-slack[2506778]: MatrixHttpClient (REQ-1134) {
Oct 25 10:06:10 matrix matrix-appservice-slack[2506778]:   errcode: 'M_FORBIDDEN',
Oct 25 10:06:10 matrix matrix-appservice-slack[2506778]:   error: 'You do not belong to any of the required rooms/spaces to join this room.'
Oct 25 10:06:10 matrix matrix-appservice-slack[2506778]: }

System info

  • synapse version: 1.63.1
  • appservice-slack: 0.11
  • OS: Ubuntu 20.04
@Half-Shot Half-Shot added S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect Bugs, crashes, hangs, vulnerabilities, or other reported problems. labels Oct 25, 2022
@LudvigHz
Copy link
Author

Attatching some more logs here that appeared as a result of a recent startup (or crash rather :/):

	Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-133) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-136) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-135) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Oct-25 22:14:45.513 INFO TeamSyncer Joining 15 ghosts to !QdKombEAbsEheNRZpJ:abakus.no
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Oct-25 22:14:45.513 INFO TeamSyncer Leaving 47 ghosts to !QdKombEAbsEheNRZpJ:abakus.no
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-137) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-138) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-140) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-139) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-141) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-142) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-143) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-146) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-145) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-144) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Oct-25 22:14:45.538 INFO TeamSyncer Joining 10 ghosts to !gUaTWsRbiudxzzOrGi:abakus.no
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Oct-25 22:14:45.539 INFO TeamSyncer Leaving 32 ghosts to !gUaTWsRbiudxzzOrGi:abakus.no
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-148) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-147) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Oct-25 22:14:45.586 INFO TeamSyncer Joining 29 ghosts to !rajFKdCajtshMfUGbr:abakus.no
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Oct-25 22:14:45.586 INFO TeamSyncer Leaving 31 ghosts to !rajFKdCajtshMfUGbr:abakus.no
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-149) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-151) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-150) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-157) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-161) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-160) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-164) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-166) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-165) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-169) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-162) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-154) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-167) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-171) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-159) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-163) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-170) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-153) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-156) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-168) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-158) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-152) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-155) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-174) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-172) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-175) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-178) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-177) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-173) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-180) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-176) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-179) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Appservice Error registering user: User ID is in use
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Oct-25 22:14:45.680 INFO TeamSyncer Joining 1 ghosts to !ltZiZxFLyXAJRTqMVi:abakus.no
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: Oct-25 22:14:45.680 INFO TeamSyncer Leaving 53 ghosts to !ltZiZxFLyXAJRTqMVi:abakus.no
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-182) {
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]:   errcode: 'M_FORBIDDEN',
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]:   error: 'You do not belong to any of the required rooms/spaces to join this room.'
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-183) {
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]:   errcode: 'M_FORBIDDEN',
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]:   error: 'You do not belong to any of the required rooms/spaces to join this room.'
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: }
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: MatrixHttpClient (REQ-181) {
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]:   errcode: 'M_FORBIDDEN',
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]:   error: 'You do not belong to any of the required rooms/spaces to join this room.'
Oct 25 22:14:45 matrix matrix-appservice-slack[3583165]: }

Note the joining and leaving of bot users.
I don't know if part of the issue is that the TeamSyncer seems to not be aware that users and channels are synced already? Or if the Error (User ID is in use) is expected and this is how it handles subsequent syncs.

@olmari
Copy link

olmari commented Jan 13, 2023

#661 I think it's the asme

@ayushin
Copy link

ayushin commented Jul 25, 2023

any idea how to remove those events from the database? I have the same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect Bugs, crashes, hangs, vulnerabilities, or other reported problems.
Projects
None yet
Development

No branches or pull requests

4 participants