升级 /降级后Gitlab CE 500错误
我有一个GitLab CE服务器版本13.10,在系统更新中,该版本被错误地更新为14.8版。
有了这些版本,我会在所有页面上获得500个错误。
因此,我降级到版本13.10.5,并且能够再次使用GitLab服务器。
但是,想要创建一个新组,我再次出现了500个错误:
Started GET "/groups/new" for 62.34.67.75 at 2022-04-19 17:23:00 +0200
Processing by GroupsController#new as HTML
Completed 500 Internal Server Error in 78ms (ActiveRecord: 4.2ms | Elasticsearch: 0.0ms | Allocations: 27029)
ActionView::Template::Error (PG::UndefinedTable: ERROR: relation "services" does not exist
LINE 8: WHERE a.attrelid = '"services"'::regclass
显然,此错误似乎与数据库有关。
我试图通过安装13.11.7版本来升级一个版本,并且所有页面再次导致500个错误,并且错误与上面的错误相同。
任何帮助将不胜感激。
更新 在Google搜索后,似乎Integrations
表被重命名为服务
: https://gitlab.com/gitlab.com/gitlab.com/gitlab-org/gitlab-org/gitlab/gitlab/gitlab/blob/blob/blob/blatical/210222222222222222222222222222212222222212222222222222222210221022210222102210222 _services_to_integrations.rb
在我的服务器上查看数据库架构后,Integrations
仍然存在。
因此,就像数据库仍在前方版本中,并且数据库donwngrade不正常。
I have a Gitlab CE server version 13.10 which was found updated by mistake during a system update to a version 14.8.
With these version, i get a 500 error for all pages.
So I downgraded to version 13.10.5 and I was able to use my Gitlab server again.
However, wanting to create a new group I again had a 500 error:
Started GET "/groups/new" for 62.34.67.75 at 2022-04-19 17:23:00 +0200
Processing by GroupsController#new as HTML
Completed 500 Internal Server Error in 78ms (ActiveRecord: 4.2ms | Elasticsearch: 0.0ms | Allocations: 27029)
ActionView::Template::Error (PG::UndefinedTable: ERROR: relation "services" does not exist
LINE 8: WHERE a.attrelid = '"services"'::regclass
Apparently this error seems to be database related.
I tried to upgrade one version up by installing version 13.11.7 and again all pages lead to a 500 error with the same error as above.
any help would be appreciated.
UPDATE
After searching in Google it seem's that the integrations
table was renamed to services
: https://gitlab.com/gitlab-org/gitlab/-/blob/master/db/post_migrate/20210621223242_finalize_rename_services_to_integrations.rb
After taking a look to database schema on my server the integrations
is still existing.
So it's like database is still in a ahead version and database donwngrade not ok.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您无法直接从13.10更新为14.8,否则您将缺少某些数据库迁移。如果您跳过升级路径。
您必须关注升级路径。意思是在您的情况下,您应首先升级到
13.12.15
,然后14.0.12
,然后14.xy
(例如14.8)。另外,请确保让所有背景迁移都完成并注意特定于版本的注释(尤其是在14.0 < /a>)在进入下一个版本之前。您正在遇到的问题可以通过手动运行数据库操作来解决,但这不建议这样做。最好的选择是遵循升级路径,以确保所有迁移正确地按正确顺序进行。
You cannot update directly to 14.8 from 13.10 otherwise you will be missing certain database migrations. You are likely to discover many more features of GitLab will be broken in unexpected ways if you skip versions in the upgrade path.
You must follow the upgrade path. Meaning in your case, you should upgrade first to
13.12.15
then to14.0.12
then to14.x.y
(e.g. 14.8). Also be sure to let all background migrations complete and pay attention to version specific notes (especially in 14.0) before moving onto the next version.The problem you are experiencing may be fixable by running the database operations manually, but this is not recommended. The best option is to follow the upgrade path to make sure all migrations happen correctly and in the correct order.
我通过使用
gitlab-psql
来解决此错误来执行此查询:通过将
Integrations
表重命名为服务>服务>服务问题消失了。I solve this error by using
gitlab-psql
to execute this query:By renaming the
Integrations
table toservices
the problem disappear.