500 Error when clicking new project button on Gitlab CE (NoMethodError)
Summary
500 Error when clicking new project button on Gitlab CE 13.1.3 (8411f47246f) Ombibus Docker
Steps to reproduce
Click new project button
Example Project
(If possible, please create an example project here on GitLab.com that exhibits the problematic behavior, and link to it here in the bug report) N/A
(If you are using an older version of GitLab, this will also determine whether the bug is fixed in a more recent version) N/A
What is the current bug behavior?
500 Error is displayed
What is the expected correct behavior?
New project screen is shown
Relevant logs and/or screenshots
{"method":"GET","path":"/projects/new","format":"html","controller":"ProjectsController","action":"new","status":500,"time":"2020-07-08T04:09:13.561Z","params":[],"remote_ip":"10.0.1.2","user_id":2,"username":"hi117","ua":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.15.0 Chrome/80.0.3987.163 Safari/537.36","db_count":3,"db_write_count":0,"db_cached_count":0,"correlation_id":"D9cTaUUFHOa","meta.user":"hi117","meta.caller_id":"ProjectsController#new","redis_calls":2,"redis_duration_s":0.000691,"redis_read_bytes":448,"redis_write_bytes":663,"redis_cache_calls":1,"redis_cache_duration_s":0.000199,"redis_cache_read_bytes":201,"redis_cache_write_bytes":78,"redis_shared_state_calls":1,"redis_shared_state_duration_s":0.000492,"redis_shared_state_read_bytes":247,"redis_shared_state_write_bytes":585,"queue_duration_s":0.01493,"cpu_s":0.05,"exception.class":"NoMethodError","exception.message":"undefined method `first' for nil:NilClass","exception.backtrace":["app/models/application_setting_implementation.rb:314:in `pick_repository_storage'","lib/gitlab/current_settings.rb:20:in `method_missing'","app/models/concerns/has_repository.rb:23:in `pick_repository_storage'","app/models/project.rb:72:in `block in <class:Project>'","app/models/project.rb:727:in `initialize'","app/controllers/projects_controller.rb:54:in `new'","app/controllers/application_controller.rb:497:in `set_current_admin'","lib/gitlab/session.rb:11:in `with_session'","app/controllers/application_controller.rb:488:in `set_session_storage'","app/controllers/application_controller.rb:482:in `set_locale'","lib/gitlab/error_tracking.rb:51:in `with_context'","app/controllers/application_controller.rb:547:in `sentry_context'","app/controllers/application_controller.rb:475:in `block in set_current_context'","lib/gitlab/application_context.rb:52:in `block in use'","lib/gitlab/application_context.rb:52:in `use'","lib/gitlab/application_context.rb:20:in `with_context'","app/controllers/application_controller.rb:468:in `set_current_context'"],"db_duration_s":0.00295,"view_duration_s":0.0,"duration_s":0.03242}
==> /var/log/gitlab/gitlab-rails/production.log <==
NoMethodError (undefined method `first' for nil:NilClass):
app/models/application_setting_implementation.rb:314:in `pick_repository_storage'
lib/gitlab/current_settings.rb:20:in `method_missing'
app/models/concerns/has_repository.rb:23:in `pick_repository_storage'
app/models/project.rb:72:in `block in <class:Project>'
app/models/project.rb:727:in `initialize'
lib/gitlab/metrics/instrumentation.rb:161:in `block in initialize'
lib/gitlab/metrics/method_call.rb:36:in `measure'
lib/gitlab/metrics/instrumentation.rb:161:in `initialize'
app/controllers/projects_controller.rb:54:in `new'
app/controllers/application_controller.rb:497:in `set_current_admin'
lib/gitlab/session.rb:11:in `with_session'
app/controllers/application_controller.rb:488:in `set_session_storage'
lib/gitlab/i18n.rb:55:in `with_locale'
lib/gitlab/i18n.rb:61:in `with_user_locale'
app/controllers/application_controller.rb:482:in `set_locale'
lib/gitlab/error_tracking.rb:51:in `with_context'
app/controllers/application_controller.rb:547:in `sentry_context'
app/controllers/application_controller.rb:475:in `block in set_current_context'
lib/gitlab/application_context.rb:52:in `block in use'
lib/gitlab/application_context.rb:52:in `use'
lib/gitlab/application_context.rb:20:in `with_context'
app/controllers/application_controller.rb:468:in `set_current_context'
lib/gitlab/metrics/elasticsearch_rack_middleware.rb:24:in `call'
lib/gitlab/metrics/redis_rack_middleware.rb:22:in `call'
lib/gitlab/middleware/rails_queue_duration.rb:29:in `call'
lib/gitlab/metrics/rack_middleware.rb:17:in `block in call'
lib/gitlab/metrics/transaction.rb:54:in `run'
lib/gitlab/metrics/rack_middleware.rb:17:in `call'
lib/gitlab/request_profiler/middleware.rb:17:in `call'
lib/gitlab/middleware/go.rb:20:in `call'
lib/gitlab/etag_caching/middleware.rb:13:in `call'
lib/gitlab/middleware/multipart.rb:125:in `call'
lib/gitlab/middleware/read_only/controller.rb:51:in `call'
lib/gitlab/middleware/read_only.rb:18:in `call'
lib/gitlab/middleware/same_site_cookies.rb:27: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:23:in `call'
config/initializers/fix_local_cache_middleware.rb:9:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:60:in `call'
lib/gitlab/middleware/release_env.rb:12:in `call'
==> /var/log/gitlab/gitlab-workhorse/current <==
{"correlation_id":"D9cTaUUFHOa","duration_ms":64,"host":"gitlab.home.hi117.moe","level":"info","method":"GET","msg":"access","proto":"HTTP/1.1","referrer":"https://gitlab.home.hi117.moe/","remote_addr":"127.0.0.1:0","remote_ip":"127.0.0.1","status":500,"system":"http","time":"2020-07-08T04:09:13Z","uri":"/projects/new","user_agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.15.0 Chrome/80.0.3987.163 Safari/537.36","written_bytes":2926}
==> /var/log/gitlab/nginx/gitlab_access.log <==
10.0.1.2 - - [08/Jul/2020:04:09:13 +0000] "GET /projects/new HTTP/2.0" 500 2926 "https://gitlab.home.hi117.moe/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.15.0 Chrome/80.0.3987.163 Safari/537.36" -
Output of checks
(If you are reporting a bug on GitLab.com, write: This bug happens on GitLab.com) N/A
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Current User: git Using RVM: no Ruby Version: 2.6.6p146 Gem Version: 2.7.10 Bundler Version:1.17.3 Rake Version: 12.3.3 Redis Version: 5.0.9 Git Version: 2.27.0 Sidekiq Version:5.2.7 Go Version: unknown rake aborted! NoMethodError: undefined method `first' for nil:NilClass /opt/gitlab/embedded/service/gitlab-rails/app/models/application_setting_implementation.rb:314:in `pick_repository_storage' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/current_settings.rb:20:in `method_missing' /opt/gitlab/embedded/service/gitlab-rails/app/models/concerns/has_repository.rb:23:in `pick_repository_storage' /opt/gitlab/embedded/service/gitlab-rails/app/models/project.rb:72:in `block in ' /opt/gitlab/embedded/service/gitlab-rails/app/models/project.rb:727:in `initialize' /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/info.rake:48:in `block (3 levels) in ' /opt/gitlab/embedded/bin/bundle:23:in `load' /opt/gitlab/embedded/bin/bundle:23:in `' Tasks: TOP => gitlab:env:info (See full trace by running task with --trace)
Results of GitLab application Check
Expand for output related to the GitLab application check
Checking GitLab subtasks ...
Checking GitLab Shell ...
GitLab Shell: ... GitLab Shell version >= 13.3.0 ? ... OK (13.3.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Internal API available: OK Redis available via internal API: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Gitaly ...
Gitaly: ... default ... OK
Checking Gitaly ... Finished
Checking Sidekiq ...
Sidekiq: ... Running? ... yes Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Incoming Email ...
Incoming Email: ... Reply by email is disabled in config/gitlab.yml
Checking Incoming Email ... Finished
Checking LDAP ...
LDAP: ... LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab App ...
Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 2/1 ... yes 2/2 ... yes 3/3 ... yes 3/4 ... yes 3/5 ... yes 3/6 ... yes 3/7 ... yes 3/8 ... yes 3/10 ... yes 3/11 ... yes 2/12 ... yes 3/13 ... yes 2/14 ... yes 2/15 ... yes 5/16 ... yes 2/17 ... yes 2/18 ... yes 3/19 ... yes 2/20 ... yes 3/21 ... yes 5/22 ... yes 2/23 ... yes 5/24 ... yes 5/25 ... yes 5/27 ... yes 6/28 ... yes 5/29 ... yes 6/30 ... yes 2/31 ... yes 6/32 ... yes 6/33 ... yes 2/34 ... yes 2/35 ... yes 2/36 ... yes 2/37 ... yes 3/38 ... yes 3/39 ... yes 5/40 ... yes 5/41 ... yes 16/42 ... yes 5/43 ... yes 5/44 ... yes 5/45 ... yes 11/46 ... yes 11/48 ... yes 16/49 ... yes 16/50 ... yes 2/51 ... yes 2/52 ... yes 12/53 ... yes 5/55 ... yes 6/56 ... yes 12/58 ... yes 12/59 ... yes 12/60 ... yes 16/61 ... yes 12/63 ... yes 12/64 ... yes 14/65 ... yes 2/66 ... yes 12/67 ... yes 12/68 ... yes 12/69 ... yes 8/70 ... yes 16/71 ... yes 5/72 ... yes 18/73 ... yes 18/74 ... yes 17/75 ... yes 14/76 ... yes 2/77 ... yes 12/78 ... yes 2/79 ... yes 12/80 ... yes 12/81 ... yes 8/82 ... yes 8/83 ... yes 2/84 ... yes 17/85 ... yes 2/86 ... yes 2/87 ... yes 5/88 ... yes 6/89 ... yes 8/90 ... yes 2/91 ... yes 17/92 ... yes 17/93 ... yes 14/94 ... yes 14/95 ... yes 2/96 ... yes 20/97 ... yes 2/98 ... yes 20/99 ... yes 2/100 ... yes 2/101 ... yes 6/102 ... yes 2/103 ... yes 14/104 ... yes 2/105 ... yes Redis version >= 4.0.0? ... yes Ruby version >= 2.5.3 ? ... yes (2.6.6) Git version >= 2.22.0 ? ... yes (2.27.0) Git user has default SSH configuration? ... yes Active users: ... 5 Is authorized keys file accessible? ... yes GitLab configured to store new projects in hashed storage? ... yes All projects are in hashed storage? ... no Try fixing it: Please migrate all projects to hashed storage as legacy storage is deprecated in 13.0 and support will be removed in 14.0. For more information see: doc/administration/repository_storage_types.md
Checking GitLab App ... Finished
Checking GitLab subtasks ... Finished
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)