Home » The SnapAPI kernel module is not loaded for the kernel

The SnapAPI kernel module is not loaded for the kernel

by tuanlp

Issue

  • The backup storage cannot be activated (Acronis or CloudLinux backup) on the server due to the error:The SnapAPI kernel module is not loaded for the kernel 3.10.0-962.3.2.lve1.5.44.2.el7.x86_64 that is running in this system. Install the module for this kernel version, and then retry the backup.
  • In some cases we also can find a second error:Your kernel headers for kernel 4.18.0-147.8.1.el7h.lve.1.x86_64 cannot be found at
    /lib/modules/4.18.0-147.8.1.el7h.lve.1.x86_64/build or /lib/modules/4.18.0-147.8.1.el7h.lve.1.x86_64/source.
    You can use the –kernelsourcedir option to tell DKMS where it’s located.
  • Kernel versions may be different on different servers.
  • In general, if there will be issues with the absence of files besides headers, it is worth it to specify the kernelsourcedir manually, as uname -r may not always specify the path needed.
  • Occasionally, after compiling there might be execution issues while loading the module:modprobe snapapi26
    modprobe: ERROR: could not insert ‘snapapi26’: Exec format errorFor such a case, it may help to re-compile the module with the older version of the kernel, although it is recommended to fully update the kernel, reboot, and try again. 

Environment

  • Imunify360
  • CloudLinux Backup
  • Acronis
  • snapapi26

Solution

The module should be installed manually according to the following guide:

  1. Install headers, devel, and necessary packages (it is worth noting that packages should be installed for the version of the kernel that is running on the server, for which the module will be built):# yum install kernel-devel kernel-headers elfutils-libelf-devel
  2. Check the current SnapAPI version. The latest version installed on the server should be used. In this case, it is 0.8.4.# ls /usr/src
    file_protector-1.1-1485 snapapi26-0.7.135 snapapi26-0.7.142
    file_protector-1.1-1487 snapapi26-0.7.139 snapapi26-0.8.4
  3. Note: If the directory with the necessary version is missing, e.g.:Directory: /usr/src/snapapi26-0.8.8 does not exist.Unpack the archive as follows:
  4. # cd /usr/lib/Acronis/kernel_modules/
    # tar xvfz snapapi26-0.8.8-all.tar.gz
    # mkdir /usr/src/snapapi26-0.8.8
    # mv /usr/lib/Acronis/kernel_modules/dkms_source_tree/* /usr/src/snapapi26-0.8.8/
    # sed 's/REMAKE_INITRD/#REMAKE_INITRD/' -i /usr/src/snapapi26-0.8.8/dkms.conf
  5. Install and load the module manually:
  6. # dkms build -m snapapi26 -v 0.8.4 –config /boot/config-$(uname -r) –arch $(uname -p) –kernelsourcedir /usr/src/kernels/$(uname -r)
    # dkms install -m snapapi26 -v 0.8.4
    # modprobe snapapi26
    # systemctl restart acronis_mms
  7. If the following issue is received:

    # modprobe snapapi26
    modprobe: ERROR: could not insert 'snapapi26': Required key not available

    The culprit is likely the Secure Boot being enabled
    # mokutil --sb-state
    SecureBoot enabled

    Please, disable Secure boot, it can be done in the UEFI/BIOS. Please, note that to do that server reboot will be required. Your hosting provider should be able to help you with this task.

    Then run the following commands:

    modprobe snapapi26
    lsmod | grep snap
    acrocmd list disks
    systemctl restart acronis_mms
    acrocmd list disks
  8. Verify, that everything works as expected:# dkms status snapapi26 |grep installed
    snapapi26/0.8.4, 3.10.0-962.3.2.lve1.5.63.el7.x86_64, x86_64: installed

    # lsmod | grep snap
    snapapi26 50066 3

    # systemctl status acronis_mms
    ● acronis_mms.service – Acronis machine management service
    Loaded: loaded (/etc/systemd/system/acronis_mms.service; enabled; vendor preset: disabled)
    Active: active (running) since Tue 2021-12-23 10:40:52 -03; 8s ago
    Main PID: 923109 (mms)
    CGroup: /system.slice/acronis_mms.service
    └─923109 /usr/lib/Acronis/BackupAndRecovery/mms

    Dec 23 10:40:52 srv.wcorp53.com systemd[1]: Starting Acronis machine management service…
    Dec 23 10:40:52 srv.wcorp53.com systemd[1]: Started Acronis machine management service.

After that, the backup can be reactivated again.

Cause

The server does not have the header and devel packages for its current kernel version installed. This issue will be fixed from Acronis side in the future.

You may also like