2FA not working
Hi everybody,
Summary
Impossible to logging when 2FA is enable (tested on multiple account, included admin account).
The virtual device used is Authy
.
You can be logged if you use recovery code. If you try to disable / re-enable 2FA, it's impossible to validate. The codes generated by the virtual device are always wrong.
Steps to reproduce
- Logout
- logging --> fail, 2FA codes always wrong. Error message:
Invalid two-factor code.
- logging, use recovery code --> OK
- Go to user's settings and disable 2FA
- Try to re-enable it --> fail, 2FA codes always wrong
Relevant logs and/or screenshots
/var/log/gitlab/gitlab-rails/production.log
Started POST "/users/sign_in" for 172.16.3.20 at 2017-08-16 11:55:02 +0200
processing by SessionsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"xxxxxxxxxxxx==", "user"=>{"remember_me"=>"0", "otp_attempt"=>"[FILTERED]"}}
Filter chain halted as :authenticate_with_two_factor rendered or redirected
Completed 200 OK in 932ms (Views: 96.8ms | ActiveRecord: 17.4ms)
/var/log/gitlab/nginx/gitlab_access.log
172.16.3.20 - - [16/Aug/2017:11:55:03 +0200] "POST /users/sign_in HTTP/2.0" 200 6803 "https://gitlab.xxxxx.com/users/sign_in" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:54.0) Gecko/20100101 Firefox/54.0"
Output of checks
Results of GitLab environment info
gitlab-rake gitlab:env:info
System information
System: Debian 8.9
Current User: git
Using RVM: no
Ruby Version: 2.3.3p222
Gem Version: 2.6.6
Bundler Version:1.13.7
Rake Version: 10.5.0
Redis Version: 3.2.5
Git Version: 2.13.4
Sidekiq Version:5.0.0
Go Version: unknown
GitLab information
Version: 9.4.5
Revision: 140292e
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
URL: https://gitlab.trace-software.com
HTTP Clone URL: https://gitlab.trace-software.com/some-group/some-project.git
SSH Clone URL: git@gitlab.trace-software.com:some-group/some-project.git
Using LDAP: no
Using Omniauth: no
GitLab Shell
Version: 5.3.1
Repository storage paths:
- default: /home/gitRepository/repositories
Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks
Git: /opt/gitlab/embedded/bin/git
go version
go version go1.5.1 linux/amd64
Results of GitLab application Check
gitlab-rake gitlab:check SANITIZE=true
Checking GitLab Shell ...
GitLab Shell version >= 5.3.1 ? ... OK (5.3.1)
Repo base directory exists?
default... yes
Repo storage directories are symlinks?
default... no
Repo paths owned by git:root, or git:git?
default... yes
Repo paths access is drwxrws---?
default... yes
hooks directories in repos are links: ...
2/1 ... ok
2/3 ... ok
2/4 ... ok
2/5 ... ok
2/6 ... ok
2/10 ... ok
20/11 ... ok
2/13 ... ok
14/14 ... ok
2/15 ... ok
14/16 ... ok
2/17 ... repository is empty
20/18 ... ok
20/19 ... ok
20/20 ... ok
20/21 ... ok
20/22 ... ok
20/23 ... ok
20/24 ... ok
20/25 ... ok
20/27 ... ok
14/28 ... ok
20/29 ... ok
14/30 ... ok
20/32 ... ok
20/37 ... ok
23/41 ... ok
20/43 ... ok
14/44 ... ok
25/45 ... ok
23/47 ... ok
25/48 ... ok
25/49 ... ok
25/51 ... ok
25/52 ... ok
14/53 ... ok
25/54 ... ok
10/55 ... ok
29/56 ... ok
29/57 ... ok
29/58 ... ok
14/59 ... ok
15/60 ... ok
25/61 ... ok
14/64 ... ok
14/65 ... ok
20/66 ... ok
2/67 ... ok
20/68 ... ok
18/69 ... ok
33/70 ... ok
33/71 ... ok
14/72 ... ok
33/73 ... ok
14/74 ... ok
14/75 ... ok
33/77 ... ok
33/78 ... ok
33/79 ... ok
4/80 ... ok
14/81 ... ok
14/82 ... ok
18/83 ... ok
29/84 ... ok
36/85 ... ok
18/86 ... ok
14/87 ... ok
4/88 ... ok
14/89 ... ok
4/90 ... ok
22/91 ... ok
25/92 ... ok
25/93 ... ok
14/94 ... ok
14/95 ... ok
14/96 ... ok
14/97 ... ok
2/98 ... ok
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK
Send ping to redis server: OK
gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes
Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Reply by email ...
Reply by email is disabled in config/gitlab.yml
Checking Reply by email ... Finished
Checking LDAP ...
LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab ...
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/3 ... yes
2/4 ... yes
2/5 ... yes
2/6 ... yes
2/10 ... yes
20/11 ... yes
2/13 ... yes
14/14 ... yes
2/15 ... yes
14/16 ... yes
2/17 ... yes
20/18 ... yes
20/19 ... yes
20/20 ... yes
20/21 ... yes
20/22 ... yes
20/23 ... yes
20/24 ... yes
20/25 ... yes
20/27 ... yes
14/28 ... yes
20/29 ... yes
14/30 ... yes
20/32 ... yes
20/37 ... yes
23/41 ... yes
20/43 ... yes
14/44 ... yes
25/45 ... yes
23/47 ... yes
25/48 ... yes
25/49 ... yes
25/51 ... yes
25/52 ... yes
14/53 ... yes
25/54 ... yes
10/55 ... yes
29/56 ... yes
29/57 ... yes
29/58 ... yes
14/59 ... yes
15/60 ... yes
25/61 ... yes
14/64 ... yes
14/65 ... yes
20/66 ... yes
2/67 ... yes
20/68 ... yes
18/69 ... yes
33/70 ... yes
33/71 ... yes
14/72 ... yes
33/73 ... yes
14/74 ... yes
14/75 ... yes
33/77 ... yes
33/78 ... yes
33/79 ... yes
4/80 ... yes
14/81 ... yes
14/82 ... yes
18/83 ... yes
29/84 ... yes
36/85 ... yes
18/86 ... yes
14/87 ... yes
4/88 ... yes
14/89 ... yes
4/90 ... yes
22/91 ... yes
25/92 ... yes
25/93 ... yes
14/94 ... yes
14/95 ... yes
14/96 ... yes
14/97 ... yes
2/98 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.3.3 ? ... yes (2.3.3)
Git version >= 2.7.3 ? ... yes (2.13.4)
Active users: ... 26
Checking GitLab ... Finished
Possible fixes
Disable 2FA
Edited by username-removed-222079