GitLab:lost GitLab-secrets.json-CiphereError(解密错误)

GitLab:lost GitLab-secrets.json-CiphereError(解密错误),gitlab,gitlab-omnibus,Gitlab,Gitlab Omnibus,我重新安装了GitLab,但忘记备份GitLab-secrets.json文件 现在我无法启用2FA(已禁用),我在production.log文件中看到此错误: Completed 500 Internal Server Error in 15ms (ActiveRecord: 1.3ms) OpenSSL::Cipher::CipherError (bad decrypt): app/controllers/profiles/two_factor_auths_controller.rb

我重新安装了GitLab,但忘记备份GitLab-secrets.json文件

现在我无法启用2FA(已禁用),我在production.log文件中看到此错误:

Completed 500 Internal Server Error in 15ms (ActiveRecord: 1.3ms)

OpenSSL::Cipher::CipherError (bad decrypt):
  app/controllers/profiles/two_factor_auths_controller.rb:5:in `show'
  lib/gitlab/i18n.rb:47:in `with_locale'
  lib/gitlab/i18n.rb:53:in `with_user_locale'
  app/controllers/application_controller.rb:337: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:17:in `call'
  lib/gitlab/etag_caching/middleware.rb:11:in `call'
  lib/gitlab/middleware/read_only.rb:30:in `call'
  lib/gitlab/request_context.rb:18:in `call'
  lib/gitlab/metrics/requests_rack_middleware.rb:27:in `call'
我能做些什么来修复它而不丢失任何数据吗


GitLab CE ver。10.1.0

很抱歉,如果找不到备份,您就倒霉了

如果需要恢复GitLab应用程序备份,还需要恢复
GitLab secrets.json
。否则,使用双因素身份验证的GitLab用户将无法访问您的GitLab服务器,并且存储在GitLab CI中的“安全变量”将丢失


如果您使用omnibus安装gitlab,也许我的方法会有所帮助。 出于某种原因,我不得不重新安装gitlab,在完成之后,我遇到了几乎相同的500次错误解密。当时我根本不知道备份那个秘密文件。 我假设您可以访问您的gitlab网站,可以查看项目列表,但无法直接打开它们,因为存在错误的解密错误(可以通过添加/tree/master打开)。 以下是我的方法:

  • /var/opt/gitlab-----此处是gitlab数据文件。备份它们
  • 下载一个小升级版本,这可能有助于将数据库加密信息迁移到新版本
  • 找到一台新机器,安装gitlab(以前的版本),恢复数据文件,然后将其升级到新下载的版本
  • 看看是否解决了
  • 对我来说,我以前的gitlab版本是8.9.3,在我重新安装了完全相同的版本而没有备份gitlab-secrets.json之后,我遇到了500个错误的解密错误。然后我把它升级到8.17.7,这只是一个小版本的升级。我注意到数据库迁移,之后所有的数据库加密信息都更新了。然后,我可以打开我所有的项目没有500

        Checking PostgreSQL executables: OK
    Shutting down all GitLab services except those needed for migrations
    ok: down: gitlab-workhorse: 0s, normally up
    ok: down: logrotate: 0s, normally up
    ok: down: postgresql: 1s, normally up
    ok: down: sidekiq: 0s, normally up
    ok: down: unicorn: 1s, normally up
    ok: run: postgresql: (pid 14987) 0s
    run: postgresql: (pid 14987) 0s; run: log: (pid 15964) 159018s
    Reconfiguring GitLab to apply migrations
    init (upstart 0.6.5)
    
    
      * Moving existing certificates found in /opt/gitlab/embedded/ssl/certs
    
      * Symlinking existing certificates found in /etc/gitlab/trusted-certs
    gitlab Reconfigured!
    

    实际上,我唯一的问题是为用户启用2fa。我可以成功地做任何事情,比如访问项目并使用它们。在我的例子中,2FA只有一个问题,我只是重新创建了有问题的用户,现在一切似乎都很好。我使用的是在重新安装过程中创建的一个新的秘密json文件。当然,我现在将它保存在一个安全的地方,以便可以随时恢复:)