Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2139371 - can't save RH Cloud settings on an upgraded Satellite 6.12
Summary: can't save RH Cloud settings on an upgraded Satellite 6.12
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: RH Cloud - Inventory
Version: 6.12.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: 6.12.0
Assignee: Evgeni Golov
QA Contact: Jameer Pathan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-11-02 10:17 UTC by Evgeni Golov
Modified: 2022-11-16 13:35 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-16 13:35:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github theforeman foreman_rh_cloud pull 774 0 None open Migrate RH Cloud settings to category Settings 2022-11-02 11:47:50 UTC
Red Hat Product Errata RHSA-2022:8506 0 None None None 2022-11-16 13:35:57 UTC

Description Evgeni Golov 2022-11-02 10:17:15 UTC
Description of problem:
On a setup that has been upgraded from 6.11, one can't save any RH Cloud related settings.

Version-Release number of selected component (if applicable):
rubygem-foreman_rh_cloud-6.0.42-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 → RH CLoud
4. try to edit a setting, like ID of RHC

Actual results:
500 Error

production log reads:
2022-11-02T06:01:48 [I|app|5a958eef] Started PUT "/api/settings/rhc_instance_id" for 10.39.195.157 at 2022-11-02 06:01:48 -0400
2022-11-02T06:01:48 [I|app|5a958eef] Processing by Api::V2::SettingsController#update as JSON
2022-11-02T06:01:48 [I|app|5a958eef]   Parameters: {"setting"=>{"value"=>"[FILTERED]"}, "apiv"=>"v2", "id"=>"rhc_instance_id"}
2022-11-02T06:01:48 [W|app|5a958eef] Action failed
2022-11-02T06:01:48 [I|app|5a958eef] Backtrace for 'Action failed' error (ActiveRecord::SubclassNotFound): The single-table inheritance mechanism failed to locate the subclass: 'Setting::RhCloud'. This error is raised because the column 'category' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite Setting.inheritance_column to use another column for that information.
 5a958eef | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/inheritance.rb:234:in `rescue in find_sti_class'
 5a958eef | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/inheritance.rb:227:in `find_sti_class'
 5a958eef | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/inheritance.rb:215:in `discriminate_class_for_record'
 5a958eef | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/persistence.rb:257:in `instantiate'
 5a958eef | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/querying.rb:58:in `block (2 levels) in find_by_sql'
 5a958eef | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/result.rb:62:in `block in each'
 5a958eef | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/result.rb:62:in `each'
 5a958eef | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/result.rb:62:in `each'
 5a958eef | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/querying.rb:58:in `map'
 5a958eef | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/querying.rb:58:in `block in find_by_sql'
 5a958eef | /usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
 5a958eef | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/querying.rb:56:in `find_by_sql'
 5a958eef | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/relation.rb:824:in `block in exec_queries'
 5a958eef | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/relation.rb:842:in `skip_query_cache_if_necessary'
 5a958eef | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/relation.rb:811:in `exec_queries'
 5a958eef | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/relation.rb:626:in `load'
 5a958eef | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/relation.rb:250:in `records'
 5a958eef | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/relation/finder_methods.rb:499:in `find_take'
 5a958eef | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/relation/finder_methods.rb:98:in `take'
 5a958eef | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/relation/finder_methods.rb:81:in `find_by'
 5a958eef | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/querying.rb:21:in `find_by'
 5a958eef | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/core.rb:183:in `find_by'
 5a958eef | /usr/share/foreman/app/services/setting_registry.rb:181:in `_find_or_new_db_record'
 5a958eef | /usr/share/foreman/app/services/setting_registry.rb:82:in `set_user_value'
 5a958eef | /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::RhCloud` as the category of the settings.

Comment 3 Jameer Pathan 2022-11-04 08:30:54 UTC
Verified:

Verified with:
- Satellite 6.12 snap 16
- rubygem-foreman_rh_cloud-6.0.42.2-1.el8sat.noarch

Test steps:
- Install Satellite 6.11
- Upgrade Satellite to 6.12 snap 16
- Go to Administer > Settings > RH Cloud
- Try to edit rhc_instance_id setting

Observations:
- Setting was updated successfully 
- No traceback in production.log

Comment 6 errata-xmlrpc 2022-11-16 13:35:51 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: Satellite 6.12 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:8506


Note You need to log in before you can comment on or make changes to this bug.