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

Cannot change role #30368

Open
1 task done
duburcqa opened this issue Jun 9, 2024 · 5 comments
Open
1 task done

Cannot change role #30368

duburcqa opened this issue Jun 9, 2024 · 5 comments

Comments

@duburcqa
Copy link

duburcqa commented Jun 9, 2024

I cannot change the role of a given user from 'guest' to 'member'. It seems to be related to 'member' role in particular since I can make it 'moderator' and back to 'guest'.

Here is the traceback when trying to apply changes using CLI:

su zulip -c '/home/zulip/deployments/current/manage.py change_user_role -r "" ******** member'
Traceback (most recent call last):
  File "/srv/zulip-venv-cache/a4e7b645b4c17d42a3bdf95617ff04503a56b6fc/zulip-py3-venv/lib/python3.10/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
  File "/home/zulip/deployments/2024-05-21-11-11-07/zerver/lib/db.py", line 38, in execute
    wrapper_execute(self, super().execute, query, vars)
  File "/home/zulip/deployments/2024-05-21-11-11-07/zerver/lib/db.py", line 21, in wrapper_execute
    action(sql, params)
psycopg2.errors.UniqueViolation: duplicate key value violates unique constraint "zerver_usergroupmembersh_user_group_id_user_profi_5b32ea4b_uniq"
DETAIL:  Key (user_group_id, user_profile_id)=(12, 17) already exists.

To give some context, I imported a slack database after creating the realm a few months ago. It is very likely that have deleted some old users that became irrelevant after migration. I don't know if it is related.

Zulip Server and web app version:

  • Zulip Server 8.0+
@duburcqa duburcqa added the bug label Jun 9, 2024
@amenu4aie2
Copy link
Collaborator

@zulipbot claim

@zulipbot
Copy link
Member

zulipbot commented Jun 9, 2024

Hello @amenu4aie2!

Thanks for your interest in Zulip! You have attempted to claim an issue without the label "help wanted". You can only claim and submit pull requests for issues with the help wanted label.

If this is your first time here, we recommend reading our guide for new contributors before getting started.

@duburcqa
Copy link
Author

@zulipbot It is no consistent with the procedure described here. I'm not a contributor and I'm not planning to become one. I'm just reporting what looks like to be a bug for me, without the intention of fixing it.

@timabbott
Copy link
Sponsor Member

The bot was replying to @amenu4aie2, not you, who appears to be a confused potential new contributor.

The exception suggests that the user in question might already have that role? The user group name for the system user group with ID 12 would be quite helpful for debugging this. Might be best for you to stop by chat.zulip.org so we debug in a better convenient place.

@zulipbot
Copy link
Member

Hello @zulip/server-misc members, this issue was labeled with the "area: export/import" label, so you may want to check it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants