Bug 1896185

Summary: Image builder uses CDN repositories when host is registered to Satellite
Product: Red Hat Enterprise Linux 8 Reporter: Brian Smith <briasmit>
Component: osbuild-composerAssignee: Martin Sehnoutka <msehnout>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: urgent Docs Contact: Eliane Ramos Pereira <elpereir>
Priority: urgent    
Version: ---CC: atodorov, bcygan, cbesson, elpereir, hartsjc, jcastran, jrusz, jscheibe, jswanson, ktordeur, mhillis, msehnout, obudai, parmstro, pdwyer, risantam, saydas, sbarcomb, spurrier, tgunders
Target Milestone: rcKeywords: Reproducer, Triaged, ZStream
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: osbuild-composer-31-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1973034 (view as bug list) Environment:
Last Closed: 2021-11-09 18:46:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1973034    

Description Brian Smith 2020-11-09 22:26:52 UTC
Description of problem:  When using Image Builder on RHEL 8.3 GA with a system registered to Satellite, the Image Builder sources have the appstream/base OS repositories pointed to cdn.redhat.com rather than the Satellite server.  My system was not able to connect to these repositories, so Image Builder was unusable.  The sources are listed as "System source" and it doesn't appear that they can be deleted.  


Version-Release number of selected component (if applicable):  RHEL 8.3 GA


How reproducible: every time


Steps to Reproduce:
1.  Build RHEL 8.3 system registered to Satellite server
2.  Go in to Image Builder and look at sources
3.  Attempt to build a blueprint, and the list of packages never loads

Actual results:
Sources for appstream/base OS are pointed to cdn.redhat.com and the system can't connect to them.  It doesn't appear that these sources can be deleted.  


Expected results:
If the host is registered to Satellite, the Image Builder sources should point to the Satellite server as well.

Comment 1 jcastran 2020-12-03 12:57:50 UTC
Is therea workaround to this bugzilla? Where can the satellite hostname be inserted to replace the cdn target?

Comment 2 Ondřej Budai 2020-12-03 13:03:05 UTC
You can do the following:

mkdir -p /etc/osbuild-composer/repositories
cp /usr/share/osbuild-composer/repositories/rhel-8.json /etc/osbuild-composer/repositories/

Now, open /etc/osbuild-composer/repositories/rhel-8.json and edit the baseurls.

Comment 6 Mark Hillis 2021-03-18 18:28:00 UTC
I've modified the rhel-8.json base URLs to point to the satellite server, I get a 403 error in messages. Same behavior. has the workaround been validated?

Comment 7 Christophe Besson 2021-04-07 08:15:32 UTC
Just added another case.
Originally I opened another rhbz#1945670 but this is a clone.
We also reproduced that issue internally, with "custom repos" (those of the Sat server) defined in /etc/osbuild-composer/repositories/rhel-8.json, and symlinked the cacert (/etc/rhsm/ca/redhat-uep.pem -> /etc/rhsm/ca/katello-server-ca.pem).
Issue is the same. 

Stracing osbuild shows it reads a wrong key/cert pair from /etc/pki/entitlement. 
Please note that overwriting the specific key/cert pair used (in my case /etc/pki/entitlement/8048553451084698847{-key}.pem) by the debug cert of the Satellite server fixes the issue.

Comment 8 Christophe Besson 2021-04-07 08:21:17 UTC
Please also note the issue has been reproduced by defining other custom repos (for 3rd parties):
~~~
# dnf repolist
Updating Subscription Management repositories.
repo id                                                                                   repo name
DefaultOrganization_CustomProduct2_CustomRepo2                                            CustomRepo2
DefaultOrganization_CustomProduct3_CustomRepo3                                            CustomRepo3
DefaultOrganization_CustomProduct_CustomRepo1                                             CustomRepo1
rhel-8-for-x86_64-appstream-rpms                                                          Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)
rhel-8-for-x86_64-baseos-rpms                                                             Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs)
~~~

I guess it could work without them (only one key/cert pair in /etc/pki/entitlement).

Comment 9 Martin Sehnoutka 2021-04-07 12:57:20 UTC
*** Bug 1945670 has been marked as a duplicate of this bug. ***

Comment 22 Johannes Scheiber 2021-07-14 14:40:02 UTC
*** Bug 1982253 has been marked as a duplicate of this bug. ***

Comment 24 Ondřej Budai 2021-08-17 13:02:46 UTC
 The upstream PR[1] that fixed this bug contained also regression tests for this specific bug. These tests are passing therefore I consider this PR preverified.

[1]: https://github.com/osbuild/osbuild-composer/pull/1405

Comment 34 Alexander Todorov 2021-09-01 10:05:34 UTC
@Paul,
ping, see comment #32. Are you able to test with the latest osbuild-composer ?

Comment 42 errata-xmlrpc 2021-11-09 18:46:58 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 (osbuild bug fix and enhancement 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-2021:4273