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 1872902 - RHSM service feature prevents running anaconda inside a mock
Summary: RHSM service feature prevents running anaconda inside a mock
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: anaconda
Version: 8.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.0
Assignee: Martin Kolman
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-08-26 21:02 UTC by Brian Lane
Modified: 2021-09-19 22:17 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-09-19 22:17:18 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
anaconda.log (10.97 KB, text/plain)
2020-08-26 21:09 UTC, Brian Lane
no flags Details
dbus.log (46.84 KB, text/plain)
2020-08-26 21:10 UTC, Brian Lane
no flags Details

Description Brian Lane 2020-08-26 21:02:27 UTC
Description of problem:
Some people expect to be able to use mock from EPEL 8 with livemedia-creator. The new RHSM feature prevents this from working because it always tries to start the rhsm.service (you can't run a systemd service inside mock) so the livemedia-creator run fails.


Version-Release number of selected component (if applicable):
anaconda-tui-33.16.3.21-1.el8
lorax-28.14.54-2.el8
lorax-lmc-novirt-28.14.54-2.el8

How reproducible:
always

Steps to Reproduce:
1. Install EPEL8 repository
2. Install mock from EPEL8
3. Create a new mock config pointing to a local RHEL 8 repo
4. mock -r rhel-8-x86_64 --init
5. mock -r rhel-8-x86_64 --install lorax-lmc-novirt
6. mock -r rhel-8-x86_64 --copyin ./test.ks /root/
7. mock -r rhel-8-x86_64 --enable-network --chroot -- livemedia-creator --no-virt --make-fsimage --ks /root/test.ks


Actual results:
Anaconda fails with an error - "dasbus.error.DBusError: The RHSM DBus API is not available."


Expected results:
anaconda runs and doesn't try to start the rhsm service unless the rhsm command is included in the kickstart (or it is running without kickstart).

Comment 2 Brian Lane 2020-08-26 21:09:56 UTC
Created attachment 1712741 [details]
anaconda.log

Comment 3 Brian Lane 2020-08-26 21:10:21 UTC
Created attachment 1712742 [details]
dbus.log

Comment 4 Martin Kolman 2020-08-27 10:04:43 UTC
This is a valid issue - I guess we should add code that detects Anaconda is running in mock and does not attempt to communicate with the RHSM service. Due to this Anaconda will not be able to resgsiter & use the CDN, as the only usable RHSM API is provided via DBUS, but that might not be an issue for LMC.

Comment 5 Brian Lane 2020-08-27 15:45:27 UTC
(In reply to Martin Kolman from comment #4)
> This is a valid issue - I guess we should add code that detects Anaconda is
> running in mock and does not attempt to communicate with the RHSM service.
> Due to this Anaconda will not be able to resgsiter & use the CDN, as the
> only usable RHSM API is provided via DBUS, but that might not be an issue
> for LMC.

You can use the certs with the url and repo --ssl* arguments, but that has to be setup manually and in general I wouldn't expect someone running inside mock to be doing that.
It might work to make the rhsm startup a soft failure, and then exit if fetching packages doesn't work. Or detect the error from systemctl start rhsm, but that may not be very reliable. I get this output/rc:


<mock-chroot> sh-4.4# systemctl start rhsm
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
<mock-chroot> sh-4.4# echo $?
1

Comment 7 Massimiliano 2020-12-18 16:04:55 UTC
I'm trying to build a live image with CentOS Stream:
$ cat /etc/redhat-release 
CentOS Stream release 8

$ rpm -q anaconda-tui lorax-\*
anaconda-tui-33.16.3.26-1.el8.x86_64
lorax-28.14.55-2.el8.x86_64

I'm facing this issue if I run the command:
$ mock --root=centos-8-remix-x86_64 --isolation=simple --chroot -- livemedia-creator --no-virt --nomacboot --tmp=/results --logfile=/results/logs/livemedia.log --make-iso --project=CentOS --releasever=8 --ks=/results/gnome-box.ks

But if run the following, then the process goes on:
$ mock --root=centos-8-remix-x86_64 --isolation=simple --chroot -- livemedia-creator --no-virt --nomacboot --tmp=/results --logfile=/results/logs/livemedia.log --make-iso --project=Fedora --releasever=8 --ks=/results/gnome-box.ks

Note the option "--project=Fedora" instead of "--project=CentOS".

Comment 8 Massimiliano 2020-12-18 18:37:30 UTC
(In reply to Massimiliano from comment #7)
> Note the option "--project=Fedora" instead of "--project=CentOS".

I realized that I need to set "--project='CentOS Stream'", I suppose in order to match the configuration file /etc/anaconda/product.d/centos-stream.conf

The anaconda log chunk:

19:08:12,214 INF core.configuration.product: Loading information about products from /etc/anaconda/product.d.
19:08:12,214 INF core.configuration.product: Found Fedora Server at /etc/anaconda/product.d/fedora-server.conf.
19:08:12,215 INF core.configuration.product: Found oVirt Node Next at /etc/anaconda/product.d/ovirt.conf.
19:08:12,215 INF core.configuration.product: Found Fedora Workstation at /etc/anaconda/product.d/fedora-workstation.conf.
19:08:12,216 INF core.configuration.product: Found Fedora AtomicHost at /etc/anaconda/product.d/fedora-atomic-host.conf.
19:08:12,216 INF core.configuration.product: Found Fedora Workstation Live at /etc/anaconda/product.d/fedora-workstation-live.conf.
19:08:12,216 INF core.configuration.product: Found Fedora at /etc/anaconda/product.d/fedora.conf.
19:08:12,217 INF core.configuration.product: Found Red Hat Enterprise Linux at /etc/anaconda/product.d/rhel.conf.
19:08:12,217 INF core.configuration.product: Found Scientific Linux at /etc/anaconda/product.d/scientific-linux.conf.
19:08:12,217 INF core.configuration.product: Found Red Hat Virtualization at /etc/anaconda/product.d/rhev.conf.
19:08:12,217 INF core.configuration.product: Found CentOS Stream at /etc/anaconda/product.d/centos-stream.conf.
19:08:12,218 INF core.configuration.product: Found CentOS Linux at /etc/anaconda/product.d/centos.conf.
19:08:12,218 INF core.configuration.product: Found Fedora Silverblue at /etc/anaconda/product.d/fedora-silverblue.conf.
19:08:12,218 INF core.configuration.product: The product CentOS Stream is supported.
19:08:12,222 INF main: /usr/sbin/anaconda 33.16.3.26-1.el8

Comment 14 Jiri Konecny 2021-09-10 10:05:14 UTC
*** Bug 1993944 has been marked as a duplicate of this bug. ***


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