[13.2.x -> 13.3 regression] 500 Error on main project pages: undefined method `moved_project' (with custom notification?)
Summary
I run a self-hosted instance of Gitlab at https://gitlab.tiker.net/ (on Debian buster), which I recently upgraded to 13.3.0 (from 13.2.x). Main project pages (but not sub-pages, e.g. issues) now give me 500 server errors. I suspect this has to do with custom notification settings I have, as it appears to happen when rendering the notifications button.
Steps to reproduce
For me (when logged in) the issue is the following:
- Visit a project homepage (e.g. https://gitlab.tiker.net/inducer/pymetis/)
 - Observe 500 server error
 
Based on the error log, I suspect this has to do with custom notification settings that I have enabled.
Relevant logs and/or screenshots
I run omnibus gitlab. /var/log/gitlab/gitlab-rails/production.log says:
Completed 500 Internal Server Error in 670ms (ActiveRecord: 83.9ms | Elasticsearch: 0.0ms | Allocations: 397092)
  
ActionView::Template::Error (undefined method `moved_project' for #<NotificationSetting:0x00007f03680c95a0>
Did you mean?  reload_project):
    26:                   - field_id = "#{notifications_menu_identifier("modal", notification_setting)}_notification_setting[#{event}]"
    27:                   .form-group
    28:                     .form-check{ class: ("gl-mt-0" if index == 0) }
    29:                       = check_box("notification_setting", event, id: field_id, class: "js-custom-notification-event form-check-input", checked: notification_setting.public_send(event))
    30:                       %label.form-check-label{ for: field_id }
    31:                         %strong
    32:                           = notification_event_name(event)
  
app/views/shared/notifications/_custom_notifications.html.haml:29:in `public_send'
app/views/shared/notifications/_custom_notifications.html.haml:29
app/views/shared/notifications/_custom_notifications.html.haml:25:in `each'
app/views/shared/notifications/_custom_notifications.html.haml:25:in `each_with_index'
app/views/shared/notifications/_custom_notifications.html.haml:25
app/views/shared/notifications/_custom_notifications.html.haml:14
app/views/shared/notifications/_new_button.html.haml:34
app/views/shared/notifications/_new_button.html.haml:33
app/views/shared/notifications/_new_button.html.haml:12
app/views/projects/_home_panel.html.haml:47
app/views/projects/show.html.haml:13
app/controllers/application_controller.rb:134:in `render'
app/controllers/application_controller.rb:546:in `block in allow_gitaly_ref_name_caching'
lib/gitlab/gitaly_client.rb:318:in `allow_ref_name_caching'
app/controllers/application_controller.rb:545:in `allow_gitaly_ref_name_caching'
app/controllers/application_controller.rb:491:in `set_current_admin'
lib/gitlab/session.rb:11:in `with_session'
app/controllers/application_controller.rb:482: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:476:in `set_locale'
lib/gitlab/error_tracking.rb:50:in `with_context'
app/controllers/application_controller.rb:541:in `sentry_context'
app/controllers/application_controller.rb:469: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:462: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:140: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'
(END)
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
# gitlab-rake gitlab:env:info System information System: Debian testing 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.28.0 Sidekiq Version:5.2.9 Go Version: go1.14.7 linux/amd64 GitLab information Version: 13.3.0 Revision: 9119206b6e8 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 12.4 URL: https://gitlab.tiker.net HTTP Clone URL: https://gitlab.tiker.net/some-group/some-project.git SSH Clone URL: git@gitlab.tiker.net:some-group/some-project.git Using LDAP: no Using Omniauth: yes Omniauth Providers: GitLab Shell Version: 13.6.0 Repository storage paths: - default: /var/opt/gitlab/git-data/repositories GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell Git: /opt/gitlab/embedded/bin/git
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.6.0 ? ... OK (13.6.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: ... Checking Reply by email ...
IMAP server credentials are correct? ... Checking gitlab yes Init.d configured correctly? ... skipped MailRoom running? ... skipped
Checking Reply by email ... Finished
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/2 ... yes 64/3 ... yes 64/4 ... yes 64/5 ... yes 64/6 ... yes 64/7 ... yes 2/8 ... yes 7/9 ... yes 64/10 ... yes 47/11 ... yes 14/12 ... yes 2/13 ... yes 2/14 ... yes 2/15 ... yes 19/16 ... yes 21/17 ... yes 21/18 ... yes 2/19 ... yes 21/20 ... yes 65/21 ... yes 65/22 ... yes 2/23 ... yes 39/24 ... yes 27/26 ... yes 41/27 ... yes 38/28 ... yes 32/29 ... yes 29/30 ... yes 31/31 ... yes 33/32 ... yes 33/33 ... yes 37/34 ... yes 37/35 ... yes 27/36 ... yes 27/37 ... yes 63/38 ... yes 32/39 ... yes 31/40 ... yes 38/41 ... yes 39/42 ... yes 33/43 ... yes 38/44 ... yes 29/45 ... yes 37/46 ... yes 47/47 ... yes 29/48 ... yes 38/49 ... yes 39/50 ... yes 32/51 ... yes 31/52 ... yes 33/54 ... yes 37/55 ... yes 37/56 ... yes 2/57 ... yes 32/60 ... yes 31/61 ... yes 39/62 ... yes 29/63 ... yes 38/64 ... yes 37/65 ... yes 33/66 ... yes 29/68 ... yes 32/69 ... yes 39/70 ... yes 31/71 ... yes 37/73 ... yes 47/74 ... yes 33/75 ... yes 2/76 ... yes 63/78 ... yes 2/79 ... yes 2/80 ... yes 64/81 ... yes 47/82 ... yes 65/83 ... yes 64/84 ... yes 37/85 ... yes 29/86 ... yes 2/87 ... yes 2/89 ... yes 2/91 ... yes 63/92 ... yes 64/93 ... yes 63/94 ... yes 47/95 ... yes 2/96 ... yes 47/102 ... yes 47/103 ... yes 47/104 ... yes 47/105 ... yes 47/106 ... yes 47/107 ... yes 47/108 ... yes 24/109 ... yes 2/110 ... yes 2/111 ... yes 65/112 ... yes 2/113 ... yes 64/114 ... yes 64/115 ... yes 45/116 ... yes 2/117 ... yes 63/118 ... yes 2/119 ... yes 65/120 ... yes 65/121 ... yes 47/122 ... yes 64/123 ... yes 47/124 ... yes 64/125 ... yes 64/127 ... yes 68/128 ... yes 2/129 ... yes 2/130 ... yes 2/131 ... yes 61/132 ... yes 64/133 ... yes 24/134 ... yes 45/136 ... yes 68/137 ... yes 2/138 ... yes 2/139 ... yes 2/140 ... yes 2/141 ... yes 2/142 ... yes 2/143 ... yes 2/144 ... yes 2/145 ... yes 2/146 ... yes 2/147 ... yes 2/148 ... yes 2/149 ... yes 2/150 ... yes 2/151 ... yes 2/152 ... yes 2/153 ... yes 2/154 ... yes 2/155 ... yes 13/156 ... yes 2/157 ... yes 2/158 ... yes 63/159 ... yes 2/160 ... yes 67/161 ... yes 67/162 ... yes 2/163 ... yes 2/164 ... yes 2/165 ... yes 45/166 ... yes 2/167 ... yes 65/168 ... yes 68/169 ... yes 68/170 ... yes 68/171 ... yes 2/172 ... yes 68/173 ... yes 2/174 ... yes 67/175 ... yes 2/177 ... yes 68/178 ... yes 2/179 ... yes 2/180 ... yes 2/181 ... yes 2/182 ... yes 65/183 ... yes 68/184 ... yes 61/185 ... yes 68/186 ... yes 61/187 ... yes 64/188 ... yes 64/189 ... yes 2/190 ... yes 2/191 ... yes 45/192 ... yes 45/193 ... yes 68/194 ... yes 65/195 ... yes 24/196 ... yes 2/197 ... yes 45/198 ... yes 45/199 ... yes 24/200 ... yes 65/201 ... yes 69/203 ... yes 45/204 ... yes 64/206 ... yes 65/207 ... yes 2/208 ... yes 29/216 ... yes 45/217 ... yes 67/218 ... yes 45/219 ... yes 64/220 ... yes 45/221 ... yes 45/222 ... yes 45/223 ... yes 2/224 ... yes 65/225 ... yes 45/226 ... yes 45/227 ... yes 2/228 ... yes 2/229 ... yes 45/231 ... yes 47/232 ... yes 47/233 ... yes 61/234 ... yes 67/235 ... yes 63/236 ... yes 45/237 ... yes 29/238 ... yes 65/239 ... yes 68/240 ... yes 88/241 ... yes 83/242 ... yes 2/243 ... yes 45/244 ... yes 64/247 ... yes 59/248 ... yes 82/250 ... yes 61/252 ... yes 62/253 ... yes 93/254 ... yes 47/255 ... yes 65/256 ... yes 68/257 ... yes 95/259 ... yes 65/260 ... yes 2/261 ... yes 29/262 ... yes 47/263 ... yes 110/264 ... yes 61/265 ... yes 45/266 ... yes 95/267 ... yes 45/268 ... yes 47/269 ... yes 65/270 ... yes 93/271 ... yes 111/272 ... yes 64/273 ... yes 45/274 ... yes 76/275 ... yes 64/276 ... yes 68/277 ... yes 47/278 ... yes 47/279 ... yes 64/280 ... yes 65/281 ... yes 118/282 ... yes 118/283 ... yes 47/286 ... yes 45/287 ... yes 68/289 ... yes 67/291 ... yes 107/292 ... yes 47/293 ... yes 107/294 ... yes 47/295 ... yes 61/296 ... yes 107/297 ... yes 67/298 ... yes 65/299 ... yes 45/300 ... yes 107/301 ... yes 110/302 ... yes 2/303 ... yes 45/304 ... yes 47/305 ... yes 121/306 ... yes 121/307 ... yes 121/308 ... yes 121/309 ... yes 47/310 ... yes 107/311 ... yes 64/312 ... yes 121/313 ... yes 129/314 ... yes 129/315 ... yes 61/316 ... yes 129/317 ... yes 121/318 ... yes 121/319 ... yes 121/320 ... yes 61/321 ... yes 68/322 ... yes 2/323 ... yes 107/324 ... yes 68/325 ... yes 132/326 ... yes 45/327 ... yes 64/328 ... yes 64/329 ... yes 68/330 ... yes 45/331 ... yes 64/332 ... yes 68/333 ... yes 61/334 ... yes 107/335 ... yes 64/336 ... yes 65/337 ... yes 107/338 ... yes 68/339 ... yes 134/340 ... yes 134/341 ... yes 93/342 ... yes 134/343 ... yes 63/344 ... yes 2/346 ... yes 134/347 ... yes 134/348 ... yes 47/349 ... yes 45/350 ... yes 2/351 ... yes 121/352 ... yes 121/353 ... yes 77/354 ... yes 64/355 ... yes 61/356 ... yes 128/357 ... yes 128/358 ... yes 128/359 ... yes 64/360 ... yes 45/361 ... yes 2/362 ... yes 67/371 ... yes 2/378 ... yes 2/379 ... yes 134/380 ... yes 45/381 ... yes 128/383 ... yes 68/384 ... yes 63/385 ... yes 47/386 ... yes 67/387 ... yes 77/388 ... yes 65/389 ... yes 77/391 ... yes 63/392 ... yes 2/393 ... yes 2/394 ... yes 45/395 ... yes 63/396 ... yes 139/397 ... yes 107/398 ... yes 107/399 ... yes 45/400 ... yes 128/401 ... yes 47/402 ... yes 134/404 ... yes 47/405 ... yes 141/406 ... yes 45/407 ... yes 64/408 ... yes 47/409 ... yes 121/410 ... yes 128/412 ... yes 121/413 ... yes 47/414 ... yes 128/415 ... yes 2/416 ... yes 2/417 ... yes 64/418 ... yes 134/419 ... yes 145/420 ... yes 45/421 ... yes 64/422 ... yes 63/423 ... yes 67/424 ... yes 128/425 ... yes 128/427 ... yes 59/428 ... yes 65/429 ... yes 65/430 ... yes 63/431 ... yes 45/432 ... yes 61/433 ... yes 64/434 ... yes 64/435 ... yes 45/436 ... yes 145/437 ... yes 45/438 ... yes 61/439 ... yes 45/440 ... yes 128/441 ... yes 63/442 ... yes 121/443 ... yes 68/444 ... yes 63/445 ... yes 59/446 ... yes 2/447 ... yes 68/448 ... yes 68/449 ... yes 121/450 ... yes 65/451 ... yes 61/452 ... yes 68/453 ... yes 2/454 ... yes 63/455 ... yes 134/456 ... yes 121/457 ... yes 64/458 ... yes 2/459 ... yes 45/460 ... yes 64/461 ... yes 45/462 ... yes 2/463 ... yes 45/464 ... yes 47/465 ... yes 67/466 ... yes 121/467 ... yes 121/468 ... yes 121/469 ... yes 121/470 ... yes 64/471 ... yes 61/472 ... yes 64/473 ... yes 45/474 ... yes 65/475 ... yes 64/476 ... yes 67/477 ... yes 2/478 ... yes 121/479 ... yes 61/480 ... yes 158/481 ... yes 134/482 ... yes 128/483 ... yes 45/484 ... yes 2/485 ... yes 45/486 ... yes 63/487 ... yes 47/488 ... yes 121/489 ... yes 47/490 ... yes 45/491 ... yes 142/492 ... yes 63/493 ... yes 63/494 ... yes 121/495 ... yes 156/496 ... yes 121/497 ... yes 121/498 ... yes 158/499 ... yes 121/500 ... yes 61/501 ... yes 107/502 ... yes 65/503 ... yes 121/504 ... yes 65/505 ... yes 47/506 ... yes 121/507 ... yes 128/509 ... yes 65/510 ... yes 63/511 ... yes 45/512 ... yes 2/513 ... yes 2/515 ... yes 170/516 ... yes 170/517 ... yes 170/518 ... yes 68/519 ... yes 61/520 ... yes 59/521 ... yes 128/522 ... yes 64/523 ... yes 63/524 ... yes 61/525 ... yes 2/526 ... yes 45/527 ... yes 59/528 ... yes 68/529 ... yes 68/530 ... yes 68/531 ... yes 45/532 ... yes 128/533 ... yes 68/534 ... yes 2/535 ... yes 142/536 ... yes 68/537 ... yes 77/538 ... yes 128/539 ... yes 128/540 ... yes 128/542 ... yes 68/543 ... yes 134/544 ... yes 2/547 ... yes 64/548 ... yes 45/549 ... yes 67/550 ... yes 77/551 ... yes 68/552 ... yes 142/553 ... yes 142/554 ... yes 142/555 ... yes 128/557 ... yes 128/558 ... yes 84/559 ... yes Redis version >= 4.0.0? ... yes Ruby version >= 2.5.3 ? ... yes (2.6.6) Git version >= 2.24.0 ? ... yes (2.28.0) Git user has default SSH configuration? ... yes Active users: ... 102 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