gitlab升级16.11.3-ee
背景
这是事后一段时间补充记录的博客。
升级目的:修补漏洞CVE-2024-4835
未经认证的威胁攻击者能够利用该漏洞在跨站脚本 (XSS) 攻击中,轻松接管受害者账户。
gitlab版本为14.6.2-ee升级至16.11.3-ee
思路
- 翻阅文档找升级方法及升级版本路径。
- 使用备份文件和测试机器模拟升级。但事后发现模拟升级有用,但效果不大
- 记录测试过程中问题
- 发邮件通知执行升级时间及影响时长
- 执行升级
执行
升级路径
根据官网给的升级路径工具指出要跨多个版本 需要先升级至中间版本状态,再升级至目标版本
refer
升级路径工具
https://gitlab-com.gitlab.io/support/toolbox/upgrade-path
执行升级
yum install -y gitlab-ee-14.9.5
升级至14.9.5过程中的问题
acme证书签发问题
gitlab两种https实现,一种是买第三方的https证书手工配置到nginx上,一种是使用gitlab内置的acme一个证书签发管理工具生成https证书实现加密
报错信息
Acme::Client::Error::AccountDoesNotExist: No account exists with the provided key
Error executing action create
on resource ‘letsencrypt_certificate[abc.xyz.123]’
Error executing action `create` on resource 'letsencrypt_certificate[abc.xyz.123]'================================================================================Acme::Client::Error::AccountDoesNotExist----------------------------------------acme_certificate[staging] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/letsencrypt/resources/certificate.rb line 41) had an error: Acme::Client::Error::AccountDoesNotExist: No account exists with the provided keyCookbook Trace:---------------/opt/gitlab/embedded/cookbooks/cache/cookbooks/acme/libraries/acme.rb:58:in `acme_order_certs_for'/opt/gitlab/embedded/cookbooks/cache/cookbooks/acme/resources/certificate.rb:89:in `block in class_from_file'Resource Declaration:---------------------# In /opt/gitlab/embedded/cookbooks/cache/cookbooks/letsencrypt/recipes/http_authorization.rb6: letsencrypt_certificate site do7: crt node['gitlab']['nginx']['ssl_certificate']8: key node['gitlab']['nginx']['ssl_certificate_key']9: notifies :run, "execute[reload nginx]", :immediate10: notifies :run, 'ruby_block[display_le_message]'11: only_if { omnibus_helper.service_up?('nginx') }12: endCompiled Resource:------------------# Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/letsencrypt/recipes/http_authorization.rb:6:in `from_file'letsencrypt_certificate("abc.xyz.123") doaction [:create]updated trueupdated_by_last_action truedefault_guard_interpreter :defaultdeclared_type :letsencrypt_certificatecookbook_name "letsencrypt"recipe_name "http_authorization"crt "/etc/gitlab/ssl/abc.xyz.123_cert_chain.pem"key "/etc/gitlab/ssl/abc.xyz.123_key.key"alt_names []cn "abc.xyz.123"only_if { #code block }endSystem Info:------------chef_version=15.17.4platform=centosplatform_version=7.9.2009ruby=ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [x86_64-linux]program_name=/opt/gitlab/embedded/bin/chef-clientexecutable=/opt/gitlab/embedded/bin/chef-clientRecipe: nginx::enable* runit_service[nginx] action restart (up to date)Running handlers:
There was an error running gitlab-ctl reconfigure:letsencrypt_certificate[abc.xyz.123] (letsencrypt::http_authorization line 6) had an error: Acme::Client::Error::AccountDoesNotExist: acme_certificate[staging] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/letsencrypt/resources/certificate.rb line 41) had an error: Acme::Client::Error::AccountDoesNotExist: No account exists with the provided keyRunning handlers complete
Chef Infra Client failed. 4 resources updated in 17 secondsj
解决
移除上一次使用的自签名证书
[root@instance-vl1r58a5 acme]# pwd
/etc/acme
[root@instance-vl1r58a5 acme]# mv account_private_key.pem account_private_key.pem.bak20240531
[root@instance-vl1r58a5 acme]# ls
account_private_key.pem account_private_key.pem.backup20220926 account_private_key.pem.bak20240531
[root@instance-vl1r58a5 acme]# gitlab-ctl reconfigure
refer
https://gbe0.com/posts/linux/server/gitlab-acme-account-does-not-exist/
https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/6610
https://forum.gitlab.com/t/gitlab-letsencrypt-issue/63737
继续升级无报错
yum install -y gitlab-ee-14.9.5
yum install -y gitlab-ee-14.10.5
yum install -y gitlab-ee-15.0.5
yum install -y gitlab-ee-15.4.6
yum install -y gitlab-ee-15.11.13
pg数据库报错token设置不符合约束,是gitlab配置的token有效期不能设置为永不过期
报错信息
Error ensuring PostgreSQL is updated. Please check the logs
warning: %posttrans(gitlab-ee-15.11.13-ee.0.el7.x86_64) scriptlet failed, exit status 1
PG::CheckViolation: ERROR: check constraint “check_70f294ef54” of relation “oauth_access_tokens” is violated by some row
main: -- quote_column_name("group_ci_variables")rake aborted!
StandardError: An error has occurred, all later migrations canceled:PG::CheckViolation: ERROR: check constraint "check_70f294ef54" of relation "oauth_access_tokens" is violated by some row
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/constraints_helpers.rb:119:in `block in validate_check_constraint'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/timeout_helpers.rb:31:in `disable_statement_timeout'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/constraints_helpers.rb:116:in `validate_check_constraint'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/constraints_helpers.rb:232:in `validate_not_null_constraint'
/opt/gitlab/embedded/service/gitlab-rails/db/post_migrate/20230223014251_validate_not_null_constraint_on_oauth_access_tokens_expires_in.rb:7:in `up'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers/restrict_gitlab_schema.rb:33:in `block in exec_migration'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/query_analyzer.rb:37:in `within'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers/restrict_gitlab_schema.rb:30:in `exec_migration'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers/automatic_lock_writes_on_tables.rb:19:in `exec_migration'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/lock_retry_mixin.rb:36:in `ddl_transaction'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/pg_backend_pid.rb:15:in `block in with_advisory_lock_connection'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/pg_backend_pid.rb:12:in `with_advisory_lock_connection'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:117:in `configure_database'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:95:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'Caused by:
ActiveRecord::StatementInvalid: PG::CheckViolation: ERROR: check constraint "check_70f294ef54" of relation "oauth_access_tokens" is violated by some row
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/constraints_helpers.rb:119:in `block in validate_check_constraint'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/timeout_helpers.rb:31:in `disable_statement_timeout'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/constraints_helpers.rb:116:in `validate_check_constraint'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/constraints_helpers.rb:232:in `validate_not_null_constraint'
/opt/gitlab/embedded/service/gitlab-rails/db/post_migrate/20230223014251_validate_not_null_constraint_on_oauth_access_tokens_expires_in.rb:7:in `up'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers/restrict_gitlab_schema.rb:33:in `block in exec_migration'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/query_analyzer.rb:37:in `within'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers/restrict_gitlab_schema.rb:30:in `exec_migration'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers/automatic_lock_writes_on_tables.rb:19:in `exec_migration'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/lock_retry_mixin.rb:36:in `ddl_transaction'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/pg_backend_pid.rb:15:in `block in with_advisory_lock_connection'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/pg_backend_pid.rb:12:in `with_advisory_lock_connection'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:117:in `configure_database'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:95:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'Caused by:
PG::CheckViolation: ERROR: check constraint "check_70f294ef54" of relation "oauth_access_tokens" is violated by some row
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/constraints_helpers.rb:119:in `block in validate_check_constraint'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/timeout_helpers.rb:31:in `disable_statement_timeout'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/constraints_helpers.rb:116:in `validate_check_constraint'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/constraints_helpers.rb:232:in `validate_not_null_constraint'
/opt/gitlab/embedded/service/gitlab-rails/db/post_migrate/20230223014251_validate_not_null_constraint_on_oauth_access_tokens_expires_in.rb:7:in `up'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers/restrict_gitlab_schema.rb:33:in `block in exec_migration'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/query_analyzer.rb:37:in `within'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers/restrict_gitlab_schema.rb:30:in `exec_migration'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers/automatic_lock_writes_on_tables.rb:19:in `exec_migration'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/lock_retry_mixin.rb:36:in `ddl_transaction'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/pg_backend_pid.rb:15:in `block in with_advisory_lock_connection'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/pg_backend_pid.rb:12:in `with_advisory_lock_connection'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:117:in `configure_database'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:95:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)main: -> 0.0000s
main: -- quote("early_adopter")
main: -> 0.0000s
main: -- quote(30000)
main: -> 0.0000s
main: -- execute("INSERT INTO plan_limits (plan_id, \"group_ci_variables\")\nSELECT id, '30000' FROM plans WHERE name = 'early_adopter' LIMIT 1\nON CONFLICT (plan_id) DO UPDATE SET \"group_ci_variables\" = EXCLUDED.\"group_ci_variables\";\n")
main: -> 0.0007s
main: -- quote_column_name("group_ci_variables")
main: -> 0.0000s
main: -- quote("opensource")
main: -> 0.0000s
main: -- quote(30000)
main: -> 0.0000s
main: -- execute("INSERT INTO plan_limits (plan_id, \"group_ci_variables\")\nSELECT id, '30000' FROM plans WHERE name = 'opensource' LIMIT 1\nON CONFLICT (plan_id) DO UPDATE SET \"group_ci_variables\" = EXCLUDED.\"group_ci_variables\";\n")
main: -> 0.0009s
main: == 20230221162222 RaiseCiVariableLimitsOnGitlabCom: migrated (0.0220s) ========main: == 20230221214519 RemoveIncorrectlyOnboardedNamespacesFromOnboardingProgress: migrating
main: == 20230221214519 RemoveIncorrectlyOnboardedNamespacesFromOnboardingProgress: migrated (0.0499s)main: == 20230222035805 PrepareAsyncIndexRemovalOfTokenForCiBuilds: migrating =======
main: -- index_exists?(:ci_builds, :token_encrypted, {:name=>:index_ci_builds_on_token_encrypted})
main: -> 0.0183s
main: -- quote_column_name(:index_ci_builds_on_token_encrypted)
main: -> 0.0000s
main: == 20230222035805 PrepareAsyncIndexRemovalOfTokenForCiBuilds: migrated (0.0280s)main: == 20230222055510 RemoveConcurrentIndexOnTokenEncryptedForCiBuilds: migrating =
main: -- transaction_open?()
main: -> 0.0000s
main: -- view_exists?(:postgres_partitions)
main: -> 0.0008s
main: -- indexes(:ci_builds)
main: -> 0.0183s
main: -- execute("SET statement_timeout TO 0")
main: -> 0.0003s
main: -- remove_index(:ci_builds, {:algorithm=>:concurrently, :name=>:index_ci_builds_on_token_encrypted})
main: -> 0.0067s
main: -- execute("RESET statement_timeout")
main: -> 0.0003s
main: == 20230222055510 RemoveConcurrentIndexOnTokenEncryptedForCiBuilds: migrated (0.0383s)main: == 20230222101420 RemoveFkToCiBuildCiPendingBuildOnBuildId: migrating =========
main: -- transaction_open?()
main: -> 0.0000s
main: -- transaction_open?()
main: -> 0.0000s
main: -- execute("LOCK TABLE ci_builds, ci_pending_builds IN ACCESS EXCLUSIVE MODE")
main: -> 0.0004s
main: -- remove_foreign_key(:ci_pending_builds, :ci_builds, {:name=>:fk_rails_725a2644a3})
main: -> 0.0059s
main: == 20230222101420 RemoveFkToCiBuildCiPendingBuildOnBuildId: migrated (0.0177s)main: == 20230222102421 RemoveFkToCiBuildCiRunningBuildOnBuildId: migrating =========
main: -- transaction_open?()
main: -> 0.0000s
main: -- transaction_open?()
main: -> 0.0000s
main: -- execute("LOCK TABLE ci_builds, ci_running_builds IN ACCESS EXCLUSIVE MODE")
main: -> 0.0004s
main: -- remove_foreign_key(:ci_running_builds, :ci_builds, {:name=>:fk_rails_da45cfa165})
main: -> 0.0058s
main: == 20230222102421 RemoveFkToCiBuildCiRunningBuildOnBuildId: migrated (0.0179s)main: == 20230222153048 AddRegistrySizeEstimatedToNamespaceRootStorageStatistics: migrating
main: -- transaction_open?()
main: -> 0.0000s
main: -- add_column(:namespace_root_storage_statistics, :registry_size_estimated, :boolean, {:default=>false, :null=>false})
main: -> 0.0012s
main: -- transaction_open?()
main: -> 0.0000s
main: -- view_exists?(:postgres_partitions)
main: -> 0.0008s
main: -- index_exists?(:namespace_root_storage_statistics, :registry_size_estimated, {:name=>"index_ns_root_stor_stats_on_registry_size_estimated", :algorithm=>:concurrently})
main: -> 0.0024s
main: -- execute("SET statement_timeout TO 0")
main: -> 0.0002s
main: -- add_index(:namespace_root_storage_statistics, :registry_size_estimated, {:name=>"index_ns_root_stor_stats_on_registry_size_estimated", :algorithm=>:concurrently})
main: -> 0.0044s
main: -- execute("RESET statement_timeout")
main: -> 0.0003s
main: == 20230222153048 AddRegistrySizeEstimatedToNamespaceRootStorageStatistics: migrated (0.0215s)main: == 20230222161226 AddCustomJiraRegexToJiraTrackerData: migrating ==============
main: -- add_column(:jira_tracker_data, :jira_issue_prefix, :text)
main: -> 0.0006s
main: -- add_column(:jira_tracker_data, :jira_issue_regex, :text)
main: -> 0.0005s
main: == 20230222161226 AddCustomJiraRegexToJiraTrackerData: migrated (0.0056s) =====main: == 20230222161954 AddTextLimitToCustomJiraRegexFields: migrating ==============
main: -- transaction_open?()
main: -> 0.0000s
main: -- transaction_open?()
main: -> 0.0000s
main: -- execute("ALTER TABLE jira_tracker_data\nADD CONSTRAINT check_4cc5bbc801\nCHECK ( char_length(jira_issue_prefix) <= 255 )\nNOT VALID;\n")
main: -> 0.0006s
main: -- execute("SET statement_timeout TO 0")
main: -> 0.0008s
main: -- execute("ALTER TABLE jira_tracker_data VALIDATE CONSTRAINT check_4cc5bbc801;")
main: -> 0.0008s
main: -- execute("RESET statement_timeout")
main: -> 0.0002s
main: -- transaction_open?()
main: -> 0.0000s
main: -- transaction_open?()
main: -> 0.0000s
main: -- execute("ALTER TABLE jira_tracker_data\nADD CONSTRAINT check_9863a0a5fd\nCHECK ( char_length(jira_issue_regex) <= 255 )\nNOT VALID;\n")
main: -> 0.0005s
main: -- execute("SET statement_timeout TO 0")
main: -> 0.0002s
main: -- execute("ALTER TABLE jira_tracker_data VALIDATE CONSTRAINT check_9863a0a5fd;")
main: -> 0.0007s
main: -- execute("RESET statement_timeout")
main: -> 0.0002s
main: == 20230222161954 AddTextLimitToCustomJiraRegexFields: migrated (0.0169s) =====main: == 20230222193845 ChangePublicProjectsMinutesCostFactorDefaultTo1: migrating ==
main: -- transaction_open?()
main: -> 0.0000s
main: -- change_column_default(:ci_runners, :public_projects_minutes_cost_factor, {:from=>0.0, :to=>1.0})
main: -> 0.0031s
main: == 20230222193845 ChangePublicProjectsMinutesCostFactorDefaultTo1: migrated (0.0093s)main: == 20230223014251 ValidateNotNullConstraintOnOauthAccessTokensExpiresIn: migrating
main: -- execute("SET statement_timeout TO 0")
main: -> 0.0002s
main: -- execute("ALTER TABLE oauth_access_tokens VALIDATE CONSTRAINT check_70f294ef54;")
main: -- execute("RESET statement_timeout")
main: -> 0.0002s
STDERR:
---- End output of "bash" ----
Ran "bash" returned 1
Running reconfigure: NOT OK
== Fatal error ==
Something went wrong during final reconfiguration, please check the output
== Reverting ==
ok: down: postgresql: 0s, normally up
Symlink correct version of binaries: OK
ok: run: postgresql: (pid 40162) 0s
== Reverted ==
== Reverted to 12.14. Please check output for what went wrong ==
Toggling deploy page:rm -f /opt/gitlab/embedded/service/gitlab-rails/public/index.html
Toggling deploy page: OK
Toggling services:ok: run: alertmanager: (pid 40177) 0s
ok: run: crond: (pid 40188) 1s
ok: run: gitaly: (pid 40196) 0s
ok: run: gitlab-exporter: (pid 40216) 1s
ok: run: gitlab-kas: (pid 40109) 5s
ok: run: grafana: (pid 40220) 0s
ok: run: logrotate: (pid 40231) 0s
ok: run: node-exporter: (pid 40237) 1s
ok: run: postgres-exporter: (pid 40244) 0s
ok: run: prometheus: (pid 40252) 1s
ok: run: redis-exporter: (pid 40263) 0s
ok: run: registry: (pid 40273) 1s
ok: run: sidekiq: (pid 40283) 0s
Toggling services: OK
Checking if a newer PostgreSQL version is available and attempting automatic upgrade to it: NOT OK
Error ensuring PostgreSQL is updated. Please check the logs
warning: %posttrans(gitlab-ee-15.11.13-ee.0.el7.x86_64) scriptlet failed, exit status 1
Non-fatal POSTTRANS scriptlet failure in rpm package gitlab-ee-15.11.13-ee.0.el7.x86_64Verifying : gitlab-ee-15.11.13-ee.0.el7.x86_64 1/2Verifying : gitlab-ee-15.4.6-ee.0.el7.x86_64 2/2Updated:gitlab-ee.x86_64 0:15.11.13-ee.0.el7 Complete!
解决
# 停止数据库连接
gitlab-ctl stop unicorn
gitlab-ctl stop sidekiqgitlab-psql -d gitlabhq_production
gitlabhq_production=# SELECT * FROM oauth_access_tokens WHERE expires_in IS NULL;id | resource_owner_id | application_id | token | refresh_token | expires_in | revoked_at | created_at | scopes
----+-------------------+----------------+------------------------------------------------------------------+------------------------------------------------------------------+------------+------------+----------------------------+-----------1 | 4 | 1 | effcc3b35xxxxx909542e6cdfa34b5528 | 75d6c18ffb3a4ba4xxxxxxxxca27f35 | | | 2022-02-17 15:01:40.419753 | read_user
(1 row)gitlabhq_production=# UPDATE oauth_access_tokens SET expires_in = '86400' WHERE expires_in IS NULL;
UPDATE 1
gitlabhq_production=# select * from oauth_access_tokens where expires_in IS NULL;id | resource_owner_id | application_id | token | refresh_token | expires_in | revoked_at | created_at | scopes
----+-------------------+----------------+-------+---------------+------------+------------+------------+--------
(0 rows)
refer
https://docs.gitlab.com/ee/update/versions/gitlab_15_changes.html
pg版本不受支持
解决:升级pg到指定版本13
# 查看当前pg版本
[root@instance-vl1r58a5 ~]# /opt/gitlab/embedded/bin/psql --version
psql (PostgreSQL) 12.14
# 升级至13版本
[root@instance-vl1r58a5 ~]# gitlab-ctl pg-upgrade -V 13
Checking for an omnibus managed postgresql: OK
Checking if postgresql['version'] is set: OK
Checking if we already upgraded: NOT OK
Checking for a newer version of PostgreSQL to install
Upgrading PostgreSQL to 13.11
Checking if disk for directory /var/opt/gitlab/postgresql/data has enough free space for PostgreSQL upgrade: OK
Checking if PostgreSQL bin files are symlinked to the expected location: OK
Waiting 30 seconds to ensure tasks complete before PostgreSQL upgrade.
See https://docs.gitlab.com/omnibus/settings/database.html#upgrade-packaged-postgresql-server for details
If you do not want to upgrade the PostgreSQL server at this time, enter Ctrl-C and see the documentation for detailsPlease hit Ctrl-C now if you want to cancel the operation.
Toggling deploy page:cp /opt/gitlab/embedded/service/gitlab-rails/public/deploy.html /opt/gitlab/embedded/service/gitlab-rails/public/index.html
Toggling deploy page: OK
Toggling services:ok: down: alertmanager: 0s, normally up
ok: down: crond: 1s, normally up
ok: down: gitaly: 1s, normally up
ok: down: gitlab-exporter: 1s, normally up
ok: down: gitlab-kas: 0s, normally up
ok: down: grafana: 0s, normally up
ok: down: logrotate: 0s, normally up
ok: down: node-exporter: 1s, normally up
ok: down: postgres-exporter: 0s, normally up
ok: down: prometheus: 1s, normally up
ok: down: redis-exporter: 0s, normally up
ok: down: registry: 1s, normally up
ok: down: sidekiq: 0s, normally up
Toggling services: OK
Running stop on postgresql:ok: down: postgresql: 1s, normally up
Running stop on postgresql: OK
Symlink correct version of binaries: OK
Creating temporary data directory: OK
Initializing the new database: OK
Upgrading the data: OK
Move the old data directory out of the way: OK
Rename the new data directory: OK
Saving the old version information: OK
Configuring PostgreSQL
[2024-05-31T23:33:40+08:00] INFO: Started Cinc Zero at chefzero://localhost:1 with repository at /opt/gitlab/embedded (One version per cookbook)
Cinc Client, version 17.10.0
Patents: https://www.chef.io/patents
Infra Phase starting
[2024-05-31T23:33:40+08:00] INFO: *** Cinc Client 17.10.0 ***
[2024-05-31T23:33:40+08:00] INFO: Platform: x86_64-linux
[2024-05-31T23:33:40+08:00] INFO: Cinc-client pid: 3541
[2024-05-31T23:33:42+08:00] INFO: Setting the run_list to ["recipe[gitlab-ee::config]", "recipe[postgresql::enable]"] from CLI options
[2024-05-31T23:33:42+08:00] INFO: Run List is [recipe[gitlab-ee::config], recipe[postgresql::enable]]
[2024-05-31T23:33:42+08:00] INFO: Run List expands to [gitlab-ee::config, postgresql::enable]
[2024-05-31T23:33:42+08:00] INFO: Starting Cinc Client Run for instance-vl1r58a5
[2024-05-31T23:33:42+08:00] INFO: Running start handlers
[2024-05-31T23:33:42+08:00] INFO: Start handlers complete.
Resolving cookbooks for run list: ["gitlab-ee::config", "postgresql::enable"]
[2024-05-31T23:33:43+08:00] INFO: Loading cookbooks [gitlab-ee@0.0.1, postgresql@0.1.0, package@0.1.0, gitlab@0.0.1, consul@0.1.0, patroni@0.1.0, pgbouncer@0.1.0, spamcheck@0.1.0, runit@5.1.7, logrotate@0.1.0, redis@0.1.0, monitoring@0.1.0, registry@0.1.0, mattermost@0.1.0, gitaly@0.1.0, praefect@0.1.0, gitlab-kas@0.1.0, gitlab-pages@0.1.0, letsencrypt@0.1.0, nginx@0.1.0, acme@4.1.6, crond@0.1.0]
Synchronizing cookbooks:- gitlab-ee (0.0.1)- postgresql (0.1.0)- package (0.1.0)- gitlab (0.0.1)- consul (0.1.0)- patroni (0.1.0)- pgbouncer (0.1.0)- spamcheck (0.1.0)- runit (5.1.7)- logrotate (0.1.0)- redis (0.1.0)- monitoring (0.1.0)- registry (0.1.0)- mattermost (0.1.0)- gitaly (0.1.0)- praefect (0.1.0)- gitlab-kas (0.1.0)- gitlab-pages (0.1.0)- letsencrypt (0.1.0)- nginx (0.1.0)- crond (0.1.0)- acme (4.1.6)
Installing cookbook gem dependencies:
Compiling cookbooks...
Loading Cinc Auditor profile files:Running handlers:
[2024-05-31T23:34:07+08:00] INFO: Running report handlers
Running handlers complete
[2024-05-31T23:34:07+08:00] INFO: Report handlers complete
Infra Phase complete, 8/964 resources updated in 15 seconds
[2024-05-31T23:34:07+08:00] WARN: This release of Cinc Client became end of life (EOL) on May 1st 2023. Please update to a supported release to receive new features, bug fixes, and security updates.
Running reconfigure: OK
Waiting for Database to be running.
Database upgrade is complete, running vacuumdb analyze
Toggling deploy page:rm -f /opt/gitlab/embedded/service/gitlab-rails/public/index.html
Toggling deploy page: OK
Toggling services:ok: run: alertmanager: (pid 4287) 1s
ok: run: crond: (pid 4297) 0s
ok: run: gitaly: (pid 4306) 1s
ok: run: gitlab-exporter: (pid 4325) 0s
ok: run: gitlab-kas: (pid 4328) 0s
ok: run: grafana: (pid 4339) 1s
ok: run: logrotate: (pid 4350) 0s
ok: run: node-exporter: (pid 4359) 1s
ok: run: postgres-exporter: (pid 4366) 0s
ok: run: prometheus: (pid 4378) 1s
ok: run: redis-exporter: (pid 4389) 0s
ok: run: registry: (pid 4397) 0s
ok: run: sidekiq: (pid 4407) 1s
Toggling services: OK
==== Upgrade has completed ====
Please verify everything is working and run the following if so
sudo rm -rf /var/opt/gitlab/postgresql/data.12
sudo rm -f /var/opt/gitlab/postgresql-version.old# 验证
[root@instance-vl1r58a5 ~]# /opt/gitlab/embedded/bin/psql --version
psql (PostgreSQL) 13.11
升级之后要手工合并一下数据,完成数据库迁移
# 合并
[root@instance-vl1r58a5 ~]# gitlab-rake db:migrate
# 在此检查状态ok
[root@instance-vl1r58a5 ~]# gitlab-rake db:migrate:status
# 所有的status状态为up即正常
# 重新加载gitlab配置
gitlab-ctl reconfigure
refer
https://docs.gitlab.com/ee/update/versions/gitlab_15_changes.html
https://docs.gitlab.com/ee/administration/raketasks/maintenance.html#run-incomplete-database-migrations
继续升级,后续升级无报错
yum install -y gitlab-ee-16.3.7
yum install -y gitlab-ee-16.7.7
yum install -y gitlab-ee-16.11.3
其他命令
# 恢复备份命令
gitlab-rake gitlab:backup:restore BACKUP=1621908711
# 查看gitlab版本
cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
gitlab-rake gitlab:env:info
gitlab如果在web端禁用了root用户登录,如下命令启用root用户
gitlabhq_production=# UPDATE users SET state='active' WHERE username='root';
UPDATE 1
修改用户密码
https://docs.gitlab.cn/jh/security/reset_user_password.html
rails控制台
gitlab-rails console
irb(main):006:0> user = User.find_by(username: 'root')
=> #<User id:1 @root>
irb(main):007:0> user.password = 'xxx'
irb(main):008:0> user.password_confirmation = 'xxxx'
irb(main):009:0> user.save
=> true
irb(main):010:0> exit
refer
漏洞信息
https://about.gitlab.com/releases/2024/05/22/patch-release-gitlab-17-0-1-released/
https://gbe0.com/posts/linux/server/gitlab-acme-account-does-not-exist/
https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/6610
https://forum.gitlab.com/t/gitlab-letsencrypt-issue/63737
https://docs.gitlab.com/ee/update/versions/gitlab_15_changes.html
https://docs.gitlab.com/ee/update/versions/gitlab_15_changes.html
https://docs.gitlab.com/ee/administration/raketasks/maintenance.html#run-incomplete-database-migrations
相关文章:
![](https://img-blog.csdnimg.cn/direct/c2d68c4965a94557ab26513558ad78d0.png)
gitlab升级16.11.3-ee
背景 这是事后一段时间补充记录的博客。 升级目的:修补漏洞CVE-2024-4835 未经认证的威胁攻击者能够利用该漏洞在跨站脚本 (XSS) 攻击中,轻松接管受害者账户。 gitlab版本为14.6.2-ee升级至16.11.3-ee 思路 翻阅文档找升级方法及升级版本路径。使用…...
![](https://img-blog.csdnimg.cn/direct/3dba62a78a74440fa213d723814ece81.png)
剑指offer 算法题(搜索二维矩阵)
剑指offer 第二题 去力扣里测试算法 思路一: 直接暴力遍历二维数组。 class Solution { public:bool searchMatrix(vector<vector<int>>& matrix, int target) {for (unsigned int i{ 0 }; i < matrix.size(); i){for (unsigned int j{ 0 };…...
![](https://www.ngui.cc/images/no-images.jpg)
SaaS平台数据对接为什么要选择API对接?
SaaS平台数据对接是指将一个或多个SaaS平台中的数据集成到其他应用或平台中的过程。在当前的数字化时代,企业越来越倾向于使用SaaS平台来管理他们的业务和数据。然而,这些数据通常散布在不同的SaaS平台中,这对于企业数据的整合和分析来说可能…...
![](https://img-blog.csdnimg.cn/direct/d82cef6d814343279ad4f4114fe4ee61.png)
力扣136. 只出现一次的数字
Problem: 136. 只出现一次的数字 文章目录 题目描述思路复杂度Code 题目描述 思路 由于题目要求使用线性时间复杂度和常量级的空间复杂度,再加上找重复元素这个特性,我们可以想到使用位运算来求解: 1.任何数与其本身异或得0,任何…...
![](https://img-blog.csdnimg.cn/direct/1220b43142a047fdb2d4ab04826bd6cd.png)
重学java 74.Lombok的使用
少点心气,多点干劲 —— 24.6.18 一、lombok的安装使用 1.作用: 简化javabean开发 2.使用: a.下插件 ->如果是idea2022不用下载了,自带 b.导lombok的jar包 安装教程: http://t.csdnimg.cn/wq9MM c.修改设置 二、lombok的介绍 Lombok通过增加一…...
![](https://img-blog.csdnimg.cn/direct/5301219c839145b48f493d7750a5ad84.jpeg)
数据结构6---树
一、定义 树(Tree)是n(n>0)个结点的有限集。当n0时成为空树,在任意一棵非空树中: 1、有且仅有一个特定的称为根(Root)的结点; 2、当n>1时,其余结点可分为m(m>日)个互不相交的有限集T1、T2、...、 Tm,其中每一个集合本身又是一棵树,并且称为根的…...
![](https://img-blog.csdnimg.cn/img_convert/5105e816ed068c9c3c5f8a7f7be47211.png)
一键制作,打造高质量的数字刊物
随着数字化时代的到来,数字刊物已经成为信息传播的重要载体。它以便捷、环保、互动性强等特点,受到了越来越多人的青睐。然而,如何快速、高效地制作出高质量的数字刊物,成为许多创作者面临的难题。今天,教大家一个制作…...
![](https://www.ngui.cc/images/no-images.jpg)
Java面试题:对比继承Thread类和实现Runnable接口两种创建线程的方法,以及它们的优缺点
Java 中创建线程有两种主要的方法:继承 Thread 类和实现 Runnable 接口。下面我将分别介绍这两种方法,并对比它们的优缺点。 继承 Thread 类 方法: 创建一个继承自 Thread 的子类。重写 Thread 类的 run 方法。创建子类的实例并调用 start…...
![](https://img-blog.csdnimg.cn/direct/8ee95dd9c09844299ce12ee0fdb8bbfe.png)
编译原理-各章典型题型+思路求解
第2章文法和语言习题 基础知识: 思路: 基础知识: 思路: 基础知识: 编译原理之 短语&直接短语&句柄 定义与区分_编译原理短语,直接短语,句柄-CSDN博客 思路: 题目: 基础解释:…...
![](https://www.ngui.cc/images/no-images.jpg)
【绝对有用】C++ vector排序
在 C 中,有多种方法可以对向量(即 std::vector)进行排序。最常用的方法是使用标准库中的 std::sort 函数。以下是一些例子: 使用 std::sort 函数 std::sort 函数是标准库 <algorithm> 中的一个函数,可以对向量…...
![](https://www.ngui.cc/images/no-images.jpg)
linux——VScode安装
方法一:使用snap一键安装 Snap Store 是 Ubuntu、Debian、Fedora 和其他几个 Linux 发行版中的一个应用商店,提供了数千个应用程序和工具的安装。Snap Store 使用 Snap 包格式,这是一种通用的 Linux 软件包格式,使得在不同的 Lin…...
![](https://www.ngui.cc/images/no-images.jpg)
X-LoRA:高效微调 LoRA 系列,实现不同领域知识专家混合模型
📜 文献卡 X-LoRA: Mixture of Low-Rank Adapter Experts, a Flexible Framework for Large Language Models with Applications in Protein Mechanics and Molecular Design作者: Eric L. Buehler; Markus J. BuehlerDOI: 10.48550/arXiv.2402.07148摘要:We report…...
![](https://img-blog.csdnimg.cn/direct/778e5f1c21724c7eaffadf3c06c594e8.jpeg)
基于卷积神经网络的目标检测
卷积神经网络基础知识 1.什么是filter 通常一个6x6的灰度图像,构造一个3*3的矩阵,在卷积神经网络中称之为filter,对6x6的图像进行卷积运算。 2.什么是padding 假设输出图像大小为nn与过滤器大小为ff,输出图像大小则为(n−f1)∗(…...
![](https://img-blog.csdnimg.cn/direct/8a2702fb163c4a93a33937cadd749b69.png)
Mysqld数据库管理
一.Mysqld数据库类型 常用的数据类型 int 整型 无符号[0-4294967296(2的32次方)-1],有符号[-2147483648(2的31次方)-2147483647]float单精度浮点 4字节32位double双精度浮点 8字节64位char固定长度的字符类型…...
![](https://img-blog.csdnimg.cn/direct/01f36b83423a4fe4b527298c53e243f6.png)
Wifi通信协议:WEP,WPA,WPA2,WPA3,WPS
前言 无线安全性是保护互联网安全的重要因素。连接到安全性低的无线网络可能会带来安全风险,包括数据泄露、账号被盗以及恶意软件的安装。因此,利用合适的Wi-Fi安全措施是非常重要的,了解WEP、WPA、WPA2和WPA3等各种无线加密标准的区别也是至…...
![](https://www.ngui.cc/images/no-images.jpg)
开源【汇总】
开源【汇总】 前言版权推荐开源【汇总】最后 前言 先占个位 2024-6-21 21:29:33 以下内容源自《【创作模板】》 仅供学习交流使用 版权 禁止其他平台发布时删除以下此话 本文首次发布于CSDN平台 作者是CSDN日星月云 博客主页是https://jsss-1.blog.csdn.net 禁止其他平台发…...
![](https://img-blog.csdnimg.cn/direct/426f4cc78c9d47f8ba0a42da0d640810.png)
英文字母表
目录 一 设计原型 二 后台源码 一 设计原型 二 后台源码 namespace 英文字母表 {public partial class Form1 : Form{public Form1(){InitializeComponent();}private void Form1_Load(object sender, EventArgs e){foreach (var item in panel1.Controls){if (item ! null)…...
![](https://img-blog.csdnimg.cn/direct/d5eda8c130f448f5a333cf5522d70021.png)
Redis缓存穿透
缓存穿透: 查询一个不存在的数据,mysql查询不到数据也不会直接写入缓存,就会导致每次请求都查数据库。 方法一: 方法二: 布隆过滤器: 简单来说就是一个二进制数组,用0和1来判断数组中是否存在…...
![](https://www.ngui.cc/images/no-images.jpg)
SHELL脚本学习(十一)正则表达式
一、锚点字符 1.1 锚点行首 脱字符(^)指出行首位置 $ cat < file1 test line1 test line2 test line3 line4 test#打印所有包括文本 test的行 $ sed -n /test/p file1 test line1 test line2 test line3 line4 test#打印所有以test为首的行 $ sed -n /^test/p file1 test…...
![](https://www.ngui.cc/images/no-images.jpg)
Leetcode Java学习记录——代码随想录哈希表篇
文章目录 哈希表几种哈希实现 Java数组HashSetmap方法charAt()toCharArray()for 遍历长度 哈希表 当需要快速判断一个元素是否出现在集合里的时候,就要用到哈希表。 无限循环就意味着重复出现。 几种哈希实现 数组:大小固定set:只存keymap…...
![](https://img-blog.csdnimg.cn/img_convert/137c92c0d9fed9d037586d0640ee8a26.jpeg)
我又挖到宝了!小米、352、希喂宠物空气净化器除毛能力PK
养宠家庭常常因为猫咪们掉毛的问题烦恼。无论是短毛猫还是长毛猫,它们的毛发总是无处不在,从沙发到地毯,从床铺到衣物,甚至飘散在空气中。其中最难清理的就是飘浮在空气中的浮毛,最让人担心的是,空气中的浮…...
![](https://img-blog.csdnimg.cn/direct/9e0ed269af3243ea83bea8a217c2e324.png)
每月 GitHub 探索|10 款引领科技趋势的开源项目
1.IT-Tools 仓库名称: CorentinTh/it-tools 截止发稿星数: 16842 (近一个月新增:5744) 仓库语言: Vue 仓库开源协议: GNU General Public License v3.0 引言 CorentinTh/it-tools 是一个开源项目,提供各种对开发者友好的在线工具࿰…...
![](https://www.ngui.cc/images/no-images.jpg)
【如何让新增的Android.mk参与编译】
步骤1: 你需要在你新增的Android.mk目录以上的位置找一个已有的Android.mk 步骤2: 在原本已有的Android.mk中加入: //这是你新增的Android.mk文件的路径 include $(LOCAL_PATH)/xxx/xxx/Android.mk如果有些多可以这样写 //dir1 dir2是你新…...
![](https://img-blog.csdnimg.cn/direct/d0c2dffdaed34f399406e56d79046a7a.gif)
【windows|009】计算机网络基础知识
🍁博主简介: 🏅云计算领域优质创作者 🏅2022年CSDN新星计划python赛道第一名 🏅2022年CSDN原力计划优质作者 🏅阿里云ACE认证高级工程师 🏅阿里云开发者社区专家博主 💊交流社…...
![](https://www.ngui.cc/images/no-images.jpg)
C语言循环中获取之前变量的值
获取上个数组变量的值 #include <stdio.h> #include <string.h>enum { GG, DD }; int main() {int bi[] {0, 0};int bi_s1[] {0, 0};for (int i 0; i < 5; i) {memcpy(bi_s1, bi, sizeof(bi));bi[GG] i * 3;bi[DD] i * 2;printf("bigg %d, bigg_s1 …...
![](https://www.ngui.cc/images/no-images.jpg)
must be built with the ios 17 sdk or later,included in Xcode 15 or later.
2024.4.29 号开始,苹果又开始搞开发者了。 Xcode - 支持 - Apple Developer xcode可以从这里下载, Sign In - Apple 电脑不支持,头疼,必须 macOS Ventura 13.5 或以上才能支持。 电脑哪里搞,再买一台吗? 用…...
![](https://img-blog.csdnimg.cn/direct/fa8ac5e9a354444b985085431168138c.png)
Unity2D计算两个物体的距离
1.首先新建一个场景并添加2个物体 2.创建一个脚本并编写代码 using UnityEngine;public class text2: MonoBehaviour {public GameObject gameObject1; // 第一个物体public GameObject gameObject2; // 第二个物体void Update(){// 计算两个物体之间的距离float distance Vec…...
![](https://img-blog.csdnimg.cn/direct/80af8bb2112742ac87bc577d4d9e37b8.png)
Spring IOC 控制反转(注解版)
Spring IOC 控制反转 文章目录 Spring IOC 控制反转一、前言什么是控制反转(IOC)什么是依赖注入(DI) 二、介绍 IOC2.1 传统思想代码2.2 解决方案2.3 IOC思想代码2.4 IOC 使用(Autowired依赖注入)2.5 IOC 优…...
![](https://www.ngui.cc/images/no-images.jpg)
串口触摸屏的键盘控制
(text 属性txt_maxl 800) ①变量loadpageid.val:调用页的页面ID。 ②变量loadcmpid.val:调用页的控件ID。 ③定时器tm0:让输入框有个光标不断闪烁,如果不需要,控件属性en0即可。 ④变量inputlen…...
![](https://img-blog.csdnimg.cn/direct/d03cdba64dad4d8ba339311f5853bfdd.png)
xss初识(xss-lab)
XSS跨站脚本 XSS漏洞概述 XSS被称为跨站脚本攻击(Cross-site scripting),由于和CSS(Cascading Style Sheets) 重名,所以改为XSS。 XSS主要基于javascript语言完成恶意的攻击行为,因为javascri…...
![](https://img-blog.csdnimg.cn/img_convert/76609db2875bda61d6ebf0fb66fe504a.png)
弥勒市建设局网站/怎么做好seo推广
你理想中的工作台是什么样的?现在很多小伙伴喜欢宅家办工,所以,在家里搞个像样的工作台就非常重要了!那么,家里究竟要一个怎么样的工作台,才可以宅着就能舒舒服服把砖搬了呢?小编为大家整理了15…...
![](https://pic1.zhimg.com/80/v2-5f94a1ebd8f875305c6a359aeaa1cb80_hd.jpg)
网站建设素材/精准营销推广方案
2019独角兽企业重金招聘Python工程师标准>>> 本文要推荐的[ToolFk]是一款程序员经常使用的线上免费测试工具箱,ToolFk 特色是专注于程序员日常的开发工具,不用安装任何软件,只要把内容贴上按一个执行按钮,就能获取到想要的内容结果…...
![](/images/no-images.jpg)
沈阳盘古网络做网站做的好么/宁波seo网络推广报价
一.什么是协程: 协程是python中另外一种实现多任务的方式,只不过比线程更小,占用的执行资源(理解为需要的资源)也更少。为啥说他说一个执行单元?因为他自带cpu上下文,这样,在合适的额…...
![](/images/no-images.jpg)
在线制作图片软件/青岛seo服务哪家好
Intent intentnew Intent(Intent.ACTION_SEND); intent.setType("text/plain"); //分享的数据类型 intent.putExtra(Intent.EXTRA_SUBJECT, "subject"); //主题 intent.putExtra(Intent.EXTRA_TEXT, "公子白工作室开发的该软件,很好用。…...
![](/images/no-images.jpg)
二级域名可以做网站/网络营销怎么推广
微信 php 自定义菜单我申请了一个微信公众平台的测试账号,之前已经通过验证,关注后用我的微信号向测试账号发消息可以得到测试账号的正确响应,我现在想实现微信的自定义菜单,下面用***代替了我测试账号的appid和secret,…...
![](https://img-blog.csdnimg.cn/20210306095514198.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L1Ryb3V2YWlsbGVfYQ==,size_16,color_FFFFFF,t_70)
如何做网站淘宝客/百度数据指数
3D打印机加工一般可以打印什么东西? 3D打印(3DP)即快速成型技术的一种,又称增材制造,它是一种以数字模型文件为基础,运用粉末状金属或塑料等可粘合材料,通过逐层打印的方式来构造物体的技术。 …...