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

Cannot set a user as an admin with the admin API #6910

Closed

Description

@turt2live
2020-02-13 19:15:53,449 - synapse.http.server - 110 - ERROR - PUT-31 - Failed handle request via 'UserRestServletV2': <SynapseRequest at 0x7f6a6035bfd0 method='PUT' uri='/_synapse/admin/v2/users/@mjolnir-dev:redacted' clientproto='HTTP/1.0' site=8008>
Traceback (most recent call last):
  File "/home/matrix/.synapse/local/lib/python3.6/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
StopIteration: {'displayname': 'mjolnir-dev', 'avatar_url': None}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/matrix/.synapse/local/lib/python3.6/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
StopIteration: {'displayname': 'mjolnir-dev', 'avatar_url': None}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/matrix/.synapse/local/lib/python3.6/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
StopIteration: ProfileInfo(avatar_url=None, display_name='mjolnir-dev')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/matrix/.synapse/local/lib/python3.6/site-packages/synapse/http/server.py", line 78, in wrapped_request_handler
    await h(self, request)
  File "/home/matrix/.synapse/local/lib/python3.6/site-packages/synapse/http/server.py", line 331, in _async_render
    callback_return = await callback_return
  File "/home/matrix/.synapse/local/lib/python3.6/site-packages/synapse/rest/admin/users.py", line 185, in on_PUT
    await self.admin_handler.set_user_server_admin(
AttributeError: 'AdminHandler' object has no attribute 'set_user_server_admin'

Synapse 1.10

Request:

curl -s -X PUT -H "Authorization: Bearer ${token}" -H "Content-Type: application/json" -d '{"admin":true}' https://dev.t2host.io/_synapse/admin/v2/users/@mjolnir-dev:redacted
{
    "errcode": "M_UNKNOWN",
    "error": "Internal server error"
}

Activity

  1. richvdh commented on Feb 14, 2020

    @richvdh
    Member

    I think this was introduced by #6751

  2. dklimpel commented on Feb 15, 2020

    @dklimpel
    Contributor

    Also old api (/_synapse/admin/v1/users/<user_id>/admin) is broken

  3. changed the title [-]Cannot set a user as an admin with the new API[/-] [+]Cannot set a user as an admin with the admin API[/+] on Feb 20, 2020
  4. Cadair commented on Feb 21, 2020

    @Cadair
    Contributor

    This has just bit me as well, I had no idea why it was misbehaving until @Half-Shot pointed me at this.

  5. richvdh commented on Feb 21, 2020

    @richvdh
    Member

    @dklimpel has made a PR to fix this at #6928; hopefully it will land soon.

  6. added 2 commits that reference this issue on Feb 28, 2020
    9b06d8f
    bbeee33
  7. added a commit that references this issue on Apr 15, 2020
    9140a06
  8. added a commit that references this issue on May 15, 2020
    37f7baa
  9. added a commit that references this issue on Jun 16, 2020
    25c28e6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions