首页 » Linux » gitlab迁移之后,cicd setting 报500

gitlab迁移之后,cicd setting 报500

 

gitlab web页访问项目的cicd设置,页面报500错误,

gitlab版本:11.9.6

原因:由于迁移没有还原配置文件导致的,所以解决方法有两种,一种是还原配置文件,第二是把对应的加密字段置为空。

错误如下:

Processing by Projects::PipelinesController#retry as JSON
  Parameters: {"namespace_id"=>"maogouvideo", "project_id"=>"admin", "id"=>"22"}
Completed 500 Internal Server Error in 130ms (ActiveRecord: 55.9ms)
  
OpenSSL::Cipher::CipherError ():
  
lib/gitlab/crypto_helper.rb:27:in `aes256_gcm_decrypt'
app/models/concerns/token_authenticatable_strategies/encrypted.rb:45:in `get_token'
app/models/concerns/token_authenticatable_strategies/base.rb:27:in `ensure_token'
app/models/concerns/token_authenticatable_strategies/encrypted.rb:32:in `ensure_token'
app/models/concerns/token_authenticatable.rb:38:in `block in add_authentication_token_field'
app/services/ci/retry_pipeline_service.rb:20:in `block (2 levels) in execute'
lib/gitlab/optimistic_locking.rb:9:in `block in retry_lock'
lib/gitlab/optimistic_locking.rb:8:in `retry_lock'
app/services/ci/retry_pipeline_service.rb:20:in `block in execute'
app/services/ci/retry_pipeline_service.rb:19:in `execute'
app/models/ci/pipeline.rb:456:in `retry_failed'
app/controllers/projects/pipelines_controller.rb:115:in `retry'
lib/gitlab/i18n.rb:55:in `with_locale'
lib/gitlab/i18n.rb:61:in `with_user_locale'
app/controllers/application_controller.rb:434:in `set_locale'
lib/gitlab/middleware/rails_queue_duration.rb:27:in `call'
lib/gitlab/metrics/rack_middleware.rb:17:in `block in call'
lib/gitlab/metrics/transaction.rb:55:in `run'

 

解决方法:
1、参考: https://gitlab.com/gitlab-org/gitlab-ce/issues/59822 和 https://gitlab.com/gitlab-org/gitlab-ce/issues/59413

2、我的解决方法如下:

[root@docker-node1 ~]# docker exec -it gitlab /bin/bash
root@47:/# gitlab-rails console
-------------------------------------------------------------------------------------
 GitLab:       11.9.6 (14bac95)
 GitLab Shell: 8.7.1
 postgresql:   9.6.11
-------------------------------------------------------------------------------------
Loading production environment (Rails 5.0.7.1)
irb(main):001:0> Ci::Runner.all.update_all(token_encrypted: nil)
=> 1
irb(main):002:0> quit
root@47:/# gitlab-rails dbconsole
psql (9.6.11)
Type "help" for help.

gitlabhq_production=> UPDATE projects SET runners_token = null, runners_token_encrypted = null;
UPDATE 17

上面就两句语句:
console上执行:
Ci::Runner.all.update_all(token_encrypted: nil) 这句代表所有的项目,加密置空
dbconsole上执行:

 UPDATE projects SET runners_token = null, runners_token_encrypted = null; 
以上表示更新所有的项目,

如果是针对不同的项目可以分开设置:

Rails console: Project.find_by_full_path('root/my-project').update(runners_token: nil, runners_token_encrypted:nil)

DB Console: UPDATE projects SET runners_token = null, runners_token_encrypted = null WHERE id = 28;

#root/my-project 项目组和名,id=17,是上一句返回的id

 

原文链接:gitlab迁移之后,cicd setting 报500,转载请注明来源!

5