Bug 2065734

Summary: Build fails for packages in blueprint that contain conditional dependencies
Product: Red Hat Enterprise Linux 8 Reporter: Christian Heimes <cheimes>
Component: osbuild-composerAssignee: Image Builder team <osbuilders>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: low Docs Contact: Eliane Ramos Pereira <elpereir>
Priority: low    
Version: 8.5CC: akoutsou, atodorov, cbesson, ckellner, elpereir, jrusz, obudai, sbarcomb, thozza, vashirov
Target Milestone: rcKeywords: Patch, Triaged, Upstream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: osbuild-composer-51-1.el8 Doc Type: Bug Fix
Doc Text:
.Images now build successfully for packages in blueprint that contain conditional dependencies Previously, when using the web console to customize a blueprint with packages that contained conditional dependencies, such as `ipa-client`, `cockpit`, `podman`, would cause the build to fail because of the missing dependencies. As a consequence, the conditional dependency was not met during the dep-solve packages. This issue is fixed now, and the builds will no longer fail when dep-solving conditional dependencies.
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-08 09:37:27 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:

Description Christian Heimes 2022-03-18 15:26:38 UTC
Description of problem:
I'm unable to create an image with package "ipa-client" with image builder. The build process always fails with a missing dependency. The problem is reproducible in on the hosted beta console (https://console.redhat.com/beta/insights/image-builder) as well as a self-hosted Cockpit instance in a RHEL 8.5 VM on my computer.

Version-Release number of selected component (if applicable):
osbuild-ostree-35-3.el8.noarch
osbuild-composer-33.2-1.el8.x86_64
cockpit-composer-31.1-1.el8.noarch
ostree-2021.3-2.el8_5.x86_64
ipa-client-4.9.6-6.module+el8.5.0+12661+bab6f12d

How reproducible:
always

Steps to Reproduce:
1. Create a new RHEL 8 image in Console / Cockpit's Image Builder app
2. Add "ipa-client" package

Actual results:
Build process fails with error message

error: Failed dependencies:
	(ipa-selinux if selinux-policy-targeted) is needed by ipa-common-4.9.6-6.module+el8.5.0+12661+bab6f12d.noarch

Expected results:
Image builder should succeed

Additional info:
If I add both "ipa-selinux" and "ipa-client" as packages, then the build process finishes successfully. This leads me to the assumption that osbuild or ostree do not understand the "Requires: (ipa-selinux if selinux-policy-targeted)" syntax correctly.

https://gitlab.com/redhat/centos-stream/rpms/ipa/-/blob/c9s/freeipa.spec#L892

Comment 1 Christian Kellner 2022-03-18 15:50:08 UTC
This is a known limitation of the way we currently dep-solve packages and, quite ironically, happens also for the "osbuild" package.

Comment 2 Christian Kellner 2022-04-14 12:25:53 UTC
*** Bug 2075429 has been marked as a duplicate of this bug. ***

Comment 3 Christian Kellner 2022-04-14 12:37:08 UTC
To give a bit more details:

The build will fail for packages that contain conditionals like `(ipa-selinux if selinux-policy-targeted)` if the "condition" (`selinux-policy-targeted`) is NOT explicitly mentioned in the blueprint but IS contained in the final image; because in this case the conditional dependency (`ipa-selinux`) will not be in the dep-solved package set since the condition is not met, but later while building the image, the condition is met since the condition is now present but we are missing the conditional dependency.

We are actively working on a different way to dep-solve to avoid this scenario.

Comment 4 Tomáš Hozza 2022-05-09 07:08:09 UTC
This issue is already fixed in the latest upstream release of osbuild-composer and should be fixed in the upcoming release of RHEL (8.7 and 9.1). The issue is already resolved in the Image Builder Service.

Comment 9 errata-xmlrpc 2022-11-08 09:37:27 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 (Low: Image Builder security, 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/RHSA-2022:7548