Bug 2341771 - crb enable tries to enable ubi repo with subscription manager but it will not have it
Summary: crb enable tries to enable ubi repo with subscription manager but it will not...
Keywords:
Status: NEW
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: epel-release
Version: epel9
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Troy Dawson
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-01-23 16:24 UTC by Ulrik Haugen
Modified: 2025-01-24 11:54 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Ulrik Haugen 2025-01-23 16:24:23 UTC
Description of problem:
When running in a container built from registry.access.redhat.com/ubi9 with subscription manager `crb enable` will look for the crb repo with `dnf repolist --all` but that will:

a) produce a list of more than one item
b) include a repo that can not be enabled with subscription-manager enable

This results in crb

Version-Release number of selected component (if applicable):
# rpm -q epel-release
epel-release-9-9.el9.noarch


How reproducible:
always

Steps to Reproduce:
1. podman run --rm -it registry.access.redhat.com/ubi9
2. subscription-manager register --org=redacted --activationkey=redacted
3. dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
4. crb enable

Actual results:

    # crb enable
    Enabling CRB repo
    subscription-manager: error: no such option: ubi-9-codeready-builder-rpms
    CRB repo is enabled and named: ubi-9-codeready-builder-rpms

but the crb repo i hoped to enable is not enabled.

Expected results:

No error message from subscription manager and codeready-builder-for-rhel-9-x86_64-rpms was enabled.


Additional info:
I propose listing candidate repos with `subscription-manager repos --list` on rhel.

Compare:

    # dnf repolist --all| grep -i -e codeready -e crb -e powertools| grep -v -i -e debug -e source -e eus -e virt -e rhui| cut -d' ' -f1
    codeready-builder-for-rhel-9-x86_64-rpms
    ubi-9-codeready-builder-rpms
    # subscription-manager repos --list \
        | grep -i repo.id \
        | cut -d: -f2- \
        | tr -d ' '\
        | grep -i -e crb -e codeready -e powertools \
        | grep -v -i -e debug -e source -e eus -e virt -e rhui
    codeready-builder-for-rhel-9-x86_64-rpms

And also see:
    # dnf repolist --all| grep -i -e codeready -e crb -e powertools| grep -v -i -e debug -e source -e eus -e virt -e rhui| cut -d' ' -f1| xargs -n1 subscription-manager repos --enable
    Repository 'codeready-builder-for-rhel-9-x86_64-rpms' is enabled for this system.
    Error: 'ubi-9-codeready-builder-rpms' does not match a valid repository ID. Use "subscription-manager repos --list" to see valid repositories.

As far as i can tell the crb commands in epel8 and epel10 are the same, if this bug results in any changes i would be very happy if they could make it into those branches too.

Finally, thank you very much for the crb command! With Red hat now changing the name of the code ready builder repo every other week i hope to get a lot of mileage from it.

Comment 1 Troy Dawson 2025-01-23 20:45:44 UTC
Thank you for the detailed info.

There is another complication to this.
In your example, it looks like you are running this ubi container in a non-RHEL environment.  Thus you needed to "subscription-manager register --org=redacted --activationkey=redacted"
But if you run the container on a registered RHEL system you get the following.

# subscription-manager register --org=redacted --activationkey=redacted
subscription-manager is operating in container mode. Use your host system to manage subscriptions.
# subscription-manager repos --list
subscription-manager is operating in container mode. Use your host system to manage subscriptions.

That doesn't mean we can't try to fix it, just that we need to accommodate both ways of running a UBI container.

Comment 2 Ulrik Haugen 2025-01-24 11:54:57 UTC
Of course, i probably should have realised subscription manager would not be appeased that easily.

The tests i did for this bug report were on a Debian system so everything is as you say, in the environment i hope to put this to use the host used to be an el system but not registered so subscription manager said the same thing until i:

    rm -f /etc/rhsm-host
    rm -f /etc/pki/entitlement-host

Not that that would be of any use for crb.

The admin for the container hosts tells me that they are registered these days so i will try to get around to some further testing...


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