Unable to save application settings
Created by @stanhu.
I got this when I attempted this:
- Go to admin application settings page (/admin/application_settings)
- Change some values.
- Go back to the settings page, try to change other values, and save again.
Then I got this Error 500. I also saw a similar thing in my dev environment, which is why I went to test.
There are a number of serious problems with this bug:
- The first save also causes the default project/group/snippet visibilities to be set to null, which can cause errors during imports (e.g. https://gitlab.com/gitlab-com/support-forum/issues/1638). The workaround is to update the settings in the console.
- Settings that you thought may have been updated are not actually changed. We had the IP limiter code running for many hours before noticing it wasn't actually not disabled after the save.
https://sentry.gitlap.com/gitlab/gitlabcom/issues/23922/
NoMethodError: super: no superclass method `restricted_visibility_levels=' for #<ApplicationSetting:0x007fa3c2500150>
app/models/application_setting.rb:359:in `restricted_visibility_levels='
super(levels.map { |level| Gitlab::VisibilityLevel.level_value(level) })
app/services/application_settings/update_service.rb:8:in `execute'
@application_setting.update(@params)
lib/gitlab/metrics/instrumentation.rb:156:in `block in execute'
trans.method_call_for(#{label.to_sym.inspect}).measure { super }
lib/gitlab/metrics/method_call.rb:23:in `measure'
retval = yield
lib/gitlab/metrics/instrumentation.rb:156:in `execute'
trans.method_call_for(#{label.to_sym.inspect}).measure { super }
...
(133 additional frame(s) were not displayed)
NoMethodError: super: no superclass method `restricted_visibility_levels=' for #<ApplicationSetting:0x007fa3c2500150>