Failed to upgrade Microsoft KEK CA in Discover

I got Microsoft KEK CA upgradation recently in KDE Discover on my ThinkCentre M75n computer.

The error message is failed to write-firmware: failed to write (null): failed to write data to efivarsfs: Error writing to file descriptor: Invalid argument

I don’t know whether it’s related to disk encryption, I enabled it while installing F42. And there is no related dmesg error reported.

1 Like

Similar here, Lenovo P330 “Tiny”

$ sudo fwupdmgr update         
╔══════════════════════════════════════════════════════════════════════════════╗
║ Upgrade KEK CA from 2011 to 2023?                                            ║
╠══════════════════════════════════════════════════════════════════════════════╣
║ This updates the UEFI Signature Database (the "KEK") to the latest release   ║
║ from Microsoft, signed by LENOVO.                                            ║
║                                                                              ║
║ KEK CA and all connected devices may not be usable while updating.           ║
╚══════════════════════════════════════════════════════════════════════════════╝
Perform operation? [Y|n]: Y
Writing…                 [*****                                  ]
failed to write-firmware: failed to write (null): failed to write data to efivarsfs: Error writing to file descriptor: Invalid argument

Exact same error on a Dell XPS 9560

Exact same issue here - also with a Dell XPS 15 9560.

Same issue here, Dell XPS 9360.

Same issue on an Acer Predator Helios 300. It’s several years old.

╔══════════════════════════════════════════════════════════════════════════════╗
║ Upgrade KEK CA from 2011 to 2023?                                            ║
╠══════════════════════════════════════════════════════════════════════════════╣
║ This updates the UEFI Signature Database (the "KEK") to the latest release   ║
║ from Microsoft, signed by db Manufacture20150617.                            ║
║                                                                              ║
╚══════════════════════════════════════════════════════════════════════════════╝
Perform operation? [Y|n]: y
Writing…                 [******************************         ]
failed to write-firmware: failed to write (null): failed to write data to efivarsfs: Error writing to file descriptor: Invalid argument

In my case uefi update resolved the issue. I guess there was not enough space in uefi memory (or whatever it’s called) and uefi update made room for KEK CA update. Maybe restoring that memory to factory state would also help.
My laptop: Asus ZenBook UX482EA.

I was having this problem on a Lenovo ThinkCentre m700 mini PC. It has been notifying me for weeks, and I only just resolved it. I’m updating this thread because it is much more focused than some of the other discussions I found.

After lots of digging around, including inspecting

$ fwupdmgr get-devices

I discovered my /sys/firmware/efi/efivarfs was 97% full, according to

$ df -h

I read threads about picking individual items that one might prune from the efivarfs, but I am not familiar enough with them to know what to prune. Fortunately a quick workaround is to reset the UEFI keys.

I used System Settings → Desktop Session to restart and reboot into the UEFI setup screen.

I chose to reset the UEFI to factory keys. (The screen flickered for quite a few seconds.) Then I saved the settings, and rebooted.

The efivarfs showed much more room available.

I kicked off updates in Discover again, and KDE now showed two firmware updates, which installed quickly and successfully.

I hope this helps someone (including future me).