【问题标题】:GitLab Two Factor Authentication: ArgumentError (must specify a key)GitLab 两因素身份验证:ArgumentError(必须指定密钥)
【发布时间】:2023-03-03 07:26:20
【问题描述】:

我正在运行 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 的用户无法再登录,并出现几乎相同的错误。

有人知道怎么解决吗?

【问题讨论】:

    标签: gitlab two-factor-authentication


    【解决方案1】:

    解决方案并不那么明显。我将 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
    # 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
    

    【讨论】:

      猜你喜欢
      • 2019-07-21
      • 1970-01-01
      • 1970-01-01
      • 2012-11-03
      • 2016-06-06
      • 2016-02-21
      • 1970-01-01
      • 1970-01-01
      • 2015-05-04
      相关资源
      最近更新 更多