[Solved] Undefined Method - Error 500

Hi,

I’m facing a lot of errors 500 about missing methods, after restoring a backup (backup made and restored on 11.2.3 06cbee3 version)

Started GET "/admin/application_settings" for xxxxxxxx at 2018-09-07 14:50:55 +0200
Processing by Admin::ApplicationSettingsController#show as HTML
Completed 500 Internal Server Error in 259ms (ActiveRecord: 3.3ms)

ActionView::Template::Error (undefined method `instance_statistics_visibility_private?' for #<ApplicationSetting:0x00007fe76b8a1f60>):
    32:               = link_to 'deactivating the usage ping', help_page_path('user/admin_area/settings/usage_statistics', anchor: 'deactivate-the-usage-ping')
    33:     .form-group
    34:       = f.label :instance_statistics_visibility_private, _('Instance Statistics visibility')
    35:       = f.select :instance_statistics_visibility_private, options_for_select({_('All users') => false, _('Only admins') => true}, Gitlab::CurrentSettings.instance_statistics_visibility_private?), {}, class: 'form-control'
    36:
    37:   = f.submit 'Save changes', class: "btn btn-success"
  lib/gitlab/current_settings.rb:17:in `method_missing'
  app/views/admin/application_settings/_usage.html.haml:35:in `block in _app_views_admin_application_settings__usage_html_haml___2291878224686547365_70315936206900'
  app/views/admin/application_settings/_usage.html.haml:1:in `_app_views_admin_application_settings__usage_html_haml___2291878224686547365_70315936206900'
  app/views/admin/application_settings/show.html.haml:238:in `_app_views_admin_application_settings_show_html_haml___638335600796827121_70316060130960'
  lib/gitlab/i18n.rb:51:in `with_locale'
  lib/gitlab/i18n.rb:57:in `with_user_locale'
  app/controllers/application_controller.rb:401:in `set_locale'
  lib/gitlab/middleware/multipart.rb:97:in `call'
  lib/gitlab/request_profiler/middleware.rb:14:in `call'
  lib/gitlab/middleware/go.rb:17:in `call'
  lib/gitlab/etag_caching/middleware.rb:11:in `call'
  lib/gitlab/middleware/read_only/controller.rb:38:in `call'
  lib/gitlab/middleware/read_only.rb:16:in `call'
  lib/gitlab/middleware/basic_health_check.rb:25:in `call'
  lib/gitlab/request_context.rb:18:in `call'
  lib/gitlab/metrics/requests_rack_middleware.rb:27:in `call'
  lib/gitlab/middleware/release_env.rb:10:in `call'

Any ideas of how I can fix that ?
Thanks

1 Like

Hi,

Do you remember if finished restauration completely?

try this:
gitlab-rake gitlab:check SANITIZE=true

Hi,

Yes the restauration finished completly.

SANITIZE looks ok :

Checking GitLab Shell ...

GitLab Shell version >= 8.1.1 ? ... OK (8.1.1)
Repo base directory exists?
default... yes
Repo storage directories are symlinks?
default... no
Repo paths owned by git:root, or git:git?
default... yes
Repo paths access is drwxrws---?
default... yes
hooks directories in repos are links: ...
5/2 ... ok
5/3 ... ok
....
5/95 ... ok
3/97 ... ok
18/98 ... ok
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Redis available via internal API: OK

Access to /var/opt/gitlab/.ssh/authorized_keys: OK
gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Sidekiq ...

Running? ... yes
Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Reply by email is disabled in config/gitlab.yml
Checking LDAP ...

LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab ...

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: ...
5/2 ... yes
5/3 ... yes
....
5/95 ... yes
3/97 ... yes
18/98 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.3.5 ? ... yes (2.4.4)
Git version >= 2.9.5 ? ... yes (2.18.0)
Git user has default SSH configuration? ... yes
Active users: ... 15

Checking GitLab ... Finished

Ok my bad, just fixed the issue by :

gitlab-rake db:migrate:status

saw that some migrations were down

gitlab-rake db:migrate