GitLab 双因素身份验证:ArgumentError(必须指定密钥)

GitLab Two Factor Authentication: ArgumentError (must specify a key)

我是 运行 GitLab 10.2.2 并且双因素身份验证 (2FA) 根本不起作用。我很快迁移并升级了 GitLab 实例。我只是将带有基本密钥的旧 config/secrets.yml 复制到它的位置。但即使我不这样做,我也应该能够激活 2FA。

当我尝试激活 2FA 时,日志显示:

==> production.log <==
Started GET "/profile/two_factor_auth" for 87.138.100.36 at 2017-11-29 16:52:59 +0100
Processing by Profiles::TwoFactorAuthsController#show as HTML
Completed 500 Internal Server Error in 191ms (ActiveRecord: 4.1ms)

ArgumentError (must specify a key):
  app/controllers/profiles/two_factor_auths_controller.rb:6:in `show'
  lib/gitlab/i18n.rb:47:in `with_locale'
  lib/gitlab/i18n.rb:53:in `with_user_locale'
  app/controllers/application_controller.rb:340:in `set_locale'
  lib/gitlab/middleware/multipart.rb:93:in `call'
  lib/gitlab/request_profiler/middleware.rb:14:in `call'
  lib/gitlab/middleware/go.rb:18:in `call'
  lib/gitlab/etag_caching/middleware.rb:11:in `call'
  lib/gitlab/middleware/read_only.rb:31:in `call'
  lib/gitlab/request_context.rb:18:in `call'
  lib/gitlab/metrics/requests_rack_middleware.rb:27:in `call'

已启用 2FA 的另一个用户无法再登录,出现几乎相同的错误。

有人知道如何解决吗?

解决方案不是那么明显。我将 libssl 和 libssl-dev 更新为 1.1.0(按 sury)。我卸载了所有 Gems 并重新安装了它们。一些部分针对新的 libssl 再次编译。之后 2FA 正常工作。

# add sury APT repo
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update

# update libssl
sudo apt-get install libssl libssl-dev

# uninstall all Gems
# 
bundle list | ruby -e 'ARGF.readlines[1..-1].each {|l| g = l.split(" ");  puts "Removing #{g[1]}"; `gem uninstall --force #{g[1]} -v #{g[2].gsub(/\(|\)/, "")}`; }'

# reinstall all gems (with MySQL)
sudo -u git -H bundle install --without postgres development test --deployment