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 2227869 - Satellite is not able to pick settings which transitioned from a non-default to default value
Summary: Satellite is not able to pick settings which transitioned from a non-default ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Settings
Version: 6.11.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 6.12.5
Assignee: Adam Ruzicka
QA Contact: visawant
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-07-31 18:00 UTC by Odilon Sousa
Modified: 2023-08-24 18:24 UTC (History)
2 users (show)

Fixed In Version: foreman-3.3.0.22-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-08-24 18:24:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 35894 0 Normal Closed Foreman.settings.load_values is not able to pick settings which transitioned from a non-default to default value 2023-07-31 18:02:13 UTC
Red Hat Bugzilla 2157869 0 unspecified CLOSED Satellite is not able to pick settings which transitioned from a non-default to default value 2023-07-31 18:02:13 UTC
Red Hat Issue Tracker SAT-19281 0 None None None 2023-07-31 18:02:23 UTC
Red Hat Product Errata RHBA-2023:4749 0 None None None 2023-08-24 18:24:46 UTC

Description Odilon Sousa 2023-07-31 18:00:31 UTC
This bug was initially created as a copy of Bug #2154184

Satellite is not able to detect when a setting changes from a non-default to
default value and if such a change happens, it continues using the non-default
one until services are restarted. This affects all releases from 6.11 onwards.

Steps to reproduce:
1) Run rails console
2) Pick a $setting without custom value
3) Read a value of $setting with Setting[$setting]
4) In another process, change the value of $setting to a non-default one
5) Reload the settings with Foreman.settings.load_values
6) Repeat 3, notice the value is what was set in 4
6) In another process, change the value of $setting to the default one
7) Repeat 5
8) Repeat 3

Actual results:
The value in 8 is the same as in 6

Expected results:
The value in 8 is the same as in 3

Comment 1 Bryan Kearney 2023-07-31 20:03:37 UTC
Upstream bug assigned to aruzicka

Comment 2 Bryan Kearney 2023-07-31 20:03:38 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/35894 has been resolved.

Comment 4 visawant 2023-08-10 11:30:38 UTC
Verified


Version tested:
---------------
Satellite 6.12.5 Snap 2.0


Steps performed:
----------------
1) Run rails console
~~~
[root@ip-fqdn ~]# foreman-rake console
Loading production environment (Rails 6.0.6)
irb(main):001:0>
~~~

2) Pick a $setting without custom value
I chose "instance_title", which can be seen on web UI at Administer > Settings > General tab with Name "Instance title"
~~~
irb(main):001:0> $seting = 'instance_title'
=> "instance_title"
~~~

3) Read a value of $setting with Setting[$setting]
~~~
irb(main):002:0>  Setting[$seting]
=> nil
~~~

4) In another process, change the value of $setting to a non-default one
I preferred hammer cli command, which can also be changed from web UI
~~~
# hammer setting set --name instance_title --value my_custom_instance
# hammer --output=table setting info --name instance_title
---------------|----------------|---------------------------------------------------------------------------------|----------|---------------|-------------------
ID             | NAME           | DESCRIPTION                                                                     | CATEGORY | SETTINGS TYPE | VALUE             
---------------|----------------|---------------------------------------------------------------------------------|----------|---------------|-------------------
instance_title | instance_title | The instance title is shown on the top navigation bar (requires a page reload). | General  | string        | my_custom_instance
---------------|----------------|---------------------------------------------------------------------------------|----------|---------------|-------------------
~~~

5) Reload the settings with Foreman.settings.load_values
~~~
irb(main):003:0> Foreman.settings.load_values
=> Thu, 10 Aug 2023 10:49:32 UTC +00:00
~~~

6) Repeat 3, notice the value is what was set in 4
~~~
irb(main):004:0>  Setting[$seting]
=> "my_custom_instance"
~~~

6) In another process, change the value of $setting to the default one
~~~
# hammer --output=table setting set --name instance_title --value ""
Setting [instance_title] updated to [].
# hammer --output=table setting info --name instance_title
---------------|----------------|---------------------------------------------------------------------------------|----------|---------------|------
ID             | NAME           | DESCRIPTION                                                                     | CATEGORY | SETTINGS TYPE | VALUE
---------------|----------------|---------------------------------------------------------------------------------|----------|---------------|------
instance_title | instance_title | The instance title is shown on the top navigation bar (requires a page reload). | General  | string        |      
---------------|----------------|---------------------------------------------------------------------------------|----------|---------------|------
~~~

7) Repeat 5
~~~
irb(main):005:0> Foreman.settings.load_values
=> Thu, 10 Aug 2023 11:16:36 UTC +00:00
~~~

8) Repeat 3
~~~
irb(main):006:0>  Setting[$seting]
=> ""
~~~


Additional details:
-------------------
Value which is in step-8 was set in step-6 (i.e ""), which is obvious if we are expecting value same as step-3 i.e "nil" then need to reset it from database.

Comment 9 errata-xmlrpc 2023-08-24 18:24:35 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 (Satellite 6.12.5 Async Update), 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/RHBA-2023:4749


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