New project fails with error 500 after upgrade to 13.1.0-ce.0 (docker)
Summary
We use gitlab-ce on a docker image. We were on After upgrading from 12.2.5-ce.0 to 12.10.11-ce.0 and finally to 13.1.0-ce.0, we can no longer create new projects.
Steps to reproduce
With a docker install. upgrading from 12.2.5-ce.0 to 12.10.11-ce.0 and finally to 13.1.0-ce.0, then attempt to create a project.
What is the current bug behavior?
When creating a new project, as soon as you click on create new project button the page is directed to the error 500 page.
What is the expected correct behavior?
The new project page should load where details can be put in to create a new project.
Relevant logs and/or screenshots
Docker logs for the container relating to the issue:-
`==> /var/log/gitlab/gitlab-rails/production.log <== Started GET "/projects/new?namespace_id=62" for 111.111.111.111 at 2020-06-23 16:21:48 +0000 Processing by ProjectsController#new as HTML Parameters: {"namespace_id"=>"62"} Completed 500 Internal Server Error in 23ms (ActiveRecord: 4.1ms | Elasticsearch: 0.0ms | Allocations: 8425)
==> /var/log/gitlab/gitlab-rails/production_json.log <==
{"method":"GET","path":"/projects/new","format":"html","controller":"ProjectsController","action":"new","status":500,"time":"2020-06-23T16:21:48.205Z","params":[{"key":"namespace_id","value":"62"}],"remote_ip":"111.111.111.111","user_id":3,"username":"rich","ua":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36","correlation_id":"UAOb3W0TaU8","meta.user":"rich","meta.caller_id":"ProjectsController#new","redis_calls":1,"redis_duration_s":0.000175,"redis_read_bytes":384,"redis_write_bytes":585,"redis_shared_state_calls":1,"redis_shared_state_duration_s":0.000175,"redis_shared_state_read_bytes":384,"redis_shared_state_write_bytes":585,"cpu_s":0.02,"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.00407,"view_duration_s":0.0,"duration_s":0.02275}
==> /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' 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/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":"UAOb3W0TaU8","duration_ms":30,"host":"DOMAIN.COM:443","level":"info","method":"GET","msg":"access","proto":"HTTP/1.1","referrer":"https://DOMAIN.COM:443/DevOps","remote_addr":"111.111.111.111:0","remote_ip":"111.111.111.111","status":500,"system":"http","time":"2020-06-23T16:21:48Z","uri":"/projects/new?namespace_id=62","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36","written_bytes":2926}
==> /var/log/gitlab/nginx/gitlab_access.log <== 111.111.111.111 - - [23/Jun/2020:16:21:48 +0000] "GET /projects/new?namespace_id=62 HTTP/2.0" 500 2926 "https://DOMAIN.COM:443/DevOps" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - `
Output of checks
(If you are reporting a bug on GitLab.com, write: This bug happens on GitLab.com)
Results of GitLab environment info
Expand for output related to GitLab environment info
/var/log/gitlab/gitlab-rails# gitlab-rake gitlab:env: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
gitlab-rake gitlab:check SANITIZE=true 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: ... 11/6 ... yes 13/7 ... yes 6/8 ... yes 6/9 ... yes 9/11 ... yes 3/16 ... yes 3/17 ... yes 3/18 ... yes 3/19 ... yes 3/20 ... yes 3/22 ... yes 7/23 ... yes 6/24 ... yes 49/25 ... yes 80/27 ... yes 3/28 ... yes 49/30 ... yes 49/31 ... yes 13/33 ... yes 13/34 ... yes 13/35 ... yes 14/36 ... yes 14/37 ... yes 14/38 ... yes 14/39 ... yes 14/40 ... yes 14/41 ... yes 14/42 ... yes 14/43 ... yes 14/44 ... yes 14/45 ... yes 14/46 ... yes 5/47 ... yes 13/48 ... yes 14/49 ... yes 13/50 ... yes 18/51 ... yes 15/54 ... yes 18/55 ... yes 18/56 ... yes 18/57 ... yes 22/60 ... yes 3/63 ... yes 68/65 ... yes 13/66 ... yes 13/67 ... yes 17/68 ... yes 17/69 ... yes 23/70 ... yes 3/71 ... yes 13/72 ... yes 17/73 ... yes 49/74 ... yes 20/75 ... yes 17/76 ... yes 13/77 ... yes 26/78 ... yes 18/79 ... yes 13/80 ... yes 13/81 ... yes 28/82 ... yes 18/83 ... yes 13/84 ... yes 13/85 ... yes 23/86 ... yes 30/87 ... yes 13/90 ... yes 68/94 ... yes 35/95 ... yes 37/97 ... yes 37/98 ... yes 37/99 ... yes 37/100 ... yes 37/101 ... yes 37/103 ... yes 38/104 ... yes 38/105 ... yes 13/106 ... yes 28/108 ... yes 41/109 ... yes 41/110 ... yes 41/112 ... yes 13/113 ... yes 41/114 ... yes 43/117 ... yes 43/118 ... yes 43/119 ... yes 36/120 ... yes 44/121 ... yes 45/122 ... yes 45/123 ... yes 45/124 ... yes 45/125 ... yes 36/126 ... yes 48/128 ... yes 48/129 ... yes 48/130 ... yes 48/131 ... yes 48/132 ... yes 48/133 ... yes 49/134 ... yes 3/135 ... yes 50/137 ... yes 51/138 ... yes 51/139 ... yes 51/141 ... yes 51/142 ... yes 51/143 ... yes 51/144 ... yes 51/145 ... yes 51/146 ... yes 51/147 ... yes 51/148 ... yes 51/149 ... yes 51/150 ... yes 51/151 ... yes 51/152 ... yes 51/153 ... yes 51/154 ... yes 51/155 ... yes 51/156 ... yes 51/157 ... yes 40/158 ... yes 53/160 ... yes 54/161 ... yes 54/162 ... yes 54/163 ... yes 54/164 ... yes 54/165 ... yes 54/166 ... yes 54/167 ... yes 54/168 ... yes 54/169 ... yes 54/170 ... yes 54/171 ... yes 54/172 ... yes 54/173 ... yes 54/174 ... yes 54/175 ... yes 54/176 ... yes 54/177 ... yes 54/178 ... yes 54/179 ... yes 54/180 ... yes 54/181 ... yes 54/182 ... yes 54/183 ... yes 54/184 ... yes 57/185 ... yes 41/189 ... yes 41/190 ... yes 59/191 ... yes 59/192 ... yes 41/193 ... yes 41/194 ... yes 41/195 ... yes 41/196 ... yes 41/197 ... yes 41/198 ... yes 10/199 ... yes 39/200 ... yes 59/201 ... yes 61/202 ... yes 61/203 ... yes 61/204 ... yes 62/205 ... yes 39/206 ... yes 61/210 ... yes 61/211 ... yes 61/213 ... yes 61/214 ... yes 33/215 ... yes 59/216 ... yes 61/218 ... yes 59/219 ... yes 61/220 ... yes 61/221 ... yes 59/224 ... yes 41/225 ... yes 41/226 ... yes 41/227 ... yes 49/228 ... yes 61/229 ... yes 61/230 ... yes 13/231 ... yes 61/232 ... yes 14/233 ... yes 78/234 ... yes 65/235 ... yes 61/236 ... yes 61/237 ... yes 59/238 ... yes 61/239 ... yes 67/241 ... yes 59/244 ... yes 59/245 ... yes 59/246 ... yes 59/247 ... yes 59/248 ... yes 59/249 ... yes 59/250 ... yes 59/251 ... yes 59/252 ... yes 59/253 ... yes 59/254 ... yes 59/255 ... yes 59/256 ... yes 59/257 ... yes 59/258 ... yes 59/259 ... yes 59/260 ... yes 59/261 ... yes 59/262 ... yes 59/263 ... yes 59/264 ... yes 59/265 ... yes 59/266 ... yes 59/267 ... yes 59/269 ... yes 59/270 ... yes 59/271 ... yes 61/272 ... yes 59/273 ... yes 59/274 ... yes 59/275 ... yes 59/276 ... yes 59/277 ... yes 59/278 ... yes 59/279 ... yes 59/280 ... yes 41/281 ... yes 41/282 ... yes 41/283 ... yes 41/284 ... yes 61/286 ... yes 59/288 ... yes 61/290 ... yes 61/291 ... yes 40/292 ... yes 59/293 ... yes 59/294 ... yes 59/295 ... yes 59/296 ... yes 59/297 ... yes 59/298 ... yes 59/299 ... yes 59/300 ... yes 59/301 ... yes 59/302 ... yes 59/303 ... yes 59/304 ... yes 74/305 ... yes 76/306 ... yes 77/307 ... yes 78/308 ... yes 77/309 ... yes 79/310 ... yes 77/311 ... yes 77/312 ... yes 77/313 ... yes 77/314 ... yes 77/315 ... yes 77/316 ... yes 77/317 ... yes 79/318 ... yes 79/319 ... yes 79/320 ... yes 79/321 ... yes 79/322 ... yes 79/323 ... yes 79/324 ... yes 79/325 ... yes 74/326 ... yes 21/328 ... yes 68/329 ... yes 80/330 ... yes 66/332 ... yes 79/333 ... yes 79/334 ... yes 79/335 ... yes 79/336 ... yes 79/338 ... yes 59/339 ... yes 59/340 ... yes 68/341 ... yes 33/342 ... yes 3/343 ... yes 78/344 ... yes 61/345 ... yes 39/346 ... yes 59/347 ... yes 81/348 ... yes 81/349 ... yes 81/350 ... yes 81/351 ... yes 36/352 ... yes 36/353 ... yes 21/354 ... yes 59/355 ... yes 21/356 ... yes 79/357 ... yes 59/358 ... yes 49/360 ... yes 58/362 ... yes 72/363 ... yes 59/364 ... yes 59/365 ... yes 59/366 ... yes 41/367 ... yes 66/368 ... yes 79/369 ... yes 30/371 ... yes 41/372 ... yes 69/373 ... yes 69/374 ... yes 69/375 ... yes 69/376 ... yes 69/377 ... yes 69/378 ... yes 59/380 ... yes 59/381 ... yes 59/382 ... yes 59/383 ... yes 59/384 ... yes 59/385 ... yes 59/386 ... yes 59/387 ... yes 59/388 ... yes 59/389 ... yes 59/390 ... yes 59/391 ... yes 59/392 ... yes 76/393 ... yes 41/394 ... yes 78/395 ... yes 41/396 ... yes 89/397 ... yes 41/399 ... yes 41/400 ... yes 41/401 ... yes 91/402 ... yes 77/403 ... yes 62/404 ... 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: ... 33 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)