Bug 1505035 - dnf autocompletion wrong (seems to lag behind by one dnf transaction)
Summary: dnf autocompletion wrong (seems to lag behind by one dnf transaction)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 29
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Marek Blaha
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-10-21 10:00 UTC by Kostya Vasilyev
Modified: 2018-10-22 16:12 UTC (History)
6 users (show)

Fixed In Version: dnf-4.0.4-1.fc29
Clone Of:
Environment:
Last Closed: 2018-10-22 16:12:48 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Kostya Vasilyev 2017-10-21 10:00:16 UTC
Description of problem:

dnf's autocomplete (in bash) for "dnf remove" seems to lag benind by one transaction.

Seen with kernel-core today, twice, and a dnf clean all in between did not help.

I don't recall ever seeing this with Fedora 24-25, appears to be new with Fedora 26.

I'm going to include my command lines and output below, please compare the results of "rpm -qa" and "dnf list" vs. autocomplete results on "sudo dnf remove".


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

$ sudo rpm -qa | grep dnf
python3-dnf-plugin-system-upgrade-2.0.3-1.fc26.noarch
python3-dnf-2.7.5-1.fc26.noarch
python2-dnf-plugin-system-upgrade-2.0.3-1.fc26.noarch
dnf-2.7.5-1.fc26.noarch
python3-dnf-plugins-extras-common-2.0.3-1.fc26.noarch
libdnf-0.11.1-1.fc26.x86_64
dnf-yum-2.7.5-1.fc26.noarch
python2-dnf-plugins-extras-common-2.0.3-1.fc26.noarch
dnf-plugins-core-2.1.5-1.fc26.noarch
python2-dnf-2.7.5-1.fc26.noarch
dnf-conf-2.7.5-1.fc26.noarch
python3-dnf-plugins-core-2.1.5-1.fc26.noarch


How reproducible: Twice, including after dnf clean all


Steps to Reproduce:
1. I wanted to remove some kernel-core packages
2. dnf autoremove autocompleted with bogus (not currently installed) version numbers
3. After removing one of the versions with "dnf remove", the next attempt to autocomplete "dnf remove" gave wrong results again

Actual results:

dnf remove kernel-core <- autocomplete returns wrong (already uninstalled) version numbers

Expected results:

dnf remove kernel-core <- autocomplete returning only currently installed version numbers

Additional info:

$ rpm -qa | grep kernel-core
kernel-core-4.13.8-200.fc26.x86_64
kernel-core-4.13.6-200.fc26.x86_64
12:47 kman@fiona:~$ dnf list | grep kernel-core
kernel-core.x86_64                    4.13.6-200.fc26            @updates-testing
kernel-core.x86_64                    4.13.8-200.fc26            @updates-testing

^^^ Both rpm and dnf know the system has kernel-core 4.13.6 and 4.13.8

12:47 kman@fiona:~$ sudo dnf remove kernel-core-4.13.
kernel-core-4.13.5-200.fc26.x86_64  kernel-core-4.13.6-200.fc26.x86_64  kernel-core-4.13.8-200.fc26.x86_64

^^^ dnf remove autocompletes with 4.13.5 (not installed) 4.13.6 and 4.13.8

12:47 kman@fiona:~$ sudo dnf remove kernel-core-4.13.6-200.fc26.x86_64 
Dependencies resolved.
========================================================================================================================
 Package                           Arch                Version                      Repository                     Size
========================================================================================================================
Removing:
 kernel-core                       x86_64              4.13.6-200.fc26              @updates-testing               55 M
Removing dependent packages:
 kernel                            x86_64              4.13.6-200.fc26              @updates-testing                0  
 kernel-modules                    x86_64              4.13.6-200.fc26              @updates-testing               24 M
 kernel-modules-extra              x86_64              4.13.6-200.fc26              @updates-testing              2.0 M

Transaction Summary
========================================================================================================================
Remove  4 Packages

Freed space: 80 M
Is this ok [y/N]: y
...
Removed:
  kernel-core.x86_64 4.13.6-200.fc26            kernel.x86_64 4.13.6-200.fc26   kernel-modules.x86_64 4.13.6-200.fc26  
  kernel-modules-extra.x86_64 4.13.6-200.fc26  

Complete!

^^^ Removed 4.13.6

12:48 kman@fiona:~$ dnf list | grep kernel-core
kernel-core.x86_64                    4.13.8-200.fc26            @updates-testing
12:48 kman@fiona:~$ rpm -qa | grep kernel-core
kernel-core-4.13.8-200.fc26.x86_64

^^^ Both rpm and dnf list know that we now have: 4.13.8 only

12:48 kman@fiona:~$ sudo dnf remove kernel-core-4.13.
kernel-core-4.13.6-200.fc26.x86_64  kernel-core-4.13.8-200.fc26.x86_64  

^^^ dnf remove autocompletes with 4.13.6 (just uninstalled) and 4.13.8 (still installed, correct). Version 4.13.5 ("dangling" at previous step) is now gone.

Comment 1 Fedora End Of Life 2018-05-03 08:26:52 UTC
This message is a reminder that Fedora 26 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 26. 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 '26'.

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 26 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 2 Kostya Vasilyev 2018-05-04 11:20:15 UTC
Issue still exists in Fedora 28.

$ rpm -qa | grep dnf
python2-dnf-2.7.5-12.fc28.noarch
dnf-plugins-core-2.1.5-4.fc28.noarch
python2-dnf-plugins-extras-common-2.0.5-3.fc28.noarch
python3-dnf-plugins-core-2.1.5-4.fc28.noarch
dnf-2.7.5-12.fc28.noarch
python3-dnf-plugins-extras-common-2.0.5-3.fc28.noarch
python2-dnf-plugin-system-upgrade-2.0.5-3.fc28.noarch
python3-dnf-plugin-system-upgrade-2.0.5-3.fc28.noarch
dnf-conf-2.7.5-12.fc28.noarch
dnf-yum-2.7.5-12.fc28.noarch
python3-dnf-2.7.5-12.fc28.noarch
libdnf-0.11.1-3.fc28.x86_64

Comment 3 Marek Blaha 2018-05-07 07:34:36 UTC
PR https://github.com/rpm-software-management/dnf-plugins-core/pull/260 resolves the issue.

Comment 4 Jan Kurik 2018-08-14 11:15:27 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle.
Changing version to '29'.

Comment 5 Fedora Update System 2018-10-15 12:28:21 UTC
dnf-plugins-core-4.0.0-1.fc29 dnf-4.0.4-1.fc29 libdnf-0.22.0-1.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-2789f6b6e7

Comment 6 Fedora Update System 2018-10-15 18:22:52 UTC
dnf-4.0.4-1.fc29, dnf-plugins-core-4.0.0-1.fc29, libdnf-0.22.0-1.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-2789f6b6e7

Comment 7 Fedora Update System 2018-10-17 13:01:23 UTC
dnf-4.0.4-1.fc29 dnf-plugins-core-4.0.0-2.fc29 libdnf-0.22.0-2.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-2789f6b6e7

Comment 8 Fedora Update System 2018-10-17 23:30:25 UTC
dnf-4.0.4-1.fc29, dnf-plugins-core-4.0.0-2.fc29, libdnf-0.22.0-2.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-2789f6b6e7

Comment 9 Fedora Update System 2018-10-18 14:06:10 UTC
anaconda-29.24.6-1.fc29 dnf-4.0.4-1.fc29 dnf-plugins-core-4.0.0-2.fc29 libblockdev-2.20-2.fc29 libdnf-0.22.0-2.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-2789f6b6e7

Comment 10 Fedora Update System 2018-10-20 19:21:54 UTC
anaconda-29.24.7-1.fc29, dnf-4.0.4-1.fc29, dnf-plugins-core-4.0.0-2.fc29, libblockdev-2.20-2.fc29, libdnf-0.22.0-5.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-2789f6b6e7

Comment 11 Fedora Update System 2018-10-22 16:12:48 UTC
anaconda-29.24.7-1.fc29, dnf-4.0.4-1.fc29, dnf-plugins-core-4.0.0-2.fc29, libblockdev-2.20-2.fc29, libdnf-0.22.0-5.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, 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.