Bug 1239274 - dnf history does not show command line
dnf history does not show command line
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: dnf (Show other bugs)
23
All Linux
medium Severity medium
: ---
: ---
Assigned To: packaging-team-maint
Fedora Extras Quality Assurance
: Patch, Reopened
: 1279237 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-07-05 04:21 EDT by Vít Ondruch
Modified: 2016-03-05 12:02 EST (History)
27 users (show)

See Also:
Fixed In Version: dnf-1.1.6 dnf-1.1.6-1.fc23 dnf-1.1.6-2.fc22
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-02-16 23:22:56 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)
dnf history info error (12.68 KB, text/plain)
2016-01-28 13:47 EST, fulminemizzega
no flags Details

  None (edit)
Description Vít Ondruch 2015-07-05 04:21:55 EDT
Description of problem:

Command line is not show anymore:

$ sudo dnf history list
Last metadata expiration check performed 2:38:02 ago on Sun Jul  5 07:38:58 2015.
ID     | Command line             | Date a | Action | Altere
-------------------------------------------------------------------------------
   135 |                          | 2015-07-05 10:16 | Erase          |    7   
   134 |                          | 2015-07-05 10:11 | Install        |    4   

... snip ...

    46 |                          | 2015-03-01 01:01 | I, U           |    3 ><
    45 | update -x kernel* -x gdm | 2015-03-01 00:43 | I, U           |  463 ><
    44 | update gnome* --refresh  | 2015-03-01 00:22 | Update         |   12 > 


Version-Release number of selected component (if applicable):
$ rpm -q dnf
dnf-1.0.1-3.fc23.noarch


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:
Command line is not shown


Expected results:
Command line is sown


Additional info:
Comment 1 Honza Silhan 2015-07-07 11:12:38 EDT

*** This bug has been marked as a duplicate of bug 1218401 ***
Comment 2 Vít Ondruch 2015-07-07 11:29:27 EDT
Sorry, but I don't understand why it should be duplicate of bug 1218401. My history cleanly shows "Command line" column, but only the older commands are stored/displayed for some reason.
Comment 3 Jan Kurik 2015-07-15 09:50:33 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 23 development cycle.
Changing version to '23'.

(As we did not run this process for some time, it could affect also pre-Fedora 23 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 23 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora23
Comment 4 Honza Silhan 2015-07-29 09:02:53 EDT
Can the migrate plugin, the history part be on the blame?
Comment 5 Michael Mráka 2015-08-12 09:06:08 EDT
I can see the same issue on my test server. All transactions with missing commandline has been done with dnf. And all migrated transactions have commandline visible.

So no, that isn't migration plugin's fault ;).
Comment 6 Alexander Safonov 2015-11-07 12:58:21 EST
I can confirm this bug on my fresh Fedora 23 install

dnf version:

[asafonov@localhost ~]$ dnf --version
1.1.3
  Installed: dnf-0:1.1.3-1.fc23.noarch at 2015-10-29 21:22
  Built    : Fedora Project at 2015-10-14 16:54

  Installed: rpm-0:4.13.0-0.rc1.3.fc23.x86_64 at 2015-10-29 21:22
  Built    : Fedora Project at 2015-09-07 16:01

dnf history list result:

[asafonov@localhost ~]$ sudo dnf history list
[sudo] password for asafonov:
Last metadata expiration check performed 2:14:55 ago on Sat Nov  7 18:42:30 2015.
ID     | Command line             | Date a | Action | Altere
-------------------------------------------------------------------------------
    13 |                          | 2015-11-06 23:25 | Install        |   14
    12 |                          | 2015-11-05 12:04 | Install        |    2
    11 |                          | 2015-11-05 00:08 | Install        |  101
    10 |                          | 2015-11-04 23:57 | Install        |    3
     9 |                          | 2015-11-04 23:54 | Install        |   22
     8 |                          | 2015-11-04 23:51 | Install        |    3
     7 |                          | 2015-11-04 23:46 | Install        |    1
     6 |                          | 2015-11-04 23:42 | Install        |    2
     5 |                          | 2015-11-04 23:37 | Install        |    1
     4 |                          | 2015-11-04 23:33 | Install        |  103 EE
     3 |                          | 2015-11-04 23:28 | I, U           |   55
     2 |                          | 2015-11-04 23:15 | Install        |   12
     1 |                          | 2015-11-04 23:14 | Install        |    6


As you can see, command line column filled with empty value
Comment 7 Igor Gnatenko 2015-11-08 11:25:30 EST
I can confirm this. It's not migrates plugin bug.
Comment 8 Mike Goodwin 2015-11-09 19:08:01 EST
I can confirm this as well. All blank command line history is directly after my "--releasever=23 system-upgrade" line. This is a regression, plain and simple.
Comment 9 Vinicius Reis 2015-11-09 21:49:15 EST
I have this very same issue on a fresh Fedora 23 install.
Comment 10 Michal Luscon 2015-11-18 07:45:14 EST
*** Bug 1279237 has been marked as a duplicate of this bug. ***
Comment 11 Ting-Wei Lan 2015-11-22 07:34:02 EST
I think it is a bug of dnf-3. Transactions made by dnf-2 have correct command line values. I remember that this bug also happens on Fedora 22. F22 dnf is dnf-2 and F23 dnf is dnf-3, so some users don't find this problem on F22.
Comment 12 fulminemizzega 2015-11-23 04:59:59 EST
Same here, after upgrading from F22 to F23, this is my dnf history:

[...]
   101 |                          | 2015-11-23 10:33 | Install        |    4   
   100 |                          | 2015-11-22 18:48 | Install        |    1   
    99 |                          | 2015-11-22 17:25 | Erase          |    1   
    98 |                          | 2015-11-22 17:22 | Install        |    1   
    97 |                          | 2015-11-22 17:17 | Install        |    1  <
    96 |                          | 2015-11-22 17:13 | Erase          |    1 > 
    95 |                          | 2015-11-22 15:50 | Install        |    1   
    94 |                          | 2015-11-22 15:50 | Erase          |   14   
    93 |                          | 2015-11-22 15:49 | Erase          |    1   
    92 | --releasever=23 system-u | 2015-11-22 15:22 | D, E, I, O, U  | 2569 EE
    91 | install dnf-plugin-syste | 2015-11-22 04:28 | Install        |    2   

[...]
Comment 13 Daniele Viganò 2015-11-25 05:51:08 EST
Same here, on both a F22 upgraded system and on a fresh F23:

1.1.4
  Installed: dnf-0:1.1.4-1.fc23.noarch at 2015-11-19 20:12
  Built    : Fedora Project at 2015-11-16 15:28

  Installed: rpm-0:4.13.0-0.rc1.7.fc23.x86_64 at 2015-11-25 09:07
  Built    : Fedora Project at 2015-11-20 13:08
Comment 14 Ting-Wei Lan 2015-12-16 01:28:27 EST
I wrote a simple patch to fix the problem:

--- /usr/lib/python3.4/site-packages/dnf/cli/main.py.old        2015-12-16 06:14:32.344055533 +0000
+++ /usr/lib/python3.4/site-packages/dnf/cli/main.py    2015-12-16 06:15:13.361906825 +0000
@@ -90,7 +90,7 @@
     # do our cli parsing and config file setup
     # also sanity check the things being passed on the cli
     try:
-        cli.configure(map(ucd, args))
+        cli.configure(list(map(ucd, args)))
         cli.check()
     except dnf.exceptions.LockError:
         raise


It works on both Fedora 22 and Fedora 23. The problem is that map() returns a list on python2 but returns a map object on python3, so if python3 version of dnf is used, which is the default on Fedora >= 23, the map object holding command line arguments becomes empty after it is used by the option parser.
Comment 15 srakitnican 2015-12-17 12:56:33 EST
Patch works for me, new actions are being logged now

ID     | Command line             | Date a | Action | Altere
-------------------------------------------------------------------------------
   110 | update                   | 2015-12-17 18:46 | E, I, U        |  218 EE
   109 |                          | 2015-12-15 20:48 | Erase          |    1   
   108 |                          | 2015-12-15 20:43 | Install        |    1
Comment 16 Daniele Viganò 2015-12-18 10:21:13 EST
Works for me too
Comment 17 Vinicius Reis 2015-12-19 00:32:22 EST
Patch in comment #14 works for me.
New dnf command line arguments are being logged now.

ID     | Linha de comando         | Data e | Ação(õ | Altera
-------------------------------------------------------------------------------
    37 | remove nano              | 2015-12-19 03:27 | Erase          |    1   
    36 |                          | 2015-12-19 03:08 | E, I, U        |   83   
    35 |                          | 2015-12-17 18:11 | I, U           |  107
Comment 18 Kamil Páral 2016-01-04 03:57:45 EST
Hey dnf folks, could we please push the patch, or is something else needed?
Comment 19 Martin Mézl 2016-01-06 09:40:57 EST
(In reply to Ting-Wei Lan from comment #14)
> I wrote a simple patch to fix the problem:
> 
> --- /usr/lib/python3.4/site-packages/dnf/cli/main.py.old        2015-12-16
> 06:14:32.344055533 +0000
> +++ /usr/lib/python3.4/site-packages/dnf/cli/main.py    2015-12-16
> 06:15:13.361906825 +0000
> @@ -90,7 +90,7 @@
>      # do our cli parsing and config file setup
>      # also sanity check the things being passed on the cli
>      try:
> -        cli.configure(map(ucd, args))
> +        cli.configure(list(map(ucd, args)))
>          cli.check()
>      except dnf.exceptions.LockError:
>          raise
> 
> 
> It works on both Fedora 22 and Fedora 23. The problem is that map() returns
> a list on python2 but returns a map object on python3, so if python3 version
> of dnf is used, which is the default on Fedora >= 23, the map object holding
> command line arguments becomes empty after it is used by the option parser.

The patch works for me too. Thank you.
Comment 20 Mike Goodwin 2016-01-07 11:13:39 EST
Looks like fix is waiting to be merged here: https://github.com/rpm-software-management/dnf/pull/424
Comment 21 srakitnican 2016-01-07 12:13:12 EST
It seems like dnf folks does not exist, at least on this bugzilla :p
Comment 22 Honza Silhan 2016-01-07 12:29:24 EST
PR was merged, thanks. 

semiRocket, you're right. I am sorry but we haven't noticed it. Doing a pull request [1] can get your patch into the upstream (faster).

[1] https://github.com/rpm-software-management/dnf#contribution
Comment 23 Fedora Update System 2016-01-26 05:34:09 EST
dnf-plugins-core-0.1.16-1.fc23 dnf-1.1.6-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-80cbf309b4
Comment 24 Fedora Update System 2016-01-26 05:35:30 EST
dnf-plugins-core-0.1.16-1.fc22 dnf-1.1.6-1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-573eba7b37
Comment 25 Fedora Update System 2016-01-26 14:52:33 EST
dnf-1.1.6-1.fc23, dnf-plugins-core-0.1.16-1.fc23 has been pushed to the Fedora 23 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-2016-80cbf309b4
Comment 26 Fedora Update System 2016-01-28 13:19:51 EST
dnf-1.1.6-1.fc23, dnf-plugins-core-0.1.16-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.
Comment 27 fulminemizzega 2016-01-28 13:46:59 EST
Hello,
I installed dnf-1.1.6-1.fc23 update and the issue with dnf history is solved, now command line is correctly populated, but I encountered another error with dnf history info, you can see in attachment dnf.log.
Comment 28 fulminemizzega 2016-01-28 13:47 EST
Created attachment 1119228 [details]
dnf history info error
Comment 29 Fedora Update System 2016-01-28 18:19:11 EST
dnf-1.1.6-1.fc22, dnf-plugins-core-0.1.16-1.fc22 has been pushed to the Fedora 22 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-2016-573eba7b37
Comment 30 Kamil Páral 2016-01-29 04:22:00 EST
(In reply to fulminemizzega from comment #27)
> Hello,
> I installed dnf-1.1.6-1.fc23 update and the issue with dnf history is
> solved, now command line is correctly populated, but I encountered another
> error with dnf history info, you can see in attachment dnf.log.

Please always file a separate report for separate issues. In this case, you don't have to, it's already reported as bug 1302510.
Comment 31 Fedora Update System 2016-02-03 08:06:11 EST
dnf-1.1.6-2.fc22 dnf-plugins-core-0.1.16-1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-573eba7b37
Comment 32 Fedora Update System 2016-02-03 18:26:41 EST
dnf-1.1.6-2.fc22, dnf-plugins-core-0.1.16-1.fc22 has been pushed to the Fedora 22 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-2016-573eba7b37
Comment 33 Fedora Update System 2016-02-16 23:22:01 EST
dnf-1.1.6-2.fc22, dnf-plugins-core-0.1.16-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.
Comment 34 Sudhir Khanger 2016-03-05 09:31:24 EST
Is the older history gone permanently? Commandline column is properly populated on recent transactions but older ones are empty. As you can see anything below transaction 242 is missing.

$ rpm -qa | grep dnf
dnf-conf-1.1.6-2.fc23.noarch
python3-dnf-plugins-extras-common-0.0.12-1.fc23.noarch
python3-dnf-1.1.6-2.fc23.noarch
dnf-yum-1.1.6-2.fc23.noarch
python3-dnf-plugins-core-0.1.16-1.fc23.noarch
python3-dnf-plugins-extras-tracer-0.0.12-1.fc23.noarch
dnf-1.1.6-2.fc23.noarch
python3-dnf-langpacks-0.15.1-1.fc23.noarch
dnf-plugins-core-0.1.16-1.fc23.noarch
dnf-langpacks-0.15.1-1.fc23.noarch
dnf-langpacks-conf-0.15.1-1.fc23.noarch

  252 | update -y                | 2016-02-05 15:28 | Update         |   56 EE
   251 | update -y                | 2016-02-04 19:43 | Update         |    5   
   250 | install libao.i686       | 2016-02-04 15:27 | Install        |    1   
   249 | -y install --disablerepo | 2016-02-02 21:53 | Install        |    1   
   248 | -y install --disablerepo | 2016-02-02 21:52 | Install        |    1   
   247 | -y install --disablerepo | 2016-02-02 21:52 | Install        |    1   
   246 | update                   | 2016-02-02 21:49 | E, I, U        |   51 EE
   245 | update -y                | 2016-02-01 00:37 | Update         |   87   
   244 | update -y                | 2016-01-30 22:42 | Update         |    4   
   243 | history undo last        | 2016-01-29 22:22 | Erase          |   16   
   242 | install hugin            | 2016-01-29 21:19 | Install        |   16   
   241 |                          | 2016-01-29 11:50 | Update         |   53   
   240 |                          | 2016-01-28 16:50 | Update         |    4 EE
   239 |                          | 2016-01-28 00:23 | Update         |    1 EE
   238 |                          | 2016-01-28 00:09 | Update         |    1   
   237 |                          | 2016-01-28 00:08 | Install        |    1   
   236 |                          | 2016-01-28 00:08 | Install        |    1   
   235 |                          | 2016-01-28 00:08 | Install        |    1   
   234 |                          | 2016-01-28 00:04 | E, I, U        |   27 EE
   233 |                          | 2016-01-25 22:11 | I, U           |   27
Comment 35 srakitnican 2016-03-05 12:02:46 EST
Yes, dnf did not log any command line until bug was fixed.

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