Bug 2186721 - /usr/bin/crb does not work as intended
Summary: /usr/bin/crb does not work as intended
Keywords:
Status: CLOSED ERRATA
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: 2023-04-14 08:37 UTC by Anand Buddhdev
Modified: 2023-04-26 03:45 UTC (History)
5 users (show)

Fixed In Version: epel-release-9-5.el9 epel-release-8-19.el8
Clone Of:
Environment:
Last Closed: 2023-04-23 00:41:55 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Anand Buddhdev 2023-04-14 08:37:42 UTC
Description of problem:

The "crb" script provided by this package does not work as intended.

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

epel-release-9-4.el9.noarch

How reproducible:

Always

Steps to Reproduce:
1. Run "crb enable"
2.
3.

Actual results:

# crb enable
Enabling CRB repo
/usr/bin/crb: line 47: subscription-manager: command not found
CRB repo is disabled

Expected results:

The codeready repo should have been enabled.

Additional info:

Similarly to the "enable" command, the "disable" does not work either. On non-redhat systems, the "subscription-manager" command should not be called. The logic inside the enable_disable_repo() function is broken.

Comment 1 Troy Dawson 2023-04-14 13:31:03 UTC
We need to know what operating system you are running, and what dnf repos are available for you.

Can you send the following information:
  cat /etc/redhat-release
  rpm -qf /etc/redhat-release
  dnf repolist --all

Comment 2 Anand Buddhdev 2023-04-14 13:52:23 UTC
[root@s9test ~]# cat /etc/redhat-release
Red Hat Enterprise Linux release 9.1 (Plow)

[root@s9test ~]# rpm -qf /etc/redhat-release
oraclelinux-release-9.1-1.0.6.el9.x86_64

[root@s9test ~]# dnf repolist --all
repo id                                               repo name                                                                                         status
epel                                                  Extra Packages for Enterprise Linux 9 - x86_64                                                    enabled
epel-debuginfo                                        Extra Packages for Enterprise Linux 9 - x86_64 - Debug                                            disabled
epel-source                                           Extra Packages for Enterprise Linux 9 - x86_64 - Source                                           disabled
epel-testing                                          Extra Packages for Enterprise Linux 9 - Testing - x86_64                                          disabled
epel-testing-debuginfo                                Extra Packages for Enterprise Linux 9 - Testing - x86_64 - Debug                                  disabled
epel-testing-source                                   Extra Packages for Enterprise Linux 9 - Testing - x86_64 - Source                                 disabled
mysql-community                                       mysql community repo                                                                              enabled
nodesource                                            Node.js Packages for Enterprise Linux 9 - x86_64                                                  enabled
nodesource-source                                     Node.js for Enterprise Linux 9 - x86_64 - Source                                                  disabled
ol9_MODRHCK                                           Latest RHCK with fixes from Oracle for Oracle Linux 9 (x86_64)                                    disabled
ol9_RDMA                                              Oracle Linux 9 (x86_64) RDMA                                                                      disabled
ol9_UEKR7                                             Oracle Linux 9 UEK Release 7 (x86_64)                                                             enabled
ol9_addons                                            Oracle Linux 9 Addons (x86_64)                                                                    disabled
ol9_appstream                                         Oracle Linux 9 Application Stream Packages (x86_64)                                               enabled
ol9_baseos_latest                                     Oracle Linux 9 BaseOS Latest (x86_64)                                                             enabled
ol9_codeready_builder                                 Oracle Linux 9 CodeReady Builder (x86_64) - (Unsupported)                                         disabled
ol9_developer_EPEL                                    Oracle Linux 9 EPEL Packages for Development (x86_64)                                             enabled
ol9_distro_builder                                    Oracle Linux 9 Distro Builder (x86_64) - (Unsupported)                                            disabled
ol9_kvm_utils                                         Oracle Linux 9 KVM Utilities (x86_64)                                                             disabled
ol9_u0_baseos_base                                    Oracle Linux 9 BaseOS GA (x86_64)                                                                 disabled
ol9_u1_baseos_base                                    Oracle Linux 9.1 BaseOS (x86_64)                                                                  disabled

[root@s9test ~]# crb enable
Enabling CRB repo
/usr/bin/crb: line 47: subscription-manager: command not found
CRB repo is disabled

Comment 3 Troy Dawson 2023-04-14 15:02:46 UTC
Thank You.
I hadn't tested Oracle Linux, and indeed, there is a bug in the code.
I'm going to work on a fix.
For a temporary work around do:
  dnf config-manager enable ol9_codeready_builder
or
  dnf config-manager disable ol9_codeready_builder

Comment 4 Anand Buddhdev 2023-04-14 18:42:52 UTC
I'm already using "dnf config-manager" for now. However, I want to write an ansible task that works the same on Oracle Linux, Rocky Linux and Alma Linux, and I prefer to use "crb".

As I mentioned, the logic in the enable_disable_repo() function seems wrong, because it's running subscription-manager unconditionally.

Comment 5 Fedora Update System 2023-04-14 22:09:33 UTC
FEDORA-EPEL-2023-7f7fbecec2 has been submitted as an update to Fedora EPEL 9. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2023-7f7fbecec2

Comment 6 Troy Dawson 2023-04-14 22:13:15 UTC
It wasn't running subscription-manager unconditionally.  It is only running it when the dnf repo has the word codeready in it.
Looking back, that was sortof a silly way to tell if something was running RHEL or not.
I have a new script that is looking in /etc/os-release, where it should have been looking originally.
This new script has been tested on Alma, Rocky, Oracle, Stream, RHEL and EuroLinux.

Comment 7 Fedora Update System 2023-04-15 03:40:53 UTC
FEDORA-EPEL-2023-7f7fbecec2 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-2023-7f7fbecec2

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

Comment 8 Anand Buddhdev 2023-04-15 07:50:26 UTC
Thanks for the swift update, Troy!

I downloaded the latest build to an Oracle Linux 9 system and tried the "crb" script. Now it works correctly!

Comment 9 Troy Dawson 2023-04-17 13:16:19 UTC
Thank you for the verification.

Comment 10 Fedora Update System 2023-04-17 13:32:14 UTC
FEDORA-EPEL-2023-dde49fb620 has been submitted as an update to Fedora EPEL 8. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2023-dde49fb620

Comment 11 Fedora Update System 2023-04-18 02:55:28 UTC
FEDORA-EPEL-2023-dde49fb620 has been pushed to the Fedora EPEL 8 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2023-dde49fb620

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

Comment 12 Fedora Update System 2023-04-23 00:41:55 UTC
FEDORA-EPEL-2023-7f7fbecec2 has been pushed to the Fedora EPEL 9 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 13 Fedora Update System 2023-04-26 03:45:16 UTC
FEDORA-EPEL-2023-dde49fb620 has been pushed to the Fedora EPEL 8 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.