dpkg-query -W gitlab gitlab 7.3.2-omnibus-1
我们在Ubuntu 14.04.1 LTS上运行gitlab 6.9.2。按照此处https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/update.md
中的说明操作后更新到7.3.2,一切看起来都不错,但是在尝试查看项目时我们得到错误500.
每次我尝试访问其中一个页面时,我都会在运行时看到此错误
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'
如果有办法我可以修复或添加缺失的关系?
答案 0 :(得分:12)
我在gitlab上发布了这个问题,这有助于我解决这个问题。 https://gitlab.com/gitlab-org/omnibus-gitlab/issues/277
如果其他人遇到此问题或遇到此问题,我会发布一个关于我如何解决它的问题。
在我的情况下,我错过了一些数据库关系。所以你可以通过运行来检查
sudo gitlab-rake db:migrate:status
如果其中任何一个说下来,那么他们就不会被应用。
您可以尝试通过运行来修复它
sudo gitlab-ctl reconfigure
在我的情况下,没有解决问题。我不得不手动告诉它使用以下命令运行数据库迁移
sudo gitlab-rake db:migrate
之后,当我运行sudo gitlab-rake db:migrate:status
时,他们全都用完了,在使用网站时我没有500个错误。