代码之家  ›  专栏  ›  技术社区  ›  The Pax Bisonica

Gitlabs升级:某些页面出现500个错误

  •  5
  • The Pax Bisonica  · 技术社区  · 10 年前

    我在某些页面上收到了500个错误。下面是几个示例:/u/root,/merge_requests?assigne_id=&label_name=&milestone_id=&scope=由我创建&排序=最新&state=已关闭,/admin

    更新

    下面是两个表列的图片: http://imageupper.com/gi/?galID=S0200010053W139568325644090&n=1&m=1

    更新 我查看了日志,发现其中一个视图出现了500个错误:

    Started GET "/admin" for 127.0.0.1 at 2014-03-24 14:26:02 -0400
    Processing by Admin::DashboardController#index as HTML
      Rendered admin/dashboard/index.html.haml within layouts/admin (16.3ms)
    Completed 500 Internal Server Error in 19ms
    
    ActionView::Template::Error (undefined method `path' for nil:NilClass):
        36:       %hr
        37:       - @projects.each do |project|
        38:         %p
        39:           = link_to project.name_with_namespace, [:admin, project], class: 'str-truncated'
        40:           %span.light.pull-right
        41:             #{time_ago_with_tooltip(project.created_at)}
        42:
      app/models/project.rb:250:in `to_param'
      app/views/admin/dashboard/index.html.haml:39:in `block in _app_views_admin_dashboard_index_html_haml__4544594                                                                                                                                                                248014738902_70143663654700'
      app/views/admin/dashboard/index.html.haml:37:in `_app_views_admin_dashboard_index_html_haml__4544594248014738                                                                                                                                                                902_70143663654700'
      app/controllers/application_controller.rb:58:in `set_current_user_for_thread'
    
    1 回复  |  直到 10 年前
        1
  •  2
  •   oliverseal    10 年前

    如果您有 NULL 中的路径 namespaces 表,不要删除它。可能有项目引用了它的 id . 给 path 一个你满意的值。当我们切换时,我们只是把公司的名字写在自己的名字里。 类似于:

    update namespaces set path = 'sixfoot' where path is null;

    这可能会解决你的问题。

    如果有 无效的 项目表中的值 namespace_id ,然后在GitLab中创建命名空间,然后 update projects set namespace_id={id the new namespace}; .

    这可能不能解决所有升级问题,但它应该可以在视图中再次显示链接,而无需500。