在 Gitlab 中创建新的子组时出现 500 错误
Posted
技术标签:
【中文标题】在 Gitlab 中创建新的子组时出现 500 错误【英文标题】:500 Error while creating a new Sub group in Gitlab 【发布时间】:2021-07-13 16:47:00 【问题描述】:在 Gitlab 中创建新子组时出现 500 错误。我有一个自托管的 Gitlab,它之前运行良好,我们能够创建子组,然后我们将 Gitlab 从 13.3 升级到 13.9。但我不确定这是否导致了问题。
当前 Gitlab 版本 - 13.9.1-ee
Gitlab 完整环境信息 -
System information
System:
Current User: myuser
Using RVM: no
Ruby Version: 2.7.2p137
Gem Version: 3.1.4
Bundler Version:2.1.4
Rake Version: 13.0.3
Redis Version: 6.0.10
Git Version: 2.29.0
Sidekiq Version:5.2.9
Go Version: unknown
GitLab information
Version: 13.9.1-ee
Revision: 8ae438629fa
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: PostgreSQL
DB Version: 12.5
URL: https://my.gitlab.co.uk
HTTP Clone URL: https://my.gitlab.co.uk/some-group/some-project.git
SSH Clone URL: myuser@my.gitlab.co.uk:some-group/some-project.git
Elasticsearch: no
Geo: no
Using LDAP: yes
Using Omniauth: yes
Omniauth Providers:
GitLab Shell
Version: 13.16.1
Repository storage paths:
- default: /app/gitlab/git-data/repositories
GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell
Git: /opt/gitlab/embedded/bin/git
我试图放大错误,但我发现这对我来说没有意义。有人可以帮忙解释为什么会这样吗?
"method":"GET","path":"/groups/new","format":"html","controller":"GroupsController","action":"new","status":500,"time":"2021-04-19T11:59:30.155Z","params":["key":"parent_id","value":"189"],"remote_ip":"10.78.XX.XXX","user_id":1,"username":"root","ua":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36","correlation_id":"XXXXXXXXXXXXXXXXXXXX","meta.user":"root","meta.caller_id":"GroupsController#new","meta.remote_ip":"10.78.XX.XXX","meta.feature_category":"subgroups","redis_calls":12,"redis_duration_s":0.0044269999999999995,"redis_read_bytes":1076,"redis_write_bytes":1647,"redis_cache_calls":11,"redis_cache_duration_s":0.004037,"redis_cache_read_bytes":893,"redis_cache_write_bytes":776,"redis_shared_state_calls":1,"redis_shared_state_duration_s":0.00039,"redis_shared_state_read_bytes":183,"redis_shared_state_write_bytes":871,"db_count":14,"db_write_count":0,"db_cached_count":3,"cpu_s":0.22893,"queue_duration_s":0.007548,"exception.class":"ActionView::Template::Error","exception.message":"undefined method `gitlab_subscription' for nil:NilClass","exception.backtrace":["ee/app/models/ee/namespace.rb:184:in `block in closest_gitlab_subscription'","lib/gitlab/utils/strong_memoize.rb:30:in `strong_memoize'","ee/app/models/ee/namespace.rb:182:in `closest_gitlab_subscription'","ee/app/helpers/ee/subscribable_banner_helper.rb:61:in `decorated_subscription'","ee/app/helpers/ee/subscribable_banner_helper.rb:25:in `renew_subscription_path'","ee/app/views/layouts/header/_ee_subscribable_banner.html.haml:24","app/helpers/application_helper.rb:17:in `render_if_exists'","app/views/layouts/_page.html.haml:18","app/views/layouts/application.html.haml:13","app/controllers/application_controller.rb:125:in `render'","ee/lib/gitlab/ip_address_state.rb:10:in `with'","ee/app/controllers/ee/application_controller.rb:44:in `set_current_ip_address'","app/controllers/application_controller.rb:482:in `set_current_admin'","lib/gitlab/session.rb:11:in `with_session'","app/controllers/application_controller.rb:473:in `set_session_storage'","lib/gitlab/i18n.rb:73:in `with_locale'","lib/gitlab/i18n.rb:79:in `with_user_locale'","app/controllers/application_controller.rb:467:in `set_locale'","lib/gitlab/error_tracking.rb:52:in `with_context'","app/controllers/application_controller.rb:532:in `sentry_context'","app/controllers/application_controller.rb:460:in `block in set_current_context'","lib/gitlab/application_context.rb:56:in `block in use'","lib/gitlab/application_context.rb:56:in `use'","lib/gitlab/application_context.rb:22:in `with_context'","app/controllers/application_controller.rb:451:in `set_current_context'","lib/gitlab/metrics/elasticsearch_rack_middleware.rb:16:in `call'","lib/gitlab/middleware/rails_queue_duration.rb:33:in `call'","lib/gitlab/metrics/rack_middleware.rb:16:in `block in call'","lib/gitlab/metrics/transaction.rb:56:in `run'","lib/gitlab/metrics/rack_middleware.rb:16:in `call'","lib/gitlab/request_profiler/middleware.rb:17:in `call'","lib/gitlab/jira/middleware.rb:19:in `call'","lib/gitlab/middleware/go.rb:20:in `call'","lib/gitlab/etag_caching/middleware.rb:21:in `call'","lib/gitlab/middleware/multipart.rb:172:in `call'","lib/gitlab/middleware/read_only/controller.rb:50:in `call'","lib/gitlab/middleware/read_only.rb:18:in `call'","lib/gitlab/middleware/same_site_cookies.rb:27:in `call'","lib/gitlab/middleware/handle_malformed_strings.rb:21:in `call'","lib/gitlab/middleware/basic_health_check.rb:25:in `call'","lib/gitlab/middleware/handle_ip_spoof_attack_error.rb:25:in `call'","lib/gitlab/middleware/request_context.rb:21:in `call'","config/initializers/fix_local_cache_middleware.rb:11:in `call'","lib/gitlab/metrics/requests_rack_middleware.rb:76:in `call'","lib/gitlab/middleware/release_env.rb:12:in `call'"],"db_duration_s":0.0096,"view_duration_s":0.0,"duration_s":0.22644
【问题讨论】:
【参考方案1】:这似乎是与许可证到期前 1 个月出现的续订通知横幅相关的错误。上传更新的许可证应该可以解决它,升级到至少 13.11 release 也应该解决这个问题。
确切地说,我已经测试了 13.11.6 和 14.0.2,问题无法重现,但它仍然存在于 13.9.1 中。
【讨论】:
以上是关于在 Gitlab 中创建新的子组时出现 500 错误的主要内容,如果未能解决你的问题,请参考以下文章
访问 $GITLAB/admin/runners 时出现内部服务器错误 500