500 Error while creating a new Sub group in Gitlab

740 views Asked by At

I am getting 500 error while creating a new sub group in Gitlab. I have a self hosted Gitlab and It was working fine before and we were able to create sub groups and then we upgraded our Gitlab from 13.3 to 13.9. But I am not sure if that has caused the issue.

Current Gitlab Version - 13.9.1-ee

Gitlab Full Env Info -

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:  [email protected]: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

I tried to tall the error and I see this which doesn't make a sense to me. Can someone help why it's happening?

{"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

There are 1 answers

0
Katrin Leinweber On

This seems to be a bug related to the renewal notification banner that appears 1 month before a license expires. Uploading the renewed license should solve it, as should upgrading to at least a 13.11 release.

I've tested 13.11.6 and 14.0.2 to be exact and the problem couldn't be reproduced, but it was still present in 13.9.1.