Bug 2308671 - crb enable fails with 'subscription-manager: error: no such option'
Summary: crb enable fails with 'subscription-manager: error: no such option'
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: epel-release
Version: epel9
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
Assignee: Troy Dawson
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-08-30 11:28 UTC by Miguel Martin
Modified: 2026-06-27 01:03 UTC (History)
6 users (show)

Fixed In Version: epel-release-10-8.el10_3 epel-release-10-8.el10_2 epel-release-9-11.el9
Clone Of:
Environment:
Last Closed: 2026-06-25 00:26:43 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Miguel Martin 2024-08-30 11:28:37 UTC
Description of problem:
Running crb enable fails with 'subscription-manager: error: no such option'

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

How reproducible:
Always

Steps to Reproduce:
1. Use a subscription where codeready-builder-for-rhel-9-x86_64-rhui-rpms is available
2. run 'crb enable'

Actual results:
crb enable fails with:
Enabling CRB repo
subscription-manager: error: no such option: codeready-builder-for-rhel-9-x86_64-rpms
CRB repo is enabled and named: codeready-builder-for-rhel-9-x86_64-rpms

Expected results:
CRB repository is enabled

Additional info:
It looks like 'crb' fails as it does not filter 'codeready-builder-for-rhel-9-x86_64-rhui-rpms' repo correctly

Comment 1 Troy Dawson 2024-08-30 13:23:56 UTC
You are correct, but I have no rhui machines to test on.
What do you get when you do


dnf repolist --all | grep -i -e crb -e powertools -e codeready

Comment 2 Miguel Martin 2024-08-30 13:58:28 UTC
codeready-builder-for-rhel-9-x86_64-debug-rpms                Red Hat C disabled
codeready-builder-for-rhel-9-x86_64-eus-debug-rpms            Red Hat C disabled
codeready-builder-for-rhel-9-x86_64-eus-rhui-debug-rpms       Red Hat C disabled
codeready-builder-for-rhel-9-x86_64-eus-rhui-rpms             Red Hat C disabled
codeready-builder-for-rhel-9-x86_64-eus-rhui-source-rpms      Red Hat C disabled
codeready-builder-for-rhel-9-x86_64-eus-rpms                  Red Hat C disabled
codeready-builder-for-rhel-9-x86_64-eus-source-rpms           Red Hat C disabled
codeready-builder-for-rhel-9-x86_64-rhui-debug-rpms           Red Hat C disabled
codeready-builder-for-rhel-9-x86_64-rhui-rpms                 Red Hat C disabled
codeready-builder-for-rhel-9-x86_64-rhui-source-rpms          Red Hat C disabled
codeready-builder-for-rhel-9-x86_64-rpms                      Red Hat C enabled
codeready-builder-for-rhel-9-x86_64-source-rpms               Red Hat C disabled

Comment 3 Miguel Martin 2024-08-30 13:59:48 UTC
I think you just need to add -e rhui to all the ocurrences of 'grep -v -i -e debug -e source -e eus -e virt'

Comment 4 Troy Dawson 2024-08-30 14:02:18 UTC
(In reply to Miguel Martin from comment #3)
> I think you just need to add -e rhui to all the ocurrences of 'grep -v -i -e
> debug -e source -e eus -e virt'

Yep
Simple enough fix.

Comment 5 Troy Dawson 2024-08-30 21:58:15 UTC
I'm not sure why this wasn't automatically updated, but here are the builds.
epel9: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2024-5e6d90ccde
epel8: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2024-6e5a4ffb91

Comment 6 Carl George 🎩 2024-11-27 23:16:33 UTC
On a RHUI connected system, shouldn't the preference be for codeready-builder-for-rhel-9-x86_64-rhui-rpms, not codeready-builder-for-rhel-9-x86_64-rpms?  I think you would only have the later on a RHUI system if there was a regular subscription on that system as well, which seems like a mistake.  The script is going to need a bit better logic than just always excluding repos with "rhui" in the repo ID.

Comment 7 Troy Dawson 2024-12-05 17:41:11 UTC
You have a good point.  Although excluding rhui still get's you crb enabled, it doesn't give you an efficient repo (one that is close to you.)

The error was happening because we have more than one item coming from our logic.  What if we fix that, and make it so the rhui line would be the prefered line.

We currently have

  crb_repo=$(dnf repolist | grep -i -e crb -e powertools -e codeready | grep -v -i -e debug -e source -e eus -e virt -e rhui | awk '{print $1}')

But if we switch it to this, it should give us what we want.

  crb_repo=$(dnf repolist | grep -i -e crb -e powertools -e codeready | grep -v -i -e debug -e source -e eus -e virt | awk '{print $1}' | head -n1)

"dnf repolist" gives the repo's sorted in an alphabetical order.  Thus 'codeready-builder-for-rhel-9-x86_64-rhui-rpms' will always be before 'codeready-builder-for-rhel-9-x86_64-rpms' and "head -n1" will give us the repo that we want.

If that sounds good, I'll get a pull request written up.

Comment 8 Carl George 🎩 2024-12-06 05:39:46 UTC
I am slightly worried long term about relying on an alphabetical sort because that seems fragile (for instance, if the id of the RHUI repos changes), but it would work for now until we get around to implementing more advanced logic.  Let's do it.  Drop a link to the PR here once you have it worked up and I'll try to review.

Comment 9 Robert Scheck 2026-05-26 16:57:35 UTC
Not sure where the output of comment #2 comes from, but on AWS it simply looks like this:

$ dnf repolist --all | grep -i -e crb -e powertools -e codeready
codeready-builder-for-rhel-9-rhui-debug-rpms  Red Hat CodeReady Linux B disabled
codeready-builder-for-rhel-9-rhui-rpms        Red Hat CodeReady Linux B disabled
codeready-builder-for-rhel-9-rhui-source-rpms Red Hat CodeReady Linux B disabled
$ 

That's why I am now proposing this merge request: https://src.fedoraproject.org/rpms/epel-release/pull-request/39

Comment 10 Robert Scheck 2026-06-10 16:34:14 UTC
Could you please review https://src.fedoraproject.org/rpms/epel-release/pull-request/39? Thank you.

Comment 11 Troy Dawson 2026-06-10 18:39:48 UTC
The pull request is basically just taking the "-e rhui" out of the "grep -v"
If what you show above, is what is happening, then yes, we need to do that.

Even if someone has the output in the earlier comment, they will still get the rhui repo, or at worst, the non-rhui repo.  Even the non-rhui repo is better than no repo.

Comment 12 Troy Dawson 2026-06-18 16:23:45 UTC
I have merged the merge requests.
I will check to see if there are any more expected changes to epel-release.
If there are expected changes, I'll wait until they come to get this built.
If there aren't any, I'm bump the release and build these.

Comment 13 Fedora Update System 2026-06-23 22:17:52 UTC
FEDORA-EPEL-2026-8f402ccbf4 (epel-release-10-8.el10_2) has been submitted as an update to Fedora EPEL 10.2.
https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2026-8f402ccbf4

Comment 14 Fedora Update System 2026-06-23 22:18:24 UTC
FEDORA-EPEL-2026-007628f1c3 (epel-release-10-8.el10_3) has been submitted as an update to Fedora EPEL 10.3.
https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2026-007628f1c3

Comment 15 Fedora Update System 2026-06-23 22:18:47 UTC
FEDORA-EPEL-2026-6247e08a96 (epel-release-9-11.el9) has been submitted as an update to Fedora EPEL 9.
https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2026-6247e08a96

Comment 16 Fedora Update System 2026-06-24 01:40:29 UTC
FEDORA-EPEL-2026-8f402ccbf4 has been pushed to the Fedora EPEL 10.2 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2026-8f402ccbf4

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 17 Fedora Update System 2026-06-24 01:41:06 UTC
FEDORA-EPEL-2026-007628f1c3 has been pushed to the Fedora EPEL 10.3 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2026-007628f1c3

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 18 Fedora Update System 2026-06-24 01:49:50 UTC
FEDORA-EPEL-2026-6247e08a96 has been pushed to the Fedora EPEL 9 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2026-6247e08a96

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 19 Fedora Update System 2026-06-25 00:26:43 UTC
FEDORA-EPEL-2026-007628f1c3 (epel-release-10-8.el10_3) has been pushed to the Fedora EPEL 10.3 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 20 Fedora Update System 2026-06-27 00:27:09 UTC
FEDORA-EPEL-2026-8f402ccbf4 (epel-release-10-8.el10_2) has been pushed to the Fedora EPEL 10.2 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 21 Fedora Update System 2026-06-27 01:03:45 UTC
FEDORA-EPEL-2026-6247e08a96 (epel-release-9-11.el9) has been pushed to the Fedora EPEL 9 stable repository.
If problem still persists, please make note of it in this bug report.


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