"There was an error removing the e-mail" when removing secondary email address as an admin
Summary
If an admin changes an account's email address, their original address is set as secondary.
The admin can then remove the secondary.
A red status bar appears at the top of the screen: There was an error removing the e-mail
No error is apparent in the logs, but I've included them, and someone else might spot it
Steps to reproduce
Reproduced on 12.8.6-ee (5b0bcf2717b)
self-managed
- Find or create a test account in the admin area.
- Edit the properties of that account (button, top right); change their email.
- The now have a primary and secondary.
gitlab-ctl tail output
==> /var/log/gitlab/gitlab-workhorse/current <== {"correlation_id":"UGrJurtaOr4","duration_ms":0,"host":"bprescott-gitlabtest-0.do.gitlap.com","level":"info","method":"POST","msg":"access","proto":"HTTP/1.1","referrer":"","remote_addr":"178.128.45.166:0","remote_ip":"178.128.45.166","status":204,"system":"http","time":"2020-03-20T16:42:44Z","uri":"/api/v4/jobs/request","user_agent":"gitlab-runner 12.8.0 (12-8-stable; go1.13.7; linux/amd64)","written_bytes":0}
==> /var/log/gitlab/nginx/gitlab_access.log <== 178.128.45.166 - - [20/Mar/2020:16:42:44 +0000] "POST /api/v4/jobs/request HTTP/1.1" 204 0 "" "gitlab-runner 12.8.0 (12-8-stable; go1.13.7; linux/amd64)"
==> /var/log/gitlab/gitlab-rails/production.log <== Started GET "/-/metrics" for 127.0.0.1 at 2020-03-20 16:42:46 +0000 Processing by MetricsController#index as HTML Completed 200 OK in 57ms (Views: 0.6ms | ActiveRecord: 0.0ms | Elasticsearch: 0.0ms | Allocations: 1210) Started PATCH "/admin/users/test20200203" for 217.169.1.226 at 2020-03-20 16:42:47 +0000 Processing by Admin::UsersController#update as HTML Parameters: {"utf8"=>"✓", "authenticity_token"=>"[FILTERED]", "user"=>{"name"=>"test20200203", "username"=>"test20200203", "email"=>"bar1234@example.com", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]", "projects_limit"=>"100000", "can_create_group"=>"1", "access_level"=>"regular", "external"=>"0", "namespace_attributes"=>{"id"=>"9", "shared_runners_minutes_limit"=>""}, "skype"=>"", "linkedin"=>"", "twitter"=>"", "website_url"=>"", "note"=>"[FILTERED]"}, "id"=>"test20200203"} Redirected to https://bprescott-gitlabtest-0.do.gitlap.com/admin/users/test20200203 Completed 302 Found in 70ms (ActiveRecord: 16.5ms | Elasticsearch: 0.0ms | Allocations: 17737) Started GET "/admin/users/test20200203" for 217.169.1.226 at 2020-03-20 16:42:47 +0000 Processing by Admin::UsersController#show as HTML Parameters: {"id"=>"test20200203"} Completed 200 OK in 82ms (Views: 52.3ms | ActiveRecord: 10.2ms | Elasticsearch: 0.0ms | Allocations: 36723)
==> /var/log/gitlab/gitlab-rails/production_json.log <== {"method":"GET","path":"/-/metrics","format":"html","controller":"MetricsController","action":"index","status":200,"duration":57.34,"view":0.61,"db":0.0,"time":"2020-03-20T16:42:46.926Z","params":[],"remote_ip":null,"user_id":null,"username":null,"ua":null,"queue_duration":null,"correlation_id":"766a94a6-6cb3-46d3-a801-5c8a58bd1ada","cpu_s":0.06697606600005201} {"method":"PATCH","path":"/admin/users/test20200203","format":"html","controller":"Admin::UsersController","action":"update","status":302,"duration":69.69,"view":0.0,"db":16.54,"location":"https://bprescott-gitlabtest-0.do.gitlap.com/admin/users/test20200203","time":"2020-03-20T16:42:47.389Z","params":[{"key":"utf8","value":"✓"},{"key":"_method","value":"patch"},{"key":"authenticity_token","value":"[FILTERED]"},{"key":"user","value":{"name":"test20200203","username":"test20200203","email":"bar1234@example.com","password":"[FILTERED]","password_confirmation":"[FILTERED]","projects_limit":"100000","can_create_group":"1","access_level":"regular","external":"0","namespace_attributes":{"id":"9","shared_runners_minutes_limit":""},"skype":"","linkedin":"","twitter":"","website_url":"","note":"[FILTERED]"}},{"key":"id","value":"test20200203"}],"remote_ip":"217.169.1.226","user_id":1,"username":"bprescott-root","ua":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0","queue_duration":7.52,"correlation_id":"gu4O9dqS0U4","cpu_s":0.06444800099995973} {"method":"GET","path":"/admin/users/test20200203","format":"html","controller":"Admin::UsersController","action":"show","status":200,"duration":82.14,"view":52.26,"db":10.21,"time":"2020-03-20T16:42:47.519Z","params":[{"key":"id","value":"test20200203"}],"remote_ip":"217.169.1.226","user_id":1,"username":"bprescott-root","ua":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0","queue_duration":7.33,"correlation_id":"MeLE8Pl8Cq8","cpu_s":0.08993227899998146}
==> /var/log/gitlab/gitlab-rails/audit_json.log <== {"severity":"INFO","time":"2020-03-20T16:42:47.372Z","correlation_id":"gu4O9dqS0U4","author_id":4,"entity_id":4,"entity_type":"User","add":"email","author_name":"test20200203","target_id":null,"target_type":"Email","target_details":null,"ip_address":"217.169.1.226","entity_path":"test20200203"}
==> /var/log/gitlab/gitlab-workhorse/current <== {"correlation_id":"FzmU3T3LgG6","duration_ms":0,"host":"bprescott-gitlabtest-0.do.gitlap.com","level":"info","method":"POST","msg":"access","proto":"HTTP/1.1","referrer":"","remote_addr":"217.169.1.226:0","remote_ip":"217.169.1.226","status":204,"system":"http","time":"2020-03-20T16:42:46Z","uri":"/api/v4/jobs/request","user_agent":"gitlab-runner 12.8.0 (12-8-stable; go1.13.7; linux/amd64)","written_bytes":0} {"correlation_id":"gCVcuDeP6U5","duration_ms":0,"host":"bprescott-gitlabtest-0.do.gitlap.com","level":"info","method":"POST","msg":"access","proto":"HTTP/1.1","referrer":"","remote_addr":"217.169.1.226:0","remote_ip":"217.169.1.226","status":204,"system":"http","time":"2020-03-20T16:42:46Z","uri":"/api/v4/jobs/request","user_agent":"gitlab-runner 12.8.0 (12-8-stable; go1.13.7; linux/amd64)","written_bytes":0} {"correlation_id":"gu4O9dqS0U4","duration_ms":86,"host":"bprescott-gitlabtest-0.do.gitlap.com","level":"info","method":"POST","msg":"access","proto":"HTTP/1.1","referrer":"https://bprescott-gitlabtest-0.do.gitlap.com/admin/users/test20200203/edit","remote_addr":"217.169.1.226:0","remote_ip":"217.169.1.226","status":302,"system":"http","time":"2020-03-20T16:42:47Z","uri":"/admin/users/test20200203","user_agent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0","written_bytes":135} {"correlation_id":"MeLE8Pl8Cq8","duration_ms":102,"host":"bprescott-gitlabtest-0.do.gitlap.com","level":"info","method":"GET","msg":"access","proto":"HTTP/1.1","referrer":"https://bprescott-gitlabtest-0.do.gitlap.com/admin/users/test20200203/edit","remote_addr":"217.169.1.226:0","remote_ip":"217.169.1.226","status":200,"system":"http","time":"2020-03-20T16:42:47Z","uri":"/admin/users/test20200203","user_agent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0","written_bytes":42320}
==> /var/log/gitlab/nginx/gitlab_access.log <== 217.169.1.226 - - [20/Mar/2020:16:42:46 +0000] "POST /api/v4/jobs/request HTTP/1.1" 204 0 "" "gitlab-runner 12.8.0 (12-8-stable; go1.13.7; linux/amd64)" 217.169.1.226 - - [20/Mar/2020:16:42:46 +0000] "POST /api/v4/jobs/request HTTP/1.1" 204 0 "" "gitlab-runner 12.8.0 (12-8-stable; go1.13.7; linux/amd64)" 217.169.1.226 - - [20/Mar/2020:16:42:47 +0000] "POST /admin/users/test20200203 HTTP/2.0" 302 135 "https://bprescott-gitlabtest-0.do.gitlap.com/admin/users/test20200203/edit" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0" 217.169.1.226 - - [20/Mar/2020:16:42:47 +0000] "GET /admin/users/test20200203 HTTP/2.0" 200 11062 "https://bprescott-gitlabtest-0.do.gitlap.com/admin/users/test20200203/edit" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0"
==> /var/log/gitlab/gitlab-workhorse/current <== {"correlation_id":"vNROJFa2hH9","duration_ms":0,"host":"bprescott-gitlabtest-0.do.gitlap.com","level":"info","method":"POST","msg":"access","proto":"HTTP/1.1","referrer":"","remote_addr":"178.128.45.166:0","remote_ip":"178.128.45.166","status":204,"system":"http","time":"2020-03-20T16:42:47Z","uri":"/api/v4/jobs/request","user_agent":"gitlab-runner 12.8.0 (12-8-stable; go1.13.7; linux/amd64)","written_bytes":0}
==> /var/log/gitlab/nginx/gitlab_access.log <== 178.128.45.166 - - [20/Mar/2020:16:42:47 +0000] "POST /api/v4/jobs/request HTTP/1.1" 204 0 "" "gitlab-runner 12.8.0 (12-8-stable; go1.13.7; linux/amd64)"
- remove the secondary, using the using the x button
gitlab-ctl tail output
==> /var/log/gitlab/gitlab-workhorse/current <== {"correlation_id":"bwcoIqCgJD2","duration_ms":0,"host":"bprescott-gitlabtest-0.do.gitlap.com","level":"info","method":"POST","msg":"access","proto":"HTTP/1.1","referrer":"","remote_addr":"217.169.1.226:0","remote_ip":"217.169.1.226","status":204,"system":"http","time":"2020-03-20T16:46:43Z","uri":"/api/v4/jobs/request","user_agent":"gitlab-runner 12.8.0 (12-8-stable; go1.13.7; linux/amd64)","written_bytes":0} {"correlation_id":"OIry4h9FSg2","duration_ms":0,"host":"bprescott-gitlabtest-0.do.gitlap.com","level":"info","method":"POST","msg":"access","proto":"HTTP/1.1","referrer":"","remote_addr":"217.169.1.226:0","remote_ip":"217.169.1.226","status":204,"system":"http","time":"2020-03-20T16:46:43Z","uri":"/api/v4/jobs/request","user_agent":"gitlab-runner 12.8.0 (12-8-stable; go1.13.7; linux/amd64)","written_bytes":0}
==> /var/log/gitlab/nginx/gitlab_access.log <== 217.169.1.226 - - [20/Mar/2020:16:46:43 +0000] "POST /api/v4/jobs/request HTTP/1.1" 204 0 "" "gitlab-runner 12.8.0 (12-8-stable; go1.13.7; linux/amd64)" 217.169.1.226 - - [20/Mar/2020:16:46:43 +0000] "POST /api/v4/jobs/request HTTP/1.1" 204 0 "" "gitlab-runner 12.8.0 (12-8-stable; go1.13.7; linux/amd64)"
==> /var/log/gitlab/gitlab-workhorse/current <== {"correlation_id":"JF52O0yLjO5","duration_ms":0,"host":"bprescott-gitlabtest-0.do.gitlap.com","level":"info","method":"POST","msg":"access","proto":"HTTP/1.1","referrer":"","remote_addr":"178.128.45.166:0","remote_ip":"178.128.45.166","status":204,"system":"http","time":"2020-03-20T16:46:45Z","uri":"/api/v4/jobs/request","user_agent":"gitlab-runner 12.8.0 (12-8-stable; go1.13.7; linux/amd64)","written_bytes":0}
==> /var/log/gitlab/nginx/gitlab_access.log <== 178.128.45.166 - - [20/Mar/2020:16:46:45 +0000] "POST /api/v4/jobs/request HTTP/1.1" 204 0 "" "gitlab-runner 12.8.0 (12-8-stable; go1.13.7; linux/amd64)"
==> /var/log/gitlab/gitlab-rails/production.log <== Started DELETE "/admin/users/test20200203/remove/7" for 217.169.1.226 at 2020-03-20 16:46:45 +0000 Processing by Admin::UsersController#remove_email as HTML Parameters: {"authenticity_token"=>"[FILTERED]", "id"=>"test20200203", "email_id"=>"7"} Redirected to https://bprescott-gitlabtest-0.do.gitlap.com/admin/users/test20200203 Completed 302 Found in 45ms (ActiveRecord: 9.6ms | Elasticsearch: 0.0ms | Allocations: 14553) Started GET "/admin/users/test20200203" for 217.169.1.226 at 2020-03-20 16:46:45 +0000 Processing by Admin::UsersController#show as HTML Parameters: {"id"=>"test20200203"} Completed 200 OK in 75ms (Views: 47.7ms | ActiveRecord: 9.4ms | Elasticsearch: 0.0ms | Allocations: 37725)
==> /var/log/gitlab/gitlab-rails/production_json.log <== {"method":"DELETE","path":"/admin/users/test20200203/remove/7","format":"html","controller":"Admin::UsersController","action":"remove_email","status":302,"duration":45.44,"view":0.0,"db":9.57,"location":"https://bprescott-gitlabtest-0.do.gitlap.com/admin/users/test20200203","time":"2020-03-20T16:46:45.726Z","params":[{"key":"_method","value":"delete"},{"key":"authenticity_token","value":"[FILTERED]"},{"key":"id","value":"test20200203"},{"key":"email_id","value":"7"}],"remote_ip":"217.169.1.226","user_id":1,"username":"bprescott-root","ua":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0","queue_duration":7.52,"correlation_id":"Oc6h70KsEB","cpu_s":0.04811618600001566} {"method":"GET","path":"/admin/users/test20200203","format":"html","controller":"Admin::UsersController","action":"show","status":200,"duration":74.78,"view":47.65,"db":9.42,"time":"2020-03-20T16:46:45.855Z","params":[{"key":"id","value":"test20200203"}],"remote_ip":"217.169.1.226","user_id":1,"username":"bprescott-root","ua":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0","queue_duration":19.49,"correlation_id":"oKdxUevvm62","cpu_s":0.09225738099996761}
==> /var/log/gitlab/gitlab-rails/audit_json.log <== {"severity":"INFO","time":"2020-03-20T16:46:45.721Z","correlation_id":"Oc6h70KsEB","author_id":1,"entity_id":4,"entity_type":"User","remove":"email","author_name":"Ben Prescott (root)","target_id":null,"target_type":"Email","target_details":null,"ip_address":"217.169.1.226","entity_path":"test20200203"}
==> /var/log/gitlab/gitlab-workhorse/current <== {"correlation_id":"Oc6h70KsEB","duration_ms":62,"host":"bprescott-gitlabtest-0.do.gitlap.com","level":"info","method":"POST","msg":"access","proto":"HTTP/1.1","referrer":"https://bprescott-gitlabtest-0.do.gitlap.com/admin/users/test20200203","remote_addr":"217.169.1.226:0","remote_ip":"217.169.1.226","status":302,"system":"http","time":"2020-03-20T16:46:45Z","uri":"/admin/users/test20200203/remove/7","user_agent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0","written_bytes":135} {"correlation_id":"oKdxUevvm62","duration_ms":106,"host":"bprescott-gitlabtest-0.do.gitlap.com","level":"info","method":"GET","msg":"access","proto":"HTTP/1.1","referrer":"https://bprescott-gitlabtest-0.do.gitlap.com/admin/users/test20200203","remote_addr":"217.169.1.226:0","remote_ip":"217.169.1.226","status":200,"system":"http","time":"2020-03-20T16:46:45Z","uri":"/admin/users/test20200203","user_agent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0","written_bytes":41810}
==> /var/log/gitlab/nginx/gitlab_access.log <== 217.169.1.226 - - [20/Mar/2020:16:46:45 +0000] "POST /admin/users/test20200203/remove/7 HTTP/2.0" 302 135 "https://bprescott-gitlabtest-0.do.gitlap.com/admin/users/test20200203" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0" 217.169.1.226 - - [20/Mar/2020:16:46:45 +0000] "GET /admin/users/test20200203 HTTP/2.0" 200 10960 "https://bprescott-gitlabtest-0.do.gitlap.com/admin/users/test20200203" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0"
Example Project
(If possible, please create an example project here on GitLab.com that exhibits the problematic behavior, and link to it here in the bug report)
(If you are using an older version of GitLab, this will also determine whether the bug is fixed in a more recent version)
What is the current bug behavior?
UI displays There was an error removing the e-mail.
What is the expected correct behavior?
No error.
Relevant logs and/or screenshots
See reproduction
Output of checks
(If you are reporting a bug on GitLab.com, write: This bug happens on GitLab.com)
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Proxy: no Current User: git Using RVM: no Ruby Version: 2.6.5p114 Gem Version: 2.7.10 Bundler Version:1.17.3 Rake Version: 12.3.3 Redis Version: 5.0.7 Git Version: 2.24.1 Sidekiq Version:5.2.7 Go Version: unknownGitLab information Version: 12.8.6-ee Revision: 5b0bcf2717b Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 11.7 URL: https://bprescott-gitlabtest-0.do.gitlap.com HTTP Clone URL: https://bprescott-gitlabtest-0.do.gitlap.com/some-group/some-project.git SSH Clone URL: git@bprescott-gitlabtest-0.do.gitlap.com:some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: no Using Omniauth: yes Omniauth Providers:
GitLab Shell Version: 11.0.0 Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
Checking GitLab subtasks ...Checking GitLab Shell ...
GitLab Shell: ... GitLab Shell version >= 11.0.0 ? ... OK (11.0.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Internal API available: OK Redis available via internal API: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Gitaly ...
Gitaly: ... default ... OK
Checking Gitaly ... Finished
Checking Sidekiq ...
Sidekiq: ... Running? ... yes Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Incoming Email ...
Incoming Email: ... Reply by email is disabled in config/gitlab.yml
Checking Incoming Email ... Finished
Checking LDAP ...
LDAP: ... LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab App ...
Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 2/1 ... yes 2/2 ... yes 2/3 ... yes 2/4 ... yes 2/6 ... yes 2/7 ... yes 4/8 ... yes 2/9 ... yes 2/10 ... yes 2/11 ... yes 2/12 ... yes 2/13 ... yes 2/14 ... yes 6/15 ... yes 6/16 ... yes 2/17 ... yes 7/18 ... yes 8/19 ... yes 8/20 ... yes 8/21 ... yes 4/22 ... yes 4/23 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.5.3 ? ... yes (2.6.5) Git version >= 2.22.0 ? ... yes (2.24.1) Git user has default SSH configuration? ... yes Active users: ... 3 Is authorized keys file accessible? ... yes Elasticsearch version 5.6 - 6.x? ... skipped (elasticsearch is disabled)
Checking GitLab App ... Finished
Checking GitLab subtasks ... Finished
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)