Bug 1727882
Summary: | yum-config-manager cannot update repos on RHEL8 | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 8 | Reporter: | Aleksandar Kostadinov <akostadi> |
Component: | yum | Assignee: | Jaroslav Rohel <jrohel> |
Status: | CLOSED ERRATA | QA Contact: | Jan Blazek <jblazek> |
Severity: | unspecified | Docs Contact: | |
Priority: | medium | ||
Version: | 8.4 | CC: | james.antill, jrohel, ksrot, nsella, pkratoch, sgraf |
Target Milestone: | rc | Keywords: | Reopened, Triaged |
Target Release: | 8.0 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | dnf-4.2.23-1.el8 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2020-11-04 01:52:20 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
Aleksandar Kostadinov
2019-07-08 12:51:23 UTC
This is not a bug. Please look into the man page. "man yum-config-manager" "--set-enabled" and "--set-disabled" must be used instead of "--enablerepo" and "--disablerepo". Example from man page: dnf config-manager --set-enabled <repoid> it can be executed by this too: yum-config-manager --set-enabled <repoid> Running a command with unsupported flag and command doesn't fail can't be anything but a bug. If flag is not supported, then command should return a non-zero exit status and some human readable error message that flag is unknown or has been replaced or whatever. A flag missing from documentation, especially such that has worked in previous releases doesn't mean anything and no user should be expected to re-read the man page and take note what has been removed from man pages. It is very common that man pages are incomplete. On the other hand, the two flags are shown in `yum-config-manager --help`. So there is no excuse that it is documented. But even if `--help` did not show the flags, then it would still be an obvious bug in my book. Is it not? Won't it cost much less time for everybody to get a couple of lines of code from the tool removed instead of losing time with arguments? Hi Aleksandar, --enablerepo cannot simply fail with an error as it is valid dnf option. Unlike in RHEL-7, in RHEL-8 config-manager is implemented as a yum/dnf plugin which means that many options are shared/reserved with/by yum itself. You are probably aware of 'yum --enablerepo=myrepo install foo'. Well, this is exactly the --enablerepo you are trying to use. This conflict is unfortunate, however I am afraid there is no perfect solution. What would you consider to be a appropriate _fix_ here? One idea that comes to my mind is to print a warning mentioning the difference when yum-config-manager (the wrapper, not yum config-manager) itself is called with --enablerepo/--disablerepo options. Hmm, thank you for the explanation. I couldn't realize how `--enablerepo` can be a valid option and couldn't see how bug can be closed. Excuse me for strong words. In this situation issue seems to be that `yum-config-manager` and `dnf config-manager` commands exit with zero status without any actionable instruction given to them. I think that if no actionable instruction has been given, then command should write something to the user and exit non-zero. > $ sudo yum-config-manager > Updating Subscription Management repositories. > $ echo $? > 0 > $ sudo dnf config-manager > Updating Subscription Management repositories. > $ echo $? > 0 e.g. with `install` > $ sudo dnf install > ... > dnf install: error: the following arguments are required: PACKAGE > $ echo $? > 2 Do you think that can be changed? Hi Aleksandar, > A flag missing from documentation, especially such that has worked in previous releases Are you sure that the flag is working in previous release? I looked to documentation of old "man yum-config-manager" (used in RHEL7, Centos 7, and old Fedoras). There were documented only "--enable" and "--disable". --enable Enable the specified repos (automatically saves). To enable all repositories run "yum-config-manager --enable \*". --disable Disable the specified repos (automatically saves). To disable all repositories run "yum-config-manager --disable \*". I looked to documentation of new (DNF based plugin) "man yum-config-manager" (used in RHEL8, new Fedoras). --set-disabled, --disable Disable the specified repos (automatically saves). --set-enabled, --enable Enable the specified repos (automatically saves). So DNF implementation accepts new options "--set-disabled, --set-enabled" and also supports old "--enable" and "--disable". But none of implementations (that I tested) supports "--enablerepo" and "--disablerepo". And both implementation of "config-manager" do nothing with these options (and no error is generated). So new DNF based implementation is compatible with old one. > On the other hand, the two flags are shown in `yum-config-manager --help`. So there is no excuse that it is documented. Yes you are right. That is not nice. We can look on the problem but I am not sure about its solving now. The solution will not be simple. As Karel wrote. The "config manager" is a DNF plugin now. So, it starts DNF and DNF accepts all global DNF arguments. A lot of them have no meaning for the config-manager plugin. Eg. "--enablerepos" is accepted by DNF but is not used for "config-manager". We can try change behavior of the "config-manager" plugin and add support for "--enablerepo" and "--disablerepo". Or we can add warning if these options were used. But a lot of other DNF arguments are useless and they can't be easily removed from plugin. (In reply to Aleksandar Kostadinov from comment #4) > In this situation issue seems to be that `yum-config-manager` and `dnf > config-manager` commands exit with zero status without any actionable > instruction given to them. We did file another bug 1706384 that would actually make that command line valid. I tried to reply earlier but had some network issues and I now noticed my reply is not here.
I'm not sure how I came up with `--enablerepo`. I tried to migrate a rhel7 dockerfile to rhel8. And because I had subscription issues perhaps I thought my command line option is incorrect and looked at `yum-config-manager --enablerepo`.
If `dump` is made the default probably it will be easier to spot something is not working as expected. But very important in my opinion is to fix `--help`.
> 🐚 yum-config-manager --help
> usage: yum-config-manager config-manager [-c [config file]] [-q] [-v]
> ...
> --assumeno automatically answer no for all questions
> --enablerepo [repo]
> -x [package], --exclude [package], --excludepkgs [package]
> ...
As you can see there is no help text for the `--enablerepo` option. I think adding such info will help a lot. After adding help text I guess there's nothing much that can be done more.
Thank you again!
PR: https://github.com/rpm-software-management/dnf/pull/1621 PR: https://github.com/rpm-software-management/dnf-plugins-core/pull/396 Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (yum bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2020:4510 |