查看项目时更新后gitlab错误500 [英] gitlab Error 500 after updating when viewing projects

查看:619
本文介绍了查看项目时更新后gitlab错误500的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

dpkg查询-W gitlab gitlab 7.3.2-omnibus-1

我们有gitlab 6.9。 2在Ubuntu 14.04.1 LTS上运行。按照此处的说明进行操作后 https://gitlab.com /gitlab-org/omnibus-gitlab/blob/master/doc/update.md

We have gitlab 6.9.2 running on Ubuntu 14.04.1 LTS. After following the instructions found here https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/update.md

更新至7.3.2,但是在尝试时一切似乎都很好查看项目我们会遇到错误500。

to update to 7.3.2, everything seemed fine however when trying to view a project we get error 500.

每次我尝试访问其中一个页面时,运行
sudo时都会看到此错误gitlab-ctl tail postgresql

Everytime I try to access one of the pages I see this error when running sudo gitlab-ctl tail postgresql

ERROR:  relation "users_star_projects" does not exist at character 323
STATEMENT: SELECT a.attname, format_type(a.atttypid, a.atttypmod),
pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
FROM pg_attribute a 
LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"users_star_projects"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum

我也看到此错误在 /var/log/gitlab/gitlab-rails/production.log中:

Completed 500 Internal Server Error in 42ms

ActiveRecord::StatementInvalid (PG::Error: ERROR:  relation "users_star_projects" does not exist
LINE 5:                WHERE a.attrelid = '"users_star_projects"'::r...
                                          ^
:               SELECT a.attname, format_type(a.atttypid, a.atttypmod),
                     pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
                FROM pg_attribute a LEFT JOIN pg_attrdef d
                  ON a.attrelid = d.adrelid AND a.attnum = d.adnum
               WHERE a.attrelid = '"users_star_projects"'::regclass
                 AND a.attnum > 0 AND NOT a.attisdropped
               ORDER BY a.attnum
):
  app/models/user.rb:522:in `starred?'
  app/controllers/projects_controller.rb:63:in `show'

如果有办法可以解决或添加缺失的关系?

If there a way I can fix or add the missing relation?

推荐答案

我在gitlab上发布了该问题帮助我解决了问题。
https://gitlab.com/gitlab-org/omnibus-gitlab/issues/277

I posted the issue on gitlab, which helped me fix the problem. https://gitlab.com/gitlab-org/omnibus-gitlab/issues/277

如果其他任何人遇到此问题或遇到此问题,我会在此快速发布如何解决它的信息。
就我而言,我缺少一些数据库关系。因此,您可以通过运行
sudo gitlab-rake db:migrate:status
进行检查,如果其中任何一项都无效,则表明它们未被应用。

In case anyone else has this issue or comes across this I am posting a quick run down on how I fixed it. In my case I was missing some DB relations. So you can check that by running sudo gitlab-rake db:migrate:status If any of those say down, then they were not applied.

您可以尝试通过运行
sudo gitlab-ctl reconfigure
来解决此问题。我的案子没有解决问题。我必须手动告诉它使用以下命令运行数据库迁移
sudo gitlab-rake db:migrate

You can try to fix that by running sudo gitlab-ctl reconfigure in my case that did not fix the problem. I had to manually tell it to run the DB migrations with the following command sudo gitlab-rake db:migrate

之后,当我运行 sudo gitlab-rake db:migrate:status 时,它们全部启动,使用该网站时我没有500多个错误。

After that when I ran sudo gitlab-rake db:migrate:status they were all up and I have no more 500 errors when using the website.

这篇关于查看项目时更新后gitlab错误500的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆