Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 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 "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". 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 "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-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 2081285

Summary: [RFE] The composer needs a command to clear the separate cache
Product: Red Hat Enterprise Linux 8 Reporter: Christophe Besson <cbesson>
Component: osbuild-composerAssignee: Brian Lane <bcl>
Status: CLOSED MIGRATED QA Contact: Release Test Team <release-test-team-automation>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.5CC: bcl, elpereir, hartsjc, jcastran, obudai, sbarcomb
Target Milestone: rcKeywords: FutureFeature, MigratedToJIRA, Reproducer, Triaged, WorkAround
Target Release: ---Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-18 12:04:10 UTC Type: Story
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Christophe Besson 2022-05-03 09:58:00 UTC
Description of problem:
Customer was not able to generate image with the latest kernel whereas a more recent version was available in the repositories.
Erasing the cache and then restarting the daemon fixed the issue.
A command allowing to erase it from the `composer-cli` would be welcome to ease that part, and that would let the users know a separate cache is maintained by the composer.

Version-Release number of selected component (if applicable):
composer-cli-28.14.62-1.el8.x86_64
osbuild-composer-33.2-1.el8.x86_64

How reproducible:
Always

Steps to Reproduce:
Use a VM with with old metadata in the composer separate cache and run a depsolve.

Actual results:
# yum list kernel
Updating Subscription Management repositories.
Last metadata expiration check: 2:47:07 ago on Tue 03 May 2022 07:43:52 AM CEST.
Installed Packages
kernel.x86_64            4.18.0-305.el8                   
kernel.x86_64            4.18.0-348.12.2.el8_5
Available Packages
kernel.x86_64            4.18.0-348.23.1.el8_5    <===

# composer-cli blueprints depsolve working | grep kernel
    kernel-modules-4.18.0-348.20.1.el8_5.x86_64
    kernel-core-4.18.0-348.20.1.el8_5.x86_64
    kernel-4.18.0-348.20.1.el8_5.x86_64           <===

Expected results:
The latest kernel is picked up.

Additional info:
* To workaround the issue:
# rm -rf /var/cache/osbuild-composer/*
# systemctl restart osbuild-composer

* The metadata_expire DNF option is maybe too briefly mentioned in the doc.

Comment 3 Brian Lane 2022-07-27 22:38:08 UTC
This should be fixed in osbuild-composer v36 and later. The default metadata expiration is now 20s unless the repository json overrides it (we do that on Fedora for update repos, but on RHEL all repos are currently 20s).

Please retry with a newer version and confirm that fixes the issue. eg. RHEL 8.6 has v46.3

Comment 4 Christophe Besson 2022-10-14 08:35:33 UTC
I got another issue while doing this, not sure if it is related to the cache.

System is correctly registered, `dnf -v repolist` was working well (I even downloaded again the metadata after a `dnf clean all`), but I got the below issue while trying to depsolve my blueprint.

Oct 14 10:20:01 localhost.localdomain dnf-json[176217]: Errors during downloading metadata for repository '0':
Oct 14 10:20:01 localhost.localdomain dnf-json[176217]:   - Curl error (58): Problem with the local SSL certificate for https://cdn.redhat.com/content/dist/rhel8/8.6/x86_64/baseos/os/repodata/repomd.xml [could not load PEM client certificate, OpenSSL error error:02001002:system library:fopen:No such file or directory, (no key found, wrong pass phrase, or wrong file format?)]
Oct 14 10:20:01 localhost.localdomain dnf-json[176217]: 2022.10.14 10:20:01 dnf-json.INFO: clean unused folders
Oct 14 10:20:24 localhost.localdomain dnf-json[176237]: Errors during downloading metadata for repository '0':
Oct 14 10:20:24 localhost.localdomain dnf-json[176237]:   - Curl error (58): Problem with the local SSL certificate for https://cdn.redhat.com/content/dist/rhel8/8.6/x86_64/baseos/os/repodata/repomd.xml [could not load PEM client certificate, OpenSSL error error:02001002:system library:fopen:No such file or directory, (no key found, wrong pass phrase, or wrong file format?)]
Oct 14 10:20:24 localhost.localdomain dnf-json[176237]: 2022.10.14 10:20:24 dnf-json.INFO: clean unused folders

`subscription-manager refresh` didn't help to move forward.
I removed the cache and restarted the Composer and it worked afterwards.

# rm -rf /var/cache/osbuild-composer/*
# systemctl restart osbuild-composer

Not able to reproduce this now.

I will try again in the coming weeks.

Comment 5 Brian Lane 2022-10-14 16:09:33 UTC
If you hit that again try restarting without clearing the cache which shouldn't be involved with the certificates. I think it's possible the subscriptions changed while osbuild-composer was running, and they are only read at startup. Approximately how long was this system running before this happened? We need to recheck the subscriptions before doing the depsolve if this is the case.

Comment 6 Brian Lane 2022-10-14 16:23:59 UTC
What version of osbuild-composer are you using now? After discussing this with the team this sounds like something that was fixed in v56 which is in rhel8-8.7.0 (the subscriptions are reloaded on every depsolve).

Comment 7 Christophe Besson 2022-10-17 07:35:13 UTC
I confirm I was using the previous version shipped with the latest GA el 8.6:
osbuild-composer-46.3-1.el8_6
osbuild-53-2.el8

> this sounds like something that was fixed in v56

Thanks for letting me know.

I'll recheck the original issue shortly and I'll let you know once it is done.

Comment 8 Christophe Besson 2022-10-26 09:54:46 UTC
I just checked and I can confirm it's already fixed with the packages delivered in el 8.6.
osbuild-composer-46.3-1.el8_6
osbuild-53-2.el8

Restarting without clearing the cache was enough.

Comment 9 RHEL Program Management 2023-09-18 12:02:29 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 10 RHEL Program Management 2023-09-18 12:04:10 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.