升级 /降级后Gitlab CE 500错误

发布于 2025-01-22 09:16:51 字数 1284 浏览 3 评论 0原文

我有一个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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

浅黛梨妆こ 2025-01-29 09:16:51

您无法直接从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 to 14.0.12 then to 14.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.

木落 2025-01-29 09:16:51

我通过使用gitlab-psql来解决此错误来执行此查询:

ALTER TABLE Integrations RENAME TO Services;

通过将Integrations表重命名为服务>服务>服务问题消失了。

I solve this error by using gitlab-psql to execute this query:

ALTER TABLE Integrations RENAME TO Services;

By renaming the Integrations table to services the problem disappear.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文