CentOS7 Current kernel version does not match the kernel version for boot

i-Strategi

Member
Mar 14, 2016
13
1
3
Denmark
cPanel Access Level
Root Administrator
Twitter
Hi.

I have a cPanel server running on CentOS7.
When i run Security Advisor, i get the following message:
Current kernel version does not match the kernel version for boot. running kernel: 3.10.0-327.36.3.el7.x86_64, boot kernel:Reboot the system in the "Graceful Server Reboot" area. Check the boot configuration in grub.conf if the new kernel is not loaded after a reboot.

I have already performed a Graceful Server Reboot a couple of times with no success, i still get the message.

I have also tried running yum-update but all packages are up to date.

I noticed that you suggest checking the boot config in grub.conf - but after some Googling, i found out that no such file exists in CentOS7 (renamed and changed location) - im no expert on this area, this is why i need help.
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,237
463
Hello,

Could you verify the environment type and cPanel version for this server? You can check with these commands:

Code:
cat /var/cpanel/envtype
cat /usr/local/cpanel/version
Also, let us know the output from:

Code:
rpm -qa|grep kernel
uname -r
Thank you.
 

24x7server

Well-Known Member
Apr 17, 2013
1,911
97
78
India
cPanel Access Level
Root Administrator
Twitter
Hi,

I would like to add some more information to it. The server provider and the OS installed from their build also causes this issue where new kernel installation fails. Just check if the new kernel installation went well and that your grub.conf file has all the kernel listed in it that you are booting from.
 

i-Strategi

Member
Mar 14, 2016
13
1
3
Denmark
cPanel Access Level
Root Administrator
Twitter
Sorry for the late update.

Code:
cat /var/cpanel/envtype
cat /usr/local/cpanel/version
Returns:
11.60.0.31

Code:
rpm -qa|grep kernel
Returns:
kernel-3.10.0-327.el7.x86_64
kernel-tools-libs-3.10.0-514.2.2.el7.x86_64
kernel-3.10.0-327.36.3.el7.x86_64
kernel-tools-3.10.0-514.2.2.el7.x86_64
kernel-3.10.0-514.2.2.el7.x86_64
kernel-headers-3.10.0-514.2.2.el7.x86_64


Code:
uname -r
Returns:
3.10.0-514.2.2.el7.x86_64
 

i-Strategi

Member
Mar 14, 2016
13
1
3
Denmark
cPanel Access Level
Root Administrator
Twitter
Hi,

I would like to add some more information to it. The server provider and the OS installed from their build also causes this issue where new kernel installation fails. Just check if the new kernel installation went well and that your grub.conf file has all the kernel listed in it that you are booting from.
The OS is Centos 7

The server provider is Velia.net . I have other dedicated cPanel servers hosted there, but never encountered this issue before.

Hope this helps
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,237
463
Feel free to open a support ticket using the link in my signature so we can take a closer look. You can post the ticket number here so we can update this thread with the outcome.

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,237
463
A support ticket has been created.
The ID is: 8125655
Hello,

It looks like it was confirmed to be a false positive. We may have an internal case open to address this issue. Could you confirm if this system uses UEFI? You can check by verifying if the /boot/efi/EFI/centos/grub.cfg file exists:

Code:
ls /boot/efi/EFI/centos/grub.cfg
Thank you.
 

tomidjx

Member
Nov 14, 2013
5
0
51
cPanel Access Level
Root Administrator
Hi, I seems to have the same problem, and it keeps coming up every time I do install cpanel/WHM on a Centos server both 6 or 7.

cat /usr/local/cpanel/version => 11.64.0.36

rpm -qa|grep kernel =>
kernel-2.6.32-642.15.1.el6.x86_64
kernel-2.6.32-696.299.3.2.cp6.x86_64
dracut-kernel-004-409.el6_8.2.noarch
kernel-firmware-2.6.32-696.299.3.2.cp6.x86_64
kernel-2.6.32-642.el6.x86_64
kernel-headers-2.6.32-696.299.3.2.cp6.x86_64
kernel-2.6.32-696.6.3.el6.x86_64

uname -r => 4.9.36-x86_64-linode85

I've been trying to update kernel to no avail. Any help would be much appreciated.
Thanks
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,237
463
Hello @tomidjx,

Please post the output from the following command:

Code:
ls /boot/efi/EFI/centos/grub.cfg
Thank you.
 

Routes

Member
Aug 5, 2016
14
1
3
Austria
cPanel Access Level
Root Administrator
Hi,

this has nothing to do with EFI, there is some other bug you have in there. For some reason you store information anywhere which kernel you expect and this is not handled correctly after a kernel update.
As I updated from 3.10.0-514.2.2.el7.x86_64 to 3.10.0-514.26.2.el7.x86_64 I also get the message now
Current kernel version does not match the kernel version for boot. running kernel: 3.10.0-514.26.2.el7.x86_64, boot kernel: 3.10.0-514.2.2.el7.x86_64
Why do you expect the older ...514.2.2.... kernel to run?

The 514.26 kernel is running smoothly and everything works like expected but WHM wants a server reboot which will never choose the 514.2.2 kernel as I updated the default to 514.26, so what to do about that? I have NO EFI boot

[[email protected] log]# cat /var/cpanel/envtype
kvm
[[email protected] log]# cat /usr/local/cpanel/version
11.64.0.36
[[email protected] log]# rpm -qa | grep kernel
kernel-tools-3.10.0-514.26.2.el7.x86_64
kernel-3.10.0-327.el7.x86_64
kernel-3.10.0-514.2.2.el7.x86_64
kernel-tools-libs-3.10.0-514.26.2.el7.x86_64
kernel-3.10.0-514.26.2.el7.x86_64
kernel-headers-3.10.0-514.26.2.el7.x86_64
kernel-3.10.0-327.36.3.el7.x86_64

So the question is where do you store the information which kernel YOU expect? Because this is senseless as I want to run the kernel I want to run...
 

Routes

Member
Aug 5, 2016
14
1
3
Austria
cPanel Access Level
Root Administrator
For all : Please check with
grub2-editenv list
if the actual kernel you want to run is set as default
if not set the corresponding grub menuentry with grub2-set-default
this removed the wrong error message for me.
Somehow cPanel seems to check the running kernel against the default set one and is not updating this information correctly when installing a new kernel, so if you set a default entry on your own in /etc/default/grub without using saved in GRUB_DEFAULT and setting the correct one with grub2-set-default you get an error message
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,237
463
Somehow cPanel seems to check the running kernel against the default set one and is not updating this information correctly when installing a new kernel, so if you set a default entry on your own in /etc/default/grub without using saved in GRUB_DEFAULT and setting the correct one with grub2-set-default you get an error message
Hello,

Internal case CPANEL-14702 is open to address this particular issue. I'll monitor the case and update this thread with more information as it becomes available. In the meantime, the workaround is to manually set the latest kernel version using the "grub2-set-default" command and then run the "/scripts/rpmup" command. EX:

Code:
grub2-set-default $kernel-version
/scripts/rpmup
Replace "$kernel-version" with the most recent kernel version that you booted the server into.

Thank you.