[6.2] Error 500 after creating user with existing email address
Created by: gopeter
Summary/Reproducing: While trying to add an user with an email that exists already, Gitlab 6.2 throws an error 500. Gitlab version: 6.2: 5123d706 Application check: everything's fine (see output below) Logs: production.log:
Started POST "/admin/users" for 127.0.0.1 at 2013-10-24 12:32:08 +0200
Processing by Admin::UsersController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"+rFoUu5iWgPSBG9ZAEnZpsjikA0Oi7XDLiPwpmssM5Y=", "user"=>{"name"=>"test2", "username"=>"test2", "email"=>"MY_EMAIL_ADDRESS", "projects_limit"=>"10", "can_create_group"=>"1", "admin"=>"0$
Completed 500 Internal Server Error in 24ms
ActiveRecord::RecordNotUnique (Mysql2::Error: Duplicate entry 'MY_EMAIL_ADDRESS' for key 'index_users_on_email': INSERT INTO `users` (`admin`, `authentication_token`, `avatar`, `bio`, `can_create_group`, `can_create_team`, `color_sche$
app/controllers/admin/users_controller.rb:50:in `create'
app/controllers/application_controller.rb:54:in `set_current_user_for_thread'
Setup:
System information
System: Ubuntu 12.04
Current User: git
Using RVM: no
Ruby Version: 2.0.0p247
Gem Version: 2.0.3
Bundler Version:1.3.5
Rake Version: 10.1.0
GitLab information
Version: 6.2.0
Revision: 5123d70
Directory: /home/git/gitlab
DB Adapter: mysql2
URL: http://MY_URL
HTTP Clone URL: http://MY_URL/some-project.git
SSH Clone URL: git@MY_URL:some-project.git
Using LDAP: no
Using Omniauth: no
GitLab Shell
Version: 1.7.1
Repositories: /home/git/repositories/
Hooks: /home/git/gitlab-shell/hooks/
Git: /usr/bin/git
Application check:
Checking Environment ...
Git configured for git user? ... yes
Has python2? ... yes
python2 is supported version? ... yes
Checking Environment ... Finished
Checking GitLab Shell ...
GitLab Shell version >= 1.7.1 ? ... OK (1.7.1)
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by git:git? ... yes
Repo base access is drwxrws---? ... yes
update hook up-to-date? ... yes
update hooks in repos are links: ...
MY_REPOSITORIES ... ok
Running /home/git/gitlab-shell/bin/check
Check GitLab API access: OK
Check directories and files:
/home/git/repositories: OK
/home/git/.ssh/authorized_keys: OK
gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes
Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking GitLab ...
Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... yes
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Init script exists? ... yes
Init script up-to-date? ... yes
projects have namespace: ...
MY_PROJECTS ... yes
Projects have satellites? ...
MY_SATELLITES ... yes
Redis version >= 2.0.0? ... yes
Your git bin path is "/usr/bin/git"
Git version >= 1.7.10 ? ... yes (1.8.4)
Checking GitLab ... Finished