所以我使用omnibus包将Gitlab从7.1.1升级到7.7.2。
升级后我决定尝试Gitlab CI并将ci_external_url
行添加到 /etc/gitlab/gitlab.rb ,但当我浏览到定义的URL时,我得到了500错误,日志输出如下:
Started GET "/" for 1.3.3.7 at 2015-02-04 09:14:35 +0200
Processing by ProjectsController#index as HTML
PG::UndefinedTable: ERROR: relation "sessions" does not exist
LINE 5: WHERE a.attrelid = '"sessions"'::regclass
^
: 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 = '"sessions"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
Redirected to
Completed 500 Internal Server Error in 5ms
ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR: relation "sessions" does not exist
LINE 5: WHERE a.attrelid = '"sessions"'::regclass
^
: 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 = '"sessions"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
):
app/controllers/application_controller.rb:76:in `check_config'
我在Debian 7上运行它。
答案 0 :(得分:3)
您没有迁移数据库(rake db:migrate
),或者您已迁移,并且您的代码使用的是不存在的数据库表。
尝试迁移,看看这是否能解决您的问题。
更新:对于具有相同问题的其他人,似乎Gitlab的命令是gitlab-ci-rake db:migrate
答案 1 :(得分:0)
我发现综合信息检查sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
是gitlab中最有用的命令。它可以突出显示您在更新期间可能遇到的许多问题。除了常规权限问题,它还会识别缺少的数据库更新。
除此之外,我们虔诚地遵循manual update guides,因为它们包含了我们目前所需的每一步(我们不使用综合)。