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 2136504 - osbuild-composer can't access /var/cache/osbuild-composer/rpmmd on package upgrade from 9.0
Summary: osbuild-composer can't access /var/cache/osbuild-composer/rpmmd on package up...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: osbuild-composer
Version: 9.0
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: rc
: ---
Assignee: Image Builder team
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks: 2136533
TreeView+ depends on / blocked
 
Reported: 2022-10-20 13:28 UTC by Tomáš Hozza
Modified: 2023-05-09 08:27 UTC (History)
4 users (show)

Fixed In Version: osbuild-composer-67-2.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 2136503
: 2136533 (view as bug list)
Environment:
Last Closed: 2023-05-09 07:32:45 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github osbuild osbuild-composer issues 3079 0 None open `Permission denied` error trying to create repo destination directory under `/var/cache/osbuild-composer/rpmmd` 2022-10-20 13:29:44 UTC
Github osbuild osbuild-composer pull 3085 0 None open spec: Fix ownership of the dnf-json rpmmd files 2022-10-20 13:29:44 UTC
Red Hat Issue Tracker RHELPLAN-137167 0 None None None 2022-10-20 13:54:30 UTC
Red Hat Product Errata RHSA-2023:2204 0 None None None 2023-05-09 07:34:07 UTC

Description Tomáš Hozza 2022-10-20 13:28:30 UTC
Description of problem:
dnf-json previously ran as a service, and the
/var/cache/osbuild-composer/rpmmd directory and files were owned by root. As a script called from osbuild-composer those directories and files need to be owned by _osbuild-composer:_osbuild-composer, otherwise it will not be able to depsolve after an upgrade from the previous implementation.



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


How reproducible:


Steps to Reproduce:
1. Install the latest osbuild-composer package from the latest RHEL 9.0.
2. Start osbuild-composer.socket.
3. Create a testing blueprint and push it to composer using composer-cli
4. sudo composer-cli projects list
5. Upgrade the osbuild-composer package to the latest 9.1 rpm
6. sudo composer-cli projects list

Actual results:
Error such as:
[core@localhost ~]$ sudo composer-cli projects list
ERROR: ProjectsError: msg: DNF error occurred: RepoError: There was a problem reading a repository: Cannot create repo destination directory "/var/cache/osbuild-composer/rpmmd/5b1a6a9dd5657b1991ac6c2ffac793693229b8f1276abbcb83072907cde93b7a-abf9ed1cf56274b5": Permission denied

Expected results:
no permissions-related error on the var/cache/osbuild-composer/rpmmd folder

Additional info:
This can be worked around by removing the
/var/cache/osbuild-composer/rpmmd directory and restarting the service or rebooting.

Related:
https://github.com/osbuild/osbuild-composer/issues/3079
https://github.com/osbuild/osbuild-composer/pull/3085

Comment 6 Alexander Todorov 2023-02-13 11:25:06 UTC
On a RHEL-9.0.0 system:

# rpm -q osbuild-composer
osbuild-composer-46.2-1.el9_0.x86_64

# systemctl start osbuild-composer.socket

# cat py3.toml 
name = "py3"
description = "A base ostree image with Python 3"
version = "0.0.1"
modules = []
groups = []

[[packages]]
name = "python3"
version = "*"

# composer-cli blueprints push py3.toml

# composer-cli blueprints list
py3

# subscription-manager register

# subscription-manager status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Disabled
Content Access Mode is set to Simple Content Access. This host has access to content, regardless of subscription status.

System Purpose Status: Disabled

# subscription-manager list
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name: Red Hat Enterprise Linux for x86_64
Product ID:   479
Version:      9.0
Arch:         x86_64

# composer-cli blueprints depsolve py3
ERROR: BlueprintsError: py3: RHSM secrets not found on the host for this baseurl: https://cdn.redhat.com/content/dist/rhel9/9/x86_64/baseos/os
blueprint: py3 v0.0.1


@Tomas,
I am missing something here but not sure what. I can't depsolve in order to reproduce the bug. Any ideas ?

Comment 7 Brian Lane 2023-02-13 17:50:28 UTC
Did you restart osbuild-composer / reboot after setting up the subscription? It only loads the cert at startup.

Comment 8 Alexander Todorov 2023-02-14 11:12:10 UTC
(In reply to Brian Lane from comment #7)
> Did you restart osbuild-composer / reboot after setting up the subscription?
> It only loads the cert at startup.

I didn't. That worked. Thanks.

Comment 9 Alexander Todorov 2023-02-14 11:33:33 UTC
After restart and a successful depsolve/projects list I see:

# ls -ld /var/cache/osbuild-composer/rpmmd/
drwxr-xr-x. 4 root root 4096 Feb 14 06:12 /var/cache/osbuild-composer/rpmmd/


After upgrade ....

# rpm -qa | grep osbuild
osbuild-composer-dnf-json-73-1.el9.x86_64
osbuild-composer-core-73-1.el9.x86_64
python3-osbuild-77-1.el9.noarch
osbuild-77-1.el9.noarch
osbuild-selinux-77-1.el9.noarch
osbuild-luks2-77-1.el9.noarch
osbuild-lvm2-77-1.el9.noarch
osbuild-ostree-77-1.el9.noarch
osbuild-composer-worker-73-1.el9.x86_64
osbuild-composer-73-1.el9.x86_64


# ls -ld /var/cache/osbuild-composer/rpmmd/
drwxr-xr-x. 20 _osbuild-composer _osbuild-composer 8192 Feb 14 06:23 /var/cache/osbuild-composer/rpmmd/

Comment 12 errata-xmlrpc 2023-05-09 07:32:45 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 (Moderate: 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-2023:2204


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