Disabling two factor authentication via gitlab-rake fails
Summary
After recovering an backup on another machine I failed to follow guides for recovering 2fa. So I went to disable two factor authentication for all users w/
sudo gitlab-rake gitlab:two_factor:disable_for_all_users
So I ended up with error:
This will disable 2FA for 3 users...
rake aborted!
NameError: uninitialized constant Gitlab::TaskAbortedByUserError
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/two_factor.rake:15:in `rescue in block (3 levels) in <top (required)>'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/two_factor.rake:11:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Caused by:
NameError: undefined local variable or method `ask_to_continue' for main:Object
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/two_factor.rake:12:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Tasks: TOP => gitlab:two_factor:disable_for_all_users
(See full trace by running task with --trace)
After I commented out the offending ask_to_continue, everything went trough fine.
System information
System: Ubuntu 16.04
Current User: git
Using RVM: no
Ruby Version: 2.3.6p384
Gem Version: 2.6.13
Bundler Version:1.13.7
Rake Version: 12.3.0
Redis Version: 3.2.11
Git Version: 2.14.3
Sidekiq Version:5.0.5
Go Version: go1.6.2 linux/amd64
GitLab information
Version: 10.5.5
Revision: c7e4919
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
URL: http://%%%%%%%%%%
HTTP Clone URL: http://%%%%%%%%%%/some-group/some-project.git
SSH Clone URL: git@%%%%%%%%%%:some-group/some-project.git
Using LDAP: no
Using Omniauth: no
GitLab Shell
Version: 6.0.3
Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories
Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks
Git: /opt/gitlab/embedded/bin/git