马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
×
本帖最后由 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
如何解决? |