gitlab两个因素身份验证:参数error(必须指定一个键)



我正在运行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(苏里)。我卸载了所有宝石,并重新安装了它们。有些零件再次与新的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
# https://stackoverflow.com/a/21385516/3898725
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

相关内容

  • 没有找到相关文章

最新更新