访问Project Page时出现GitLab 500错误

时间:2016-09-26 08:58:28

标签: gitlab nfs gitlab-omnibus gitlab-8 efs

我正在为我的组织设置GitLab企业版。我们使用AWS EFS存储repo数据,并使用两个实例通过AWS ELB提供SSH和HTTP / HTTPS流量。 EFS卷在两个实例之间共享。但是当我在服务重启后访问项目主页时,我们会看到500错误页面。我们尝试运行gitlab-ctl reconfigure && gitlab-ctl restart但没有帮助。

  1. GitLab EE版本 - 8.12.1-ee
  2. 2 * Centos 7(AWS EC2实例 - m4.xlarge)
  3. AWS ELB负载均衡ssh和http / https流量
  4. 日志错误

         ==> /var/log/gitlab/gitlab-rails/production.log <==
    Started GET "/itops/docker" for 10.0.4.246 at 2016-09-26 07:58:58 +0000
    Processing by ProjectsController#show as HTML
      Parameters: {"namespace_id"=>"itops", "id"=>"docker"}
    Completed 500 Internal Server Error in 145ms (ActiveRecord: 14.2ms)
    
    OpenSSL::Cipher::CipherError (bad decrypt):
      app/models/project.rb:531:in `import_url'
      app/models/project.rb:567:in `external_import?'
      app/models/project.rb:559:in `import?'
      app/models/project.rb:575:in `import_in_progress?'
      app/controllers/projects_controller.rb:95:in `show'
      lib/gitlab/request_profiler/middleware.rb:15:in `call'
      lib/gitlab/middleware/go.rb:16:in `call'
      lib/gitlab/middleware/readonly_geo.rb:29:in `call'
    
    
      ==> /var/log/gitlab/gitlab-rails/production.log <==
    Started GET "/itops/docker/refs/master/logs_tree/?offset=50&_=1474877373459" for 10.0.9.106 at 2016-09-26 08:09:40 +0000
    Processing by Projects::RefsController#logs_tree as JS
      Parameters: {"offset"=>"50", "_"=>"1474877373459", "namespace_id"=>"itops", "project_id"=>"docker", "id"=>"master"}
    Started GET "/itops/docker/commits/master" for 10.0.4.246 at 2016-09-26 08:09:40 +0000
    Processing by Projects::CommitsController#show as HTML
      Parameters: {"namespace_id"=>"itops", "project_id"=>"docker", "id"=>"master"}
    Completed 500 Internal Server Error in 176ms (ActiveRecord: 16.8ms)
    
    ActionView::Template::Error (bad decrypt):
        1: - if @project.mirror?
        2:   .prepend-top-default.gray-content-block.second-block.clearfix
        3:     - import_url = @project.safe_import_url
        4:     .oneline.project-mirror-text
        5:       This project is mirrored from #{link_to import_url, import_url}.
        6:
      app/models/project.rb:531:in `import_url'
      app/models/project.rb:587:in `safe_import_url'
      app/views/projects/commits/_mirror_status.html.haml:3:in `_app_views_projects_commits__mirror_status_html_haml___2300853211630423479_63495260'
      app/views/projects/commits/show.html.haml:35:in `_app_views_projects_commits_show_html_haml___2695203885719227520_58528080'
      app/controllers/projects/commits_controller.rb:27:in `show'
      lib/gitlab/request_profiler/middleware.rb:15:in `call'
      lib/gitlab/middleware/go.rb:16:in `call'
      lib/gitlab/middleware/readonly_geo.rb:29:in `call'
    

    我从GitHub导入了Docker项目。所有其他页面工作正常(树/主,活动,图形,管道,问题)只有项目主页和docker / commits / master显示错误。

3 个答案:

答案 0 :(得分:2)

您是否从其他服务器迁移?

如果是这样,您之前的/etc/gitlab/gitlab-secrets.json文件可能包含新安装没有的加密密钥。

在新服务器上复制旧的gitlab-secrets.json/etc/gitlab(在备份新版本之后,当然,如果您需要回滚)应该修复它。

答案 1 :(得分:0)

我的情况是,当我通过从另一个导入来创建存储库时,同样的异常被提升了。关闭捐赠项目服务器后,我遇到500错误。例外必须import_url不可用,而不是ssl错误。 我的决心是清除数据库中断开的链接:

update projects set import_url=NULL where id = MY-PROJECT_ID;

答案 2 :(得分:0)

我们就此问题与AWS和gitlab支持团队进行了联系,并发现AWS EFS(弹性文件系统 - 花哨的NFS服务)与Gitlab不兼容。欲了解更多信息,请访问以下链接。

https://docs.gitlab.com/ee/administration/high_availability/nfs.html#aws-elastic-file-system

  • EFS的分布式体系结构导致每个文件操作的延迟更高

  • Gitlab以序列化方式处理非常小的文件(序列化命令的示例:ls,cp,tar,rsync,git)

  • EFS基础允许IOPS的卷大小。卷越大,分配的IOPS越多。对于较小的数量,由于“突发积分”,用户可能会在一段时间内体验到不错的表现。在数周到数月的时间内,学分可能会耗尽,而且表现将会最低。

  • 对于较大的卷,分配的IOPS可能不是问题。以序列化方式编写许多小文件的工作负载并不适合EFS。顶部带有NFS服务器的EBS将表现得更好。