Project

General

Profile

Actions

Bug #35705

closed

can't save bootdisk settings on an upgraded Satellite 6.12

Added by Evgeni Golov 11 months ago. Updated 11 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=2139369

Description of problem:
On a setup that has been upgraded from 6.11, one can't save any Bootdisk related settings.

Version-Release number of selected component (if applicable):
rubygem-foreman_bootdisk-19.0.6-1.el8sat.noarch
satellite-6.12.0-4.el8sat.noarch

How reproducible:
100%

Steps to Reproduce:
1. install 6.11
2. upgrade to 6.12
3. go to settings → bootdisk
4. try to edit a setting, like Grub2 directory

Actual results:
500 Error

production log reads:
2022-11-02T06:01:22 [I|app|3956271e] Started PUT "/api/settings/bootdisk_grub2_dir" for 10.39.195.157 at 2022-11-02 06:01:22 -0400
2022-11-02T06:01:22 [I|app|3956271e] Processing by Api::V2::SettingsController#update as JSON
2022-11-02T06:01:22 [I|app|3956271e] Parameters: {"setting"=>{"value"=>"[FILTERED]"}, "apiv"=>"v2", "id"=>"bootdisk_grub2_dir"}
2022-11-02T06:01:22 [W|app|3956271e] Action failed
2022-11-02T06:01:22 [I|app|3956271e] Backtrace for 'Action failed' error (ActiveRecord::SubclassNotFound): Invalid single-table inheritance type: Setting::Bootdisk is not a subclass of Setting
3956271e | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/inheritance.rb:241:in `find_sti_class'
3956271e | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/inheritance.rb:215:in `discriminate_class_for_record'
3956271e | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/persistence.rb:257:in `instantiate'
3956271e | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/querying.rb:58:in `block (2 levels) in find_by_sql'
3956271e | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/result.rb:62:in `block in each'
3956271e | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/result.rb:62:in `each'
3956271e | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/result.rb:62:in `each'
3956271e | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/querying.rb:58:in `map'
3956271e | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/querying.rb:58:in `block in find_by_sql'
3956271e | /usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
3956271e | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/querying.rb:56:in `find_by_sql'
3956271e | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/relation.rb:824:in `block in exec_queries'
3956271e | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/relation.rb:842:in `skip_query_cache_if_necessary'
3956271e | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/relation.rb:811:in `exec_queries'
3956271e | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/relation.rb:626:in `load'
3956271e | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/relation.rb:250:in `records'
3956271e | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/relation/finder_methods.rb:499:in `find_take'
3956271e | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/relation/finder_methods.rb:98:in `take'
3956271e | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/relation/finder_methods.rb:81:in `find_by'
3956271e | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/querying.rb:21:in `find_by'
3956271e | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/core.rb:183:in `find_by'
3956271e | /usr/share/foreman/app/services/setting_registry.rb:181:in `_find_or_new_db_record'
3956271e | /usr/share/foreman/app/services/setting_registry.rb:82:in `set_user_value'
3956271e | /usr/share/foreman/app/controllers/api/v2/settings_controller.rb:54:in `update'

Expected results:
No error, setting is saved

Additional info:
This is because the DB was not migrated to use `Setting` instead of `Setting::Bootdisk` as the category of the settings.

Actions #1

Updated by The Foreman Bot 11 months ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman_bootdisk/pull/133 added
Actions #2

Updated by The Foreman Bot 11 months ago

  • Pull request https://github.com/theforeman/foreman_bootdisk/pull/134 added
Actions #3

Updated by Anonymous 11 months ago

  • Status changed from Ready For Testing to Closed
Actions #4

Updated by Evgeni Golov 11 months ago

  • Subject changed from can't save bootdisk settings on an upgraded Satellite 6.12 to can't save bootdisk settings on an upgraded Satellite 6.12
  • Assignee changed from Lukas Zapletal to Evgeni Golov
Actions

Also available in: Atom PDF