Bug 1308493 - DNF plugin can not temporarily enable repo from channel
DNF plugin can not temporarily enable repo from channel
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: dnf-plugin-spacewalk (Show other bugs)
rawhide
Unspecified Unspecified
urgent Severity unspecified
: ---
: ---
Assigned To: Michael Mráka
Fedora Extras Quality Assurance
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-15 06:51 EST by Lukáš Hellebrandt
Modified: 2017-12-21 08:22 EST (History)
6 users (show)

See Also:
Fixed In Version: dnf-plugin-spacewalk-2.7.6-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-12-21 08:22:49 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Lukáš Hellebrandt 2016-02-15 06:51:12 EST
Description of problem:
# dnf repolist
[...]
fish_fish     fish_fish     0
[...]
# dnf install whatever --disablerepo=* --enablerepo=fish_fish
Error: Unknown repo: 'fish_fish'

fish_fish is a channel in SW. It should be possible to temporarily disable all the repos except one certain repo in a manner shown above. Also, yum can do it.

How reproducible:
Deterministic

Steps to Reproduce:
1. In Spacewalk, create a channel, create an activation key, use a channel as a base channel of the AK
2. Register a system to the SW using created AK
3. dnf repolist , notice the repo is listed
4. dnf install whatever --disablerepo=* --enablerepo=<channel_name>

Actual results:
dnf complains the repo doesn't exist

Expected results:
yum does not, so I guess dnf shouldn't either
Comment 1 Pavel Studeník 2016-02-18 05:12:36 EST
I think that it is known problem bug 1236609.
Comment 2 Pavel Studeník 2016-02-18 05:34:15 EST
I suppose that it is the bug of dnf. dnf ends before call spacewalk plugin, because this channel isn't found in local repository. It is dependent on behavior of dnf.
Comment 3 Pavel Studeník 2016-05-02 11:44:56 EDT
Plugin spacewalk is not called by dnf. I added debug to this file.

/usr/lib/python3.4/site-packages/dnf-plugins/spacewalk.py

And the function _configure_repos ends with communicate with plugin.

> /usr/lib/python3.4/site-packages/dnf/cli/cli.py(1000)configure()
-> self._configure_repos(opts)
(Pdb) 
dnf.exceptions.RepoError: Unknown repo: 'fedora-23-x86_64'
Comment 4 Fedora End Of Life 2016-11-24 10:34:45 EST
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 5 Michael Mráka 2016-12-09 04:47:46 EST
Fixed in dnf
https://github.com/rpm-software-management/dnf/pull/680
Comment 6 Michael Mráka 2016-12-13 03:50:52 EST
https://github.com/rpm-software-management/dnf/pull/680 has been dropped.

Fixed in spacewalk
https://github.com/spacewalkproject/spacewalk/pull/495
Comment 7 Ales Dujicek 2017-04-07 08:11:36 EDT
with these changes rhn_check fails to run package install/remove actions

# rhn_check -vv
...
D: Sending back response((6,), 'Fatal error in Python code occurred', {})
D: do_call packages.checkNeedUpdate('rhnsd=1',){}
D: local action status: (0, 'rpm database not modified since last update (or package list recently updated)', {})
D: rpcServer: Calling XMLRPC registration.welcome_message
...


/var/log/up2date:
Traceback (most recent call last):
  File "/usr/sbin/rhn_check", line 381, in __run_action
    (status, message, data) = CheckCli.__do_call(method, params, kwargs)
  File "/usr/sbin/rhn_check", line 374, in __do_call
    retval = method(*params, **kwargs)
  File "/usr/share/rhn/actions/packages.py", line 74, in update
    base = _dnf_base(load_system_repo=True, load_available_repos=True)
  File "/usr/share/rhn/actions/packages.py", line 279, in _dnf_base
    plugin.activate_channels()
  File "/usr/lib/python3.5/site-packages/dnf-plugins/spacewalk.py", line 157, in activate_channels
    repos.add(repo)
  File "/usr/lib/python3.5/site-packages/dnf/repodict.py", line 34, in add
    raise ConfigError(msg % id_)
<class 'dnf.exceptions.ConfigError'>: Repository spacewalk-repo-sync-test-channel-9940 is listed more than once in the configuration


activate_channels is run in
Spacewalk.__init__ (client/rhel/dnf-plugin-spacewalk/spacewalk.py)
and again in
_dnf_base (client/rhel/dnf-plugin-spacewalk/actions/packages.py)
Comment 8 Michael Mráka 2017-05-26 09:16:27 EDT
Fixed in 
commit 54be8d152cacf158f0fda6b0ff28159c492bdf49
    1308493 - actually fix duplicated channel even for dnf 1.X
commit 0bd7c341951bd7ff17970f3adb26e5493c8e7663
    1308493 - fixed plugin initialization in dnf 2.X
Comment 9 Fedora End Of Life 2017-11-16 14:37:33 EST
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 25. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '25'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 25 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
Comment 10 Michael Mráka 2017-12-21 08:22:49 EST
Both Spacewalk 2.7 and Fedora 26+ now contain fixed version.

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