Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Failed to remove user from community #5144

Closed
popindavibe opened this issue May 6, 2019 · 3 comments
Closed

Failed to remove user from community #5144

popindavibe opened this issue May 6, 2019 · 3 comments
Labels
z-bug (Deprecated Label) z-p2 (Deprecated Label)

Comments

@popindavibe
Copy link

Description

When, as the admin of the community, I remove a user which is not a local user, I get the following message in the client:

Error
Failed to remove user from community

Please note that the user ends up in a between state, not in the list of members any more but still having visibility over the community (even after reload / sign out / sign in). Actually that user cannot leave the community either once he doesn't appear in the members' list.

Steps to reproduce

  • Invite a user external to your local instance to a community
  • That user accepts the invitation
  • As the admin of the community, remove that user
    That's when I get the error message and end up with a half-way removed user stuck with that community
  • I think the removed user can also still claim the Flair/badge

Expected

Same behaviour for local/ external users, whether they leave on their own or are kicked out.

Also please note that if the external user chooses to leave on his own, there are no issues, he leaves as a member and the community disappears as well.

From the synapse server I get:

May 06 17:52:54 allium python[31727]: 2019-05-06 17:52:54,012 - synapse.http.server - 112 - ERROR - PUT-767- Failed handle request via 'GroupAdminUsersKickServlet': <XForwardedForRequest at 0x7f155ff41c50 method='PUT' uri='/_matrix/client/r0/groups/%2Bacmecorp%3Amatrix.example.com/admin/users/remove/%40acmecorp%3Amatrix.org' clientproto='HTTP/1.1' site=8008>
May 06 17:52:54 allium python[31727]: Traceback (most recent call last):
May 06 17:52:54 allium python[31727]:   File "/opt/venvs/matrix-synapse/lib/python3.5/site-packages/synapse/http/server.py", line 81, in wrapped_request_handler
May 06 17:52:54 allium python[31727]:     yield h(self, request)
May 06 17:52:54 allium python[31727]:   File "/opt/venvs/matrix-synapse/lib/python3.5/site-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks
May 06 17:52:54 allium python[31727]:     result = result.throwExceptionIntoGenerator(g)
May 06 17:52:54 allium python[31727]:   File "/opt/venvs/matrix-synapse/lib/python3.5/site-packages/twisted/python/failure.py", line 512, in throwExceptionIntoGenerator
May 06 17:52:54 allium python[31727]:     return g.throw(self.type, self.value, self.tb)
May 06 17:52:54 allium python[31727]:   File "/opt/venvs/matrix-synapse/lib/python3.5/site-packages/synapse/http/server.py", line 316, in _async_render
May 06 17:52:54 allium python[31727]:     callback_return = yield callback(request, **kwargs)
May 06 17:52:54 allium python[31727]:   File "/opt/venvs/matrix-synapse/lib/python3.5/site-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks
May 06 17:52:54 allium python[31727]:     result = result.throwExceptionIntoGenerator(g)
May 06 17:52:54 allium python[31727]:   File "/opt/venvs/matrix-synapse/lib/python3.5/site-packages/twisted/python/failure.py", line 512, in throwExceptionIntoGenerator
May 06 17:52:54 allium python[31727]:     return g.throw(self.type, self.value, self.tb)
May 06 17:52:54 allium python[31727]:   File "/opt/venvs/matrix-synapse/lib/python3.5/site-packages/synapse/rest/client/v2_alpha/groups.py", line 575, in on_PUT
May 06 17:52:54 allium python[31727]:     group_id, user_id, requester_user_id, content,
May 06 17:52:54 allium python[31727]:   File "/opt/venvs/matrix-synapse/lib/python3.5/site-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks
May 06 17:52:54 allium python[31727]:     result = result.throwExceptionIntoGenerator(g)
May 06 17:52:54 allium python[31727]:   File "/opt/venvs/matrix-synapse/lib/python3.5/site-packages/twisted/python/failure.py", line 512, in throwExceptionIntoGenerator
May 06 17:52:54 allium python[31727]:     return g.throw(self.type, self.value, self.tb)
May 06 17:52:54 allium python[31727]:   File "/opt/venvs/matrix-synapse/lib/python3.5/site-packages/synapse/handlers/groups_local.py", line 408, in remove_user_from_group
May 06 17:52:54 allium python[31727]:     group_id, user_id, requester_user_id, content,
May 06 17:52:54 allium python[31727]:   File "/opt/venvs/matrix-synapse/lib/python3.5/site-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks
May 06 17:52:54 allium python[31727]:     result = result.throwExceptionIntoGenerator(g)
May 06 17:52:54 allium python[31727]:   File "/opt/venvs/matrix-synapse/lib/python3.5/site-packages/twisted/python/failure.py", line 512, in throwExceptionIntoGenerator
May 06 17:52:54 allium python[31727]:     return g.throw(self.type, self.value, self.tb)
May 06 17:52:54 allium python[31727]:   File "/opt/venvs/matrix-synapse/lib/python3.5/site-packages/synapse/groups/groups_server.py", line 812, in remove_user_from_group
May 06 17:52:54 allium python[31727]:     get_domain_from_id(user_id), group_id, user_id, {}
May 06 17:52:54 allium python[31727]:   File "/opt/venvs/matrix-synapse/lib/python3.5/site-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks
May 06 17:52:54 allium python[31727]:     result = result.throwExceptionIntoGenerator(g)
May 06 17:52:54 allium python[31727]:   File "/opt/venvs/matrix-synapse/lib/python3.5/site-packages/twisted/python/failure.py", line 512, in throwExceptionIntoGenerator
May 06 17:52:54 allium python[31727]:     return g.throw(self.type, self.value, self.tb)
May 06 17:52:54 allium python[31727]:   File "/opt/venvs/matrix-synapse/lib/python3.5/site-packages/synapse/http/matrixfederationclient.py", line 639, in post_json
May 06 17:52:54 allium python[31727]:     ignore_backoff=ignore_backoff,
May 06 17:52:54 allium python[31727]:   File "/opt/venvs/matrix-synapse/lib/python3.5/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
May 06 17:52:54 allium python[31727]:     result = g.send(result)
May 06 17:52:54 allium python[31727]:   File "/opt/venvs/matrix-synapse/lib/python3.5/site-packages/synapse/http/matrixfederationclient.py", line 427, in _send_request
May 06 17:52:54 allium python[31727]:     raise e
May 06 17:52:54 allium python[31727]: synapse.api.errors.HttpResponseException: 400: b'Bad Request'

Version information

  • Homeserver: another homeserver

  • Version: Server: Synapse/0.99.3.2 (first identified on 0.99.3.1)

  • Install method: Package manager

  • Platform: Debian Stretch

@neilisfragile neilisfragile added z-bug (Deprecated Label) z-p2 (Deprecated Label) communities labels May 7, 2019
@thegcat
Copy link
Contributor

thegcat commented Apr 29, 2020

I can confirm this behaviour. As this happens between 2 servers I administer, I can offer the view from the receiving end:

Apr 29 23:05:34 matrix matrix-synapse[633]: 2020-04-29 23:05:34,874 - synapse.http.servlet - 228 - WARNING - POST-601524 - Unable to parse JSON: Expecting value: line 1 column 1 (char 0)
Apr 29 23:05:34 matrix matrix-synapse[633]: 2020-04-29 23:05:34,874 - synapse.http.server - 81 - INFO - POST-601524 - <XForwardedForRequest at 0x7f6d77e87210 method='POST' uri='/_matrix/federation/v1/groups/local/%2B480%3Akif.rocks/users/%40thegcat%3Afachschaften.org/remove' clientproto='HTTP/1.1' site=8008> SynapseError: 400 - Content not JSON.
Apr 29 23:05:34 matrix matrix-synapse[633]: 2020-04-29 23:05:34,875 - synapse.access.http.8008 - 302 - INFO - POST-601524 - 10.0.42.202 - 8008 - {None} Processed request: 0.001sec/0.000sec (0.000sec, 0.000sec) (0.000sec/0.000sec/0) 52B 400 "POST /_matrix/federation/v1/groups/local/%2B480%3Akif.rocks/users/%40thegcat%3Afachschaften.org/remove HTTP/1.1" "Synapse/1.12.4" [0 dbevts]

@thegcat
Copy link
Contributor

thegcat commented Apr 29, 2020

Any idea where I would go looking to see why no json was passed and/or which side expects something that's not up to spec?

@clokep
Copy link
Member

clokep commented Apr 26, 2022

Communities/groups are being removed, see #11584.

@clokep clokep closed this as completed Apr 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
z-bug (Deprecated Label) z-p2 (Deprecated Label)
Projects
None yet
Development

No branches or pull requests

4 participants