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 1867426

Summary: buildah subscription-manager interferring
Product: Red Hat Enterprise Linux 8 Reporter: mckweb
Component: subscription-managerAssignee: candlepin-bugs
Status: CLOSED NOTABUG QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.2CC: dornelas, dwalsh, hasuzuki, redakkan, tsweeney
Target Milestone: rcKeywords: FutureFeature
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-09-02 21:56:13 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 mckweb 2020-08-10 00:43:32 UTC
Description of problem:
Using a fresh workstation development install of RHEL 8.1 (tested and still present in 8.2) I was working through the buildah tutorial 1 guide and installing bash and coreutil within the container's mount is not working.

https://github.com/containers/buildah/blob/master/docs/tutorials/01-intro.md

Version-Release number of selected component (if applicable):
rpm -q buildah -> buildah-1.14.9-1.module+el8.2.1+6689+748e6520.x86_64
cat /etc/redhat-release -> Red Hat Enterprise Linux release 8.2 (Ootpa)
uname -a -> Linux dev-0 4.18.0-193.14.3.el8_2.x86_64 #1 SMP Mon Jul 20 15:02:29 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

How reproducible: 100% of the time, every time


Steps to Reproduce:
1.sudo -s
2.newcontainer=$(buildah from scratch)
3.scratchmnt=$(buildah mount $newcontainer)
4.dnf install --installroot $scratchmnt --releasever 30 bash coreutils --setopt install_weak_deps=false -y

Actual results:

Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

You have enabled checking of packages via GPG keys. This is a good thing.
However, you do not have any GPG public keys installed. You need to download
the keys for packages you wish to install and install them.
You can do that by running the command:
    rpm --import public.gpg.key


Alternatively you can specify the url to the key you would like to use
for a repository in the 'gpgkey' option in a repository section and DNF
will install it for you.

For more information contact your distribution or package provider.

Problem repository: [brave-browser-rpm-release.s3.brave.com_x86_64_]
bandwidth: 0
baseurl: https://brave-browser-rpm-release.s3.brave.com/x86_64/
cachedir: /var/lib/containers/storage/overlay/aa62f3396de5ed056bd40bee1e098bec979bcd52cf73d9ccac946af2b0cbf184/merged/var/cache/dnf
cost: 1000
countme: 0
deltarpm: 1
deltarpm_percentage: 75
enabled: 1
enabled_metadata: 
enablegroups: 1
exclude: 
excludepkgs: 
fastestmirror: 0
gpgcheck: 1
gpgkey: 
includepkgs: 
ip_resolve: whatever
max_parallel_downloads: 3
mediaid: 
metadata_expire: 172800
metalink: 
minrate: 1000
mirrorlist: 
module_hotfixes: 0
name: created by dnf config-manager from https://brave-browser-rpm-release.s3.brave.com/x86_64/
password: 
priority: 99
protected_packages: dnf, dnf, redhat-release, systemd, systemd-udev, yum, sudo, dnf, redhat-release, systemd, systemd-udev, yum, sudo
proxy: 
proxy_auth_method: any
proxy_password: 
proxy_username: 
repo_gpgcheck: 0
retries: 10
skip_if_unavailable: 0
sslcacert: 
sslclientcert: 
sslclientkey: 
sslverify: 1
throttle: 0
timeout: 30
type: 
user_agent: libdnf (Red Hat Enterprise Linux 8.2; generic; Linux.x86_64)
username: 

Expected results:

expected it to install bash and coreutils within the buildah container's mount

Additional info:

request adoption of markdown in bugzilla

Comment 2 Rehana 2020-08-11 14:00:40 UTC
Hi , 

Thank you for opening the bug . 

Can you please refer this link to do the setup and let us if it is working. 

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/building_running_and_managing_containers/index

thanks,
Rehana

Comment 3 Tom Sweeney 2020-08-20 13:25:38 UTC
*** Bug 1870376 has been marked as a duplicate of this bug. ***

Comment 4 Tom Sweeney 2020-08-20 13:34:21 UTC
Rehana, I opened https://bugzilla.redhat.com/show_bug.cgi?id=1870376 last night, not realizing this one had already been started.  I've just closed that.  In that BZ:

"Additional info:  See Buildah issue with full information: https://github.com/containers/buildah/issues/1973.  If the commands above are run on any other Linux distribution it works.  If the target container was a RHEL based container, then I could accept the error, but it should not be erroring for other distributions such as Fedora, Alpine, Busybox, etc."

As noted, the container setup was correct.  The problem is trying to do `dnf install --installroot` into a container.  I could see a failure into a RHEL container, but I'm not sure about that, but it should NOT fail for any other Linux distribution.

Comment 5 Rehana 2020-08-21 14:49:25 UTC
Hi , 

Thanks for details . Can you please try disabling subscription-manager plugins ( /etc/dnf/plugins/subscription-manager.conf and /etc/dnf/plugins/product-id.conf ) before trying the installation of non RHEL contents. 

thanks,
Rehana

Comment 6 Tom Sweeney 2020-08-24 19:17:11 UTC
Rehana,

Just to make sure I disable it appropriately, can you supply me with the commands to do the disabling please?

Comment 7 Rehana 2020-08-25 13:38:41 UTC
(In reply to Tom Sweeney from comment #6)
> Rehana,
> 
> Just to make sure I disable it appropriately, can you supply me with the
> commands to do the disabling please?

Sure , Please open the files  /etc/dnf/plugins/subscription-manager.conf and /etc/dnf/plugins/product-id.conf and set "enabled" to 0. Also run `subscription-manager config --rhsm.auto_enable_yum_plugin=0`.

hope this helps .

thanks,
Rehana

Comment 8 Tom Sweeney 2020-08-25 20:53:34 UTC
Rehana,

The build fails after disabling, but this time with a different errror:

# subscription-manager config --rhsm.auto_enable_yum_plugin=0
# newcontainer=$(buildah from scratch)
# scratchmnt=$(buildah mount $newcontainer)
# dnf install --installroot $scratchmnt --releasever 30 bash coreutils --setopt install_weak_deps=false -y
Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)                                                       373  B/s | 259  B     00:00    
Failed to download metadata for repo 'rhel-8-for-x86_64-appstream-rpms'
Error: Failed to download metadata for repo 'rhel-8-for-x86_64-appstream-rpms'

Comment 9 Rehana 2020-08-28 15:08:20 UTC
(In reply to Tom Sweeney from comment #8)
> Rehana,
> 
> The build fails after disabling, but this time with a different errror:
> 
> # subscription-manager config --rhsm.auto_enable_yum_plugin=0
> # newcontainer=$(buildah from scratch)
> # scratchmnt=$(buildah mount $newcontainer)
> # dnf install --installroot $scratchmnt --releasever 30 bash coreutils
> --setopt install_weak_deps=false -y
> Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)                    
> 373  B/s | 259  B     00:00    
> Failed to download metadata for repo 'rhel-8-for-x86_64-appstream-rpms'
> Error: Failed to download metadata for repo
> 'rhel-8-for-x86_64-appstream-rpms'

Hi Tom,

Thanks for the details , we would like to understand the scenario better.Hence, I have setup a meeting on Monday( Aug 31) with Chris Snyder from our team to help clarify the issue. 

thanks,
Rehana

Comment 10 Tom Sweeney 2020-08-28 15:49:38 UTC
Hi Rehana,

Due to our differing timezones, the meeting you setup was for Sunday afternoon my time and I've other plans.  I'm on the East coast in the USA FWIW.  I've sent further details on suggested times in a private email and I'd like to get Dan Walsh into the meeting too if possible.

Comment 11 Rehana 2020-08-28 15:52:09 UTC
(In reply to Tom Sweeney from comment #10)
> Hi Rehana,
> 
> Due to our differing timezones, the meeting you setup was for Sunday
> afternoon my time and I've other plans.  I'm on the East coast in the USA
> FWIW.  I've sent further details on suggested times in a private email and
> I'd like to get Dan Walsh into the meeting too if possible.
Hi Tom, 

Sorry my bad , did not do the conversion well. Sure I will include Dan Walsh and set up a meeting in the requested time to discuss further . 

thanks,
REhana

Comment 12 Derrick Ornelas 2020-09-02 15:55:34 UTC
I had a chat with Tom, as I think there's just some confusion about the root cause of this issue.  I believe the original issue as reported is expected behavior.  It's not explicitly called out, but the upstream "Building a container from scratch" directions[1] are designed around using buildah on Fedora.  They expect that the host is some recent release of Fedora and that Fedora's dnf is being used.  

I think the question that needs to be asked is what is the end goal here?  Is the goal to build a RHEL container image from scratch or to build a Fedora 30 container image from scratch?  

As Rehana pointed out, building a RHEL container image from scratch is documented at https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/building_running_and_managing_containers/index#creating_images_from_scratch_with_buildah
This process works, but it requires that the '--releasever 30' option not be set, as a value of '30' is not valid for RHEL.  The default value of '8' will be used, unless otherwise specified.  

Building a Fedora container from scratch on RHEL would be a bit more tricky and would not be supported.  You would need to manually define all of the relevant Fedora repos (fedora, fedora-updates, etc.) on the RHEL system, then DNF would be able to access them.  


[1] https://github.com/containers/buildah/blob/master/docs/tutorials/01-intro.md#building-a-container-from-scratch

Comment 13 Tom Sweeney 2020-09-02 21:56:13 UTC
As Derrick noted, the issue is that dnf doesn't know what to install as you used a version (30) that RHEL's dnf is not aware of for itself.  If you pick a RHEL version for the --releaserver option it should work.  Or if you specify fedora instead of scratch in your first "from" command it works too:

```
# newcontainer=$(buildah from fedora)
Getting image source signatures
Copying blob c7def56d621e done
Copying config a368cbcfa6 done
Writing manifest to image destination
Storing signatures

# scratchmnt=$(buildah mount $newcontainer)

# dnf install --installroot $scratchmnt --releasever 30 bash coreutils --setopt install_weak_deps=false -y
Fedora 30 openh264 (From Cisco) - x86_64         10 kB/s | 5.1 kB     00:00    
Fedora Modular 30 - x86_64                      2.2 MB/s | 1.9 MB     00:00    
Fedora Modular 30 - x86_64 - Updates            836 kB/s | 3.6 MB     00:04    
Fedora 30 - x86_64 - Updates                    9.5 MB/s |  29 MB     00:03    
Fedora 30 - x86_64                              9.6 MB/s |  61 MB     00:06    
Package bash-5.0.17-1.fc32.x86_64 is already installed.
Package coreutils-8.32-4.fc32.1.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
```

Or change your original dnf command to specify a RHEL version:

```
# dnf install --installroot $scratchmnt --releasever 8.1 bash coreutils --setopt install_weak_deps=false -y
```
using a RHEL version and this will work too.

Comment 14 Tom Sweeney 2020-09-03 19:05:22 UTC
I've created https://github.com/containers/buildah/pull/2583 to clarify the dnf requirement within the tutorial.

Comment 15 Tom Sweeney 2020-09-17 21:45:08 UTC
As a follow up, the PR https://github.com/containers/buildah/pull/2583 to update the tutorial has been merged.

Comment 16 Red Hat Bugzilla 2023-09-15 00:46:15 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days