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

Unable to merge a user when they have initiated a password reset #7575

Closed
kaitlinnewson opened this issue Feb 2, 2021 · 2 comments · Fixed by #7629
Closed

Unable to merge a user when they have initiated a password reset #7575

kaitlinnewson opened this issue Feb 2, 2021 · 2 comments · Fixed by #7629

Comments

@kaitlinnewson
Copy link
Contributor

This issue was found in version 5.1.1 in Scholars Portal Dataverse. Apologies in advance if this has since been resolved!

When using the "merge user" API, the command appears to fail if the user has initiated a password reset.

The following messaging was in the server.log file, which suggests some data connected to the user is still in the passwordresetdata table and is preventing the merge:

Internal Exception: org.postgresql.util.PSQLException: ERROR: update or delete on table "builtinuser" violates foreign key constraint "fk_passwordresetdata_builtinuser_id" on table "passwordresetdata"
  Detail: Key (id)=(2232) is still referenced from table "passwordresetdata".
Error Code: 0
@pdurbin pdurbin self-assigned this Feb 3, 2021
@djbrooke
Copy link
Contributor

djbrooke commented Feb 4, 2021

Thanks @kaitlinnewson - we'll take a look at this as part of some work we're doing on deleting users.

pdurbin added a commit that referenced this issue Feb 5, 2021
Primarily this has been an investigation into existing code for
deleting and merging users. Additionally, a "get user traces"
command was added to get a sense of why a user can't be deleted
or what would be merged. The top of DeleteUsersIT has a lengthy
comment about which database tables are in play and a variety
of scenarios involving users to be deleted, merged or (in the
future) disabled (#2419).

The following bugs where fixed:

- Unable to merge (or delete) a user when they have initiated
a password reset. #7575
- Delete OAuth2 tokens on delete.
@pdurbin
Copy link
Member

pdurbin commented Feb 19, 2021

@kaitlinnewson thanks for the bug report. This should be fixed in 1c5d632 in pull request #7629 (added passwordResetService.deleteResetDataByDataverseUser(user)).

@pdurbin pdurbin removed their assignment Feb 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants