极狐GitLab 正式推出面向 GitLab 老旧版本(12.x、13.x、14.x、15.x 等)免费用户的专业升级服务,点击查看详情

返回列表 发布新帖

极狐Gitlab直接使用人大金仓数据库报错

379 1
发表于 2024-9-14 11:06:34 | 显示全部楼层 阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×

本帖最后由 yangxh1992 于 2024-9-14 11:33 编辑

本帖最后由 yangxh1992 于 2024-9-14 11:21 编辑

本帖最后由 yangxh1992 于 2024-9-14 11:13 编辑

极狐Gitlab 使用人大金仓数据库报错

docker镜像

人大金仓:kingbase_v009r001c001b0030_single_x86 v1

极狐Gitlab:registry.gitlab.cn/omnibus/gitlab-jh latest

按照官方文档 使用外部 PostgreSQL 服务配置 GitLab | 极狐GitLab

在金仓中使用SQL创建用户并授权

CREATE USER gitlab WITH PASSWORD 'gitlab';
CREATE DATABASE gitlabhq_production  OWNER gitlab;
GRANT ALL PRIVILEGES ON DATABASE gitlabhq_production TO gitlab;

修改了 etc/gitlab/gitlab.rb 文件

 # 关闭使用内部PostgreSQL数据库
postgresql['enable'] = false
postgresql['auto_restart_on_version_change'] = false
geo_postgresql['auto_restart_on_version_change'] = false

# PostgreSQL 连接详情
gitlab_rails['db_adapter'] = 'postgresql'
gitlab_rails['db_encoding'] = 'utf8'
gitlab_rails['db_host'] = '192.168.31.177' # IP/hostname of database server
gitlab_rails['db_database'] = "gitlabhq_production"
gitlab_rails['db_username'] = 'gitlab'
gitlab_rails['db_password'] = 'gitlab'
gitlab_rails['db_port'] = 54321

使用命令重新配置

gitlab-ctl reconfigure

日志打印相关异常

There was an error running gitlab-ctl reconfigure:

rails_migration[gitlab-rails] (gitlab::database_migrations line 51) had an error: Mixlib::ShellOut::ShellCommandFailed: bash_hide_env[migrate gitlab-rails database] (gitlab::database_migrations line 20) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of "bash"  ----
STDOUT: rake aborted!
NoMethodError: undefined method `match' for nil:NilClass

        @version ||= database_version.match(/\A(?:PostgreSQL |)([^\s]+).*\z/)[1]
                                     ^^^^^^
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/reflection.rb:68:in `version'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/reflection.rb:76:in `postgresql_minimum_supported_version?'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database_warnings.rb:11:in `block in check_postgres_version_and_print_warning'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database_warnings.rb:8:in `each'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database_warnings.rb:8:in `check_postgres_version_and_print_warning'
/opt/gitlab/embedded/service/gitlab-rails/ee/lib/ee/gitlab/database_warnings.rb:13:in `check_postgres_version_and_print_warning'
/opt/gitlab/embedded/service/gitlab-rails/config/initializers/1_postgresql_only.rb:6:in `<top (required)>'
/opt/gitlab/embedded/service/gitlab-rails/config/environment.rb:7:in `<top (required)>'
<internal:/opt/gitlab/embedded/lib/ruby/site_ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/opt/gitlab/embedded/lib/ruby/site_ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/opt/gitlab/embedded/bin/bundle:25:in `load'
/opt/gitlab/embedded/bin/bundle:25:in `<main>'
Tasks: TOP => gitlab:db:configure => environment
(See full trace by running task with --trace)
STDERR: 
---- End output of "bash"  ----
Ran "bash"  returned 1

如何解决?

回复

使用道具 举报

评论1

小马哥Lv.8 发表于 2024-9-29 11:07:01 | 显示全部楼层
极狐GitLab 应该是拿某一个版本和人大金仓做了兼容认证。不是每一个版本都做了测试。

如果你的企业有需求,这种应该直接找官方,在官网 https://gitlab.cn 首页打电话或者二维码联系都可以。
开心交流,交流开心。
回复

使用道具 举报

意见建议

Email:forum@gitlab.cn
  • 关注公众号
  • 添加专业顾问
Copyright © 2001-2024 极狐GitLab论坛 版权所有 All Rights Reserved. 鄂ICP备2021008419号-1|鄂公网安备42018502006137号
关灯 快速发帖
扫一扫添加专业顾问
返回顶部
快速回复 返回顶部 返回列表