Bug 1087534 - [kernel] tries to remove booted kernel
Summary: [kernel] tries to remove booted kernel
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: hawkey
Version: 20
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Ales Kozumplik
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-04-14 14:38 UTC by Lukas Slebodnik
Modified: 2014-09-30 23:42 UTC (History)
7 users (show)

Fixed In Version: dnf-plugins-core-0.0.8-2.fc20
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-01 00:00:04 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
testcase.t (1.96 KB, application/x-perl)
2014-04-15 07:07 UTC, Lukas Slebodnik
no flags Details
solver.result (838 bytes, text/plain)
2014-04-15 07:08 UTC, Lukas Slebodnik
no flags Details
testcase.t (2.07 KB, application/x-perl)
2014-05-15 07:31 UTC, Lukas Slebodnik
no flags Details
solver.result (1.24 KB, text/plain)
2014-05-15 07:33 UTC, Lukas Slebodnik
no flags Details
output from yum (4.42 KB, text/plain)
2014-05-15 11:25 UTC, Lukas Slebodnik
no flags Details

Description Lukas Slebodnik 2014-04-14 14:38:53 UTC
Description of problem:
I tried to update fedora 20 with dnf and dnf wanted to remove running kernel. After this upgrade, it would be impossible to hibernate and restore my system.

Removing:
 kernel                        x86_64    3.13.6-200.fc20       @System    133 M


Version-Release number of selected component (if applicable):
sh-4.2# rpm -q dnf
dnf-0.4.19-1.fc20.noarch

Steps to Reproduce:
1. Install few versions of kernel versions should be installed
sh-4.2# rpm -qa | grep kernel-3
kernel-3.13.8-200.fc20.x86_64
kernel-3.13.7-200.fc20.x86_64
kernel-3.13.6-200.fc20.x86_64

New version of kernel should be available in repositories
  (kernel-3.13.9-200.fc20.x86_64) 

2. booted(running) kernel should be the oldest one
sh-4.2# uname -r
3.13.6-200.fc20.x86_64

3. update kernel packages with dnf
dnf update kernel*


Actual results:
sh-4.2# dnf update kernel*
Resolving dependencies
--> Starting dependency resolution
---> Package kernel-debug.x86_64 3.13.9-200.fc20 will be installed
---> Package kernel.x86_64 3.13.9-200.fc20 will be installed
---> Package kernel-modules-extra.x86_64 3.13.9-200.fc20 will be installed
---> Package kernel-debug-modules-extra.x86_64 3.13.9-200.fc20 will be installed
---> Package kernel-devel.x86_64 3.13.8-200.fc20 will be upgraded
---> Package kernel-devel.x86_64 3.13.9-200.fc20 will be an upgrade
---> Package kernel-headers.x86_64 3.13.8-200.fc20 will be upgraded
---> Package kernel-headers.x86_64 3.13.9-200.fc20 will be an upgrade
---> Package kernel-tools.x86_64 3.13.8-200.fc20 will be upgraded
---> Package kernel-tools.x86_64 3.13.9-200.fc20 will be an upgrade
---> Package kernel-tools-libs.x86_64 3.13.8-200.fc20 will be upgraded
---> Package kernel-tools-libs.x86_64 3.13.9-200.fc20 will be an upgrade
---> Package kernel.x86_64 3.13.6-200.fc20 will be erased
---> Package kernel-debug.x86_64 3.13.7-200.fc20 will be erased
---> Package kernel-debug-modules-extra.x86_64 3.13.7-200.fc20 will be erased
---> Package kernel-modules-extra.x86_64 3.13.6-200.fc20 will be erased
--> Finished dependency resolution
Dependencies resolved.

================================================================================
 Package                       Arch      Version               Repository  Size
================================================================================
Installing:
 kernel-debug                  x86_64    3.13.9-200.fc20       updates     33 M
 kernel                        x86_64    3.13.9-200.fc20       updates     31 M
 kernel-modules-extra          x86_64    3.13.9-200.fc20       updates    2.0 M
 kernel-debug-modules-extra    x86_64    3.13.9-200.fc20       updates    2.2 M
Upgrading:
 kernel-devel                  x86_64    3.13.9-200.fc20       updates    8.6 M
 kernel-headers                x86_64    3.13.9-200.fc20       updates    929 k
 kernel-tools                  x86_64    3.13.9-200.fc20       updates    137 k
 kernel-tools-libs             x86_64    3.13.9-200.fc20       updates     65 k
Removing:
 kernel                        x86_64    3.13.6-200.fc20       @System    133 M
 kernel-debug                  x86_64    3.13.7-200.fc20       @System    140 M
 kernel-debug-modules-extra    x86_64    3.13.7-200.fc20       @System    8.9 M
 kernel-modules-extra          x86_64    3.13.6-200.fc20       @System    8.1 M

Transaction Summary
================================================================================
Install  4 Packages
Upgrade  4 Packages
Remove   4 Packages

Total download size: 77 M
Is this ok [y/N]: N
Exiting on user Command


Expected results: the same results as from yum.
sh-4.2# yum update kernel*
Loaded plugins: auto-update-debuginfo, langpacks
Resolving Dependencies
--> Running transaction check
---> Package kernel.x86_64 0:3.13.9-200.fc20 will be installed
---> Package kernel-debug.x86_64 0:3.13.9-200.fc20 will be installed
---> Package kernel-debug-modules-extra.x86_64 0:3.13.9-200.fc20 will be installed
---> Package kernel-devel.x86_64 0:3.13.9-200.fc20 will be installed
---> Package kernel-headers.x86_64 0:3.13.8-200.fc20 will be updated
---> Package kernel-headers.x86_64 0:3.13.9-200.fc20 will be an update
---> Package kernel-modules-extra.x86_64 0:3.13.9-200.fc20 will be installed
---> Package kernel-tools.x86_64 0:3.13.8-200.fc20 will be updated
---> Package kernel-tools.x86_64 0:3.13.9-200.fc20 will be an update
---> Package kernel-tools-libs.x86_64 0:3.13.8-200.fc20 will be updated
---> Package kernel-tools-libs.x86_64 0:3.13.9-200.fc20 will be an update
--> Finished Dependency Resolution
--> Running transaction check
---> Package kernel.x86_64 0:3.13.7-200.fc20 will be erased
---> Package kernel-debug.x86_64 0:3.13.7-200.fc20 will be erased
---> Package kernel-debug-modules-extra.x86_64 0:3.13.7-200.fc20 will be erased
---> Package kernel-modules-extra.x86_64 0:3.13.7-200.fc20 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                       Arch      Version             Repository    Size
================================================================================
Installing:
 kernel                        x86_64    3.13.9-200.fc20     updates       31 M
 kernel-debug                  x86_64    3.13.9-200.fc20     updates       33 M
 kernel-debug-modules-extra    x86_64    3.13.9-200.fc20     updates      2.2 M
 kernel-devel                  x86_64    3.13.9-200.fc20     updates      8.6 M
 kernel-modules-extra          x86_64    3.13.9-200.fc20     updates      2.0 M
Updating:
 kernel-headers                x86_64    3.13.9-200.fc20     updates      929 k
 kernel-tools                  x86_64    3.13.9-200.fc20     updates      137 k
 kernel-tools-libs             x86_64    3.13.9-200.fc20     updates       65 k
Removing:
 kernel                        x86_64    3.13.7-200.fc20     installed    133 M
 kernel-debug                  x86_64    3.13.7-200.fc20     installed    140 M
 kernel-debug-modules-extra    x86_64    3.13.7-200.fc20     installed    8.9 M
 kernel-modules-extra          x86_64    3.13.7-200.fc20     installed    8.1 M

Transaction Summary
================================================================================
Install  5 Packages
Upgrade  3 Packages
Remove   4 Packages

Total download size: 77 M
Is this ok [y/d/N]: N
Exiting on user command
Your transaction was saved, rerun it with:
 yum load-transaction /tmp/yum_save_tx.2014-04-14.16-36.DpKbeH.yumtx


Additional info:
I can provide additional info

Comment 1 Ales Kozumplik 2014-04-15 06:47:57 UTC
Lukas, can you please attach depsolving data [1] for the described case? Thanks!

[1] http://dnf.baseurl.org/2013/11/25/reporting-depsolving-bugs/

Comment 2 Lukas Slebodnik 2014-04-15 07:07:27 UTC
Created attachment 886366 [details]
testcase.t

Comment 3 Lukas Slebodnik 2014-04-15 07:08:55 UTC
Created attachment 886367 [details]
solver.result

Full debugdata report is here:
http://lslebodn.fedorapeople.org/dnf_debug_data_BZ1087534/debugdata.tar

Comment 4 Ales Kozumplik 2014-05-12 09:41:53 UTC
When I locally feed the data you provided to hawkey and resolve, I get the expected outcome (i.e. 3.13.6 stays installed). It is however possible we are missing something during the running kernel detection. In hawkey upstream commit a87f0e9 I've added logging of this. I'd like to ask you, once hawkey-0.4.16 or any reaches you and you witness the bug again, please provide the debugdata again, along with /var/cache/dnf/x86_64/hawkey.log file. 

Thanks for your help!

Comment 5 Lukas Slebodnik 2014-05-12 20:53:31 UTC
I will try to provide data on Wednesday or on Thursday.

Comment 6 Lukas Slebodnik 2014-05-14 21:00:41 UTC
I prepare rpms from hawkey git repo. The latest commit has the hash 42a33f151

[root@host ~]# rpm -q hawkey python-hawkey dnf
hawkey-0.4.15-0.42a33f151.fc20.x86_64
python-hawkey-0.4.15-0.42a33f151.fc20.x86_64
dnf-0.4.20-1.fc20.noarch

dnf want to upgrade packages and also remove booted kernel.
But I was not able to run dnf with argument "--debugsolver"

[root@host ~]# dnf --debugsolver upgrade
Resolving dependencies
--> Starting dependency resolution
Traceback (most recent call last):
  File "/bin/dnf", line 35, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 242, in user_main
    errcode = main(args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 75, in main
    return _main(base, args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 140, in _main
    got_transaction = base.resolve()
  File "/usr/lib/python2.7/site-packages/dnf/base.py", line 550, in resolve
    if not self.run_hawkey_goal(goal):
  File "/usr/lib/python2.7/site-packages/dnf/base.py", line 538, in run_hawkey_goal
    goal.write_debugdata()
TypeError: write_debugdata() takes exactly one argument (0 given)


The same result is with dnf from updates-testing
dnf-0.5.1-1.fc20.noarch

BTW argument "--debugsolver" is not documented in manual page dnf

It will be better if you prepare scratch build for me.

Comment 7 Ales Kozumplik 2014-05-15 07:14:47 UTC
Lukas, you can either wait for an F20 release or use our CI repo: http://jenkins.cloud.fedoraproject.org/job/DNF/lastSuccessfulBuild/artifact/

Comment 8 Ales Kozumplik 2014-05-15 07:19:59 UTC
Documented '--debugsolver' in beb6d03.

Comment 9 Lukas Slebodnik 2014-05-15 07:31:58 UTC
Created attachment 895785 [details]
testcase.t

Comment 10 Lukas Slebodnik 2014-05-15 07:33:02 UTC
Created attachment 895788 [details]
solver.result

Comment 11 Lukas Slebodnik 2014-05-15 07:37:30 UTC
[root@host ~]# rpm -q dnf hawkey libcomps librepo python-hawkey python-libcomps python-librepo

dnf-0.5.1-99.719.20140513gitf75c389.fc20.noarch
hawkey-0.4.15-99.719.20140513git42a33f1.fc20.x86_64
libcomps-0.1.6-99.719.20140513gite8c2d8315b1d10e35461450235dac9da267ecb2d.fc20.x86_64
librepo-1.7.3-99.719.20140513git5585ff7.fc20.x86_64
python-hawkey-0.4.15-99.719.20140513git42a33f1.fc20.x86_64
python-libcomps-0.1.6-99.719.20140513gite8c2d8315b1d10e35461450235dac9da267ecb2d.fc20.x86_64
python-librepo-1.7.3-99.719.20140513git5585ff7.fc20.x86_64

Full debug data:
http://lslebodn.fedorapeople.org/dnf_debug_data_BZ1087534/debugdata_v2.tar
http://lslebodn.fedorapeople.org/dnf_debug_data_BZ1087534/hawkey.log

Comment 12 Ales Kozumplik 2014-05-15 11:00:21 UTC
Here's what I see. You're running kernel-debug-3.13.6:

INFO May-15 09:26:31 running_kernel(): kernel-debug-3.13.6-200.fc20.x86_64.

And the proposed transaction deletes:

kernel-debug-3.13.10
kernel-debug-3.13.7
kernel-debug-3.13.8

and their respective kernel-debug-modules-extra packages. It installs:

kernel-debug-3.14.3

and its respective kernel-debug-moduels-extra.

Most importantly, it keeps around kernel-debug-3.13.6 and its corresponding modules-extra. So I guess there's nothing wrong going on here, won't you agree?

Comment 13 Lukas Slebodnik 2014-05-15 11:20:17 UTC
And this is what I can see

[root@host ~]# dnf update
Dependencies resolved.

================================================================================
 Package                       Arch      Version               Repository  Size
================================================================================
Installing:
 kernel-debug                  x86_64    3.14.3-200.fc20       updates     33 M
 kernel                        x86_64    3.14.3-200.fc20       updates     32 M
 kernel-modules-extra          x86_64    3.14.3-200.fc20       updates    2.1 M
 kernel-debug-modules-extra    x86_64    3.14.3-200.fc20       updates    2.2 M
Upgrading:
 kernel-devel                  x86_64    3.14.3-200.fc20       updates    8.7 M
 kernel-headers                x86_64    3.14.3-200.fc20       updates    946 k
 kernel-tools                  x86_64    3.14.3-200.fc20       updates    141 k
 kernel-tools-libs             x86_64    3.14.3-200.fc20       updates     68 k
Removing:
 kernel                        x86_64    3.13.6-200.fc20       @System    133 M
 kernel                        x86_64    3.13.7-200.fc20       @System    133 M
 kernel                        x86_64    3.13.8-200.fc20       @System    133 M
 kernel-debug                  x86_64    3.13.7-200.fc20       @System    140 M
 kernel-debug                  x86_64    3.13.8-200.fc20       @System    140 M
 kernel-debug                  x86_64    3.13.10-200.fc20      @System    140 M
 kernel-debug-modules-extra    x86_64    3.13.7-200.fc20       @System    8.9 M
 kernel-debug-modules-extra    x86_64    3.13.8-200.fc20       @System    8.9 M
 kernel-debug-modules-extra    x86_64    3.13.10-200.fc20      @System    8.9 M
 kernel-modules-extra          x86_64    3.13.6-200.fc20       @System    8.1 M
 kernel-modules-extra          x86_64    3.13.7-200.fc20       @System    8.1 M
 kernel-modules-extra          x86_64    3.13.8-200.fc20       @System    8.1 M

Transaction Summary
================================================================================
Install   4 Packages
Upgrade   4 Packages
Remove   12 Packages

Total download size: 79 M
Is this ok [y/N]: N
Exiting on user Command

[root@host ~]# uname -a
Linux host 3.13.6-200.fc20.x86_64 #1 SMP Fri Mar 7 17:02:28 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

If you want I can test another packages with extra debug messages.

Comment 14 Ales Kozumplik 2014-05-15 11:23:00 UTC
I think that's exactly the correct behavior. What does 'cat /proc/cmdline' output?

Comment 15 Lukas Slebodnik 2014-05-15 11:25:53 UTC
Created attachment 895846 [details]
output from yum

I am providing output from yum and it is related to 1087534#c13

Comment 16 Lukas Slebodnik 2014-05-15 11:28:24 UTC
[root@host ~]# cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-3.13.6-200.fc20.x86_64 root=/dev/mapper/fedora_18-root ro rd.lvm.lv=fedora_18/swap rd.md=0 rd.dm=0 rd.luks.uuid=luks-51de39ac-7a57-45e8-981c-3a804e0d04bf vconsole.keymap=us rd.lvm.lv=fedora_18/root rhgb quiet LANG=en_US.UTF-8

I am sorry, but I am not sure what is correct on removing booted kernel.
yum do not want to remove kernel 3.13.6-200.fc20 and dnf *will*.

Comment 17 Ales Kozumplik 2014-05-15 11:47:04 UTC
(In reply to Lukas Slebodnik from comment #16)
> [root@host ~]# cat /proc/cmdline
> BOOT_IMAGE=/vmlinuz-3.13.6-200.fc20.x86_64 root=/dev/mapper/fedora_18-root
> ro rd.lvm.lv=fedora_18/swap rd.md=0 rd.dm=0
> rd.luks.uuid=luks-51de39ac-7a57-45e8-981c-3a804e0d04bf vconsole.keymap=us
> rd.lvm.lv=fedora_18/root rhgb quiet LANG=en_US.UTF-8

You're right I see what is going on now. We are incorrectly detecting the user is running a debug kernel.

Comment 18 Lukas Slebodnik 2014-05-15 11:55:05 UTC
If you want I can try to reboot to the debug kernel to confirm your assumption.

Comment 19 Ales Kozumplik 2014-05-15 16:08:17 UTC
Fixed upstream by c5e6501, you can retest using the CI build once it finishes.

Comment 20 Lukas Slebodnik 2014-05-15 19:22:15 UTC
Thank you very much for fix. It works as expected.

But I have found another issue. It can be related to this BZ. I am not sure.
If I try to remove single package (e.g. augeas-devel), dnf tries to automatically remove old kernels. Yum wants to remove just a single package.
Should I file another BZ?

Comment 21 Fedora Update System 2014-05-28 12:11:23 UTC
dnf-plugins-core-0.0.8-2.fc20, libsolv-0.6.1-1.git6d968f1.fc20, hawkey-0.4.16-1.fc20, dnf-0.5.2-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/libsolv-0.6.1-1.git6d968f1.fc20,hawkey-0.4.16-1.fc20,dnf-0.5.2-1.fc20,dnf-plugins-core-0.0.8-2.fc20

Comment 22 Fedora Update System 2014-05-28 23:51:24 UTC
Package dnf-plugins-core-0.0.8-2.fc20, libsolv-0.6.1-1.git6d968f1.fc20, hawkey-0.4.16-1.fc20, dnf-0.5.2-1.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing dnf-plugins-core-0.0.8-2.fc20 libsolv-0.6.1-1.git6d968f1.fc20 hawkey-0.4.16-1.fc20 dnf-0.5.2-1.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-6789/libsolv-0.6.1-1.git6d968f1.fc20,hawkey-0.4.16-1.fc20,dnf-0.5.2-1.fc20,dnf-plugins-core-0.0.8-2.fc20
then log in and leave karma (feedback).

Comment 23 Fedora Update System 2014-06-01 00:00:04 UTC
dnf-plugins-core-0.0.8-2.fc20, libsolv-0.6.1-1.git6d968f1.fc20, hawkey-0.4.16-1.fc20, dnf-0.5.2-1.fc20 has been pushed to the Fedora 20 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.