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 2142665 - Can't Enable Repositories After Upgrading from 6.9 When Download Policy was Set to Background
Summary: Can't Enable Repositories After Upgrading from 6.9 When Download Policy was S...
Keywords:
Status: CLOSED DUPLICATE of bug 1996136
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Repositories
Version: 6.11.4
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Satellite QE Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-11-14 19:43 UTC by myoder
Modified: 2023-12-22 17:36 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-12-22 17:35:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SAT-13998 0 None None None 2022-11-22 16:37:55 UTC

Description myoder 2022-11-14 19:43:22 UTC
Description of problem:

On a 6.11.4 Satellite, the "Default Red Hat Repository download policy" setting was configured to "background".  This option no longer exists (was last used in 6.9), and the only 2 options should be "immediate" and "on_demand".  When Satellite has "background" configured for this option in 6.11.4, users can no longer enable repositories from "Content => Repositories" (or via hammer commands).  Any attempt is met with the error "root_id violates not-null constraint".

Have not confirmed, but it seems likely the "background" option was set in 6.9, and after upgrading to 6.10 then to 6.11, this setting was still configured within Satellite's "Administer => Settings" page under the "Content" tab.


With the "background" option set, we see the api call to enable the repository:

~~~
2022-11-12T23:26:41 [I|app|d647bf64] Started PUT "/katello/api/products/38/repository_sets/11412/enable" for 10.22.0.13 at 2022-11-12 23:26:41 +0300
~~~

Then we see the Satellite reaching out to the CDN for repomd.xml file (which it grabs successfully):

~~~
2022-11-12T23:26:41 [I|app|d647bf64] CDN: Requesting path https://cdn.redhat.com:443/content/dist/layered/rhel8/x86_64/openstack/16.2/os/repodata/repomd.xml
~~~

And finally we get a "root_id" violates not-null constraint (where we see the root_id, remote_href, publication_href and version_href are all null when we try to populate the katello_repositories table):

~~~
2022-11-12T23:26:48 [E|bac|d647bf64] PG::NotNullViolation: ERROR:  null value in column "root_id" violates not-null constraint
 d647bf64 | DETAIL:  Failing row contains (2370, 1fa9496f-7305-4f6a-b5cc-42df61a0565b, null, 1, Default_Organization/Library/content/dist/layered/rhel8/x86_64/openstac..., 1, null, null, null, null, null, null, null, null, null, null, null, 1970-01-01 00:00:00, 1970-01-01 00:00:00, 1970-01-01 00:00:00).
~~~


Using the sql debugging option, we see that Satellite fails to create a katello_root_repositories entry for the repository we are trying to enable, which explains why "root_id" is null.

Version-Release number of selected component (if applicable):
Discovered on 6.11.4, but presumably it is affected by any system that has upgraded from 6.9, while having the "background" option set on 6.9.

How reproducible:
have not reproduced yet, but will setup up a reproducer to test the theory to reproduce it.

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
After changing the setting for "Default Red Hat Repository download policy" to "on_demand", this setting changed back to "background" 3 times.  Not sure what triggered Satellite to change it back to "background".  The logs don't show any indication of the "background" option being present, or being changed back.  
But after the setting was changed to "on_demand" admin user was allowed to enable a repository.  Upon trying to enable a second repository, we observed the same error "root_id violates not-null constraint" and confirmed the "background" option had been reverted.  It took 4 times to change it to "on_demand" and presumably this option has stayed.  Will need to confirm the option has not reverted back to "background".

Comment 3 Ian Ballou 2023-04-25 19:42:53 UTC
This BZ (https://bugzilla.redhat.com/show_bug.cgi?id=1996136) should've fixed any issues with the background download policy from 6.9 to 6.10.

We'll need to reproduce this this a 6.9->6.10 migration run to see if it's reproducible. If it's not I'll recommend closing the BZ unless the same error as above shows up again.

Comment 5 myoder 2023-12-22 17:36:54 UTC

*** This bug has been marked as a duplicate of bug 1996136 ***


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