500 Error on sign up
Summary
500 error page thrown on sign up
Steps to reproduce
On April 19, 2023 @p_cordero attempted to sign up for a trial via https://gitlab.com/-/trial_registrations/new
- "first_name"=>"Test"
- "last_name"=>"04192023"
- "username"=>"test04192023"
- "email"=>"pcordero+test04192023@gitlab.com"
Upon clicking Continue
I was directed to the following 500 page instead of account verification.
Note: I attempted to click Continue
a 2nd time and got the same error. I then tried to create a trial with new inputs and did not get the same error. I then tried to create a trial again with the original input and did not get the error again.
What is the current bug behavior?
500 error page
What is the expected correct behavior?
Account verification/confirmation
Relevant logs and/or screenshots
Errors can be seen in https://log.gprd.gitlab.net using the query: json.action:"create" AND json.status:500 AND json.exception.class:"ActiveRecord::RecordNotUnique"
From an initial investigation with @kniechajewicz & @dstull on slack:
confirmation token duplicate...
PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_users_on_confirmation_token"
DETAIL: Key (confirmation_token)=(31adf6fac7eaed4b85d21838667ff57650667077027794402878056d0c6b8098) already exists.
https://files.slack.com/files-pri/T03N1RJJX7C-F054R0T5MMW/image.png
here is the generation algo - https://gitlab.com/gitlab-org/gitlab/-/blob/d2f051825c65ed6688400fcbabd0fe8639a89ecf/app/services/users/email_verification/generate_token_service.rb#L17-17
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)