Bug 1709547 - Boot fails when password file in crypttab can't be read
Summary: Boot fails when password file in crypttab can't be read
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 30
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-05-13 19:02 UTC by Ben Cotton
Modified: 2020-02-21 01:17 UTC (History)
7 users (show)

Fixed In Version: systemd-241-14.git18dd3fb.fc30
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-02-21 01:17:37 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Ben Cotton 2019-05-13 19:02:09 UTC
Description of problem:
Boot fails and drops to emergency mode if the file specified for an encrypted volume cannot be read. This is a change in behavior from Fedora 29 (although booting the F29 kernel in F30 userspace works as expected). The relevant message appears to be:

[    6.343786] fpgm systemd-cryptsetup[654]: Failed to open key file.
[    6.343809] fpgm systemd-cryptsetup[654]: Failed to activate with key file '/boot/luks_keys': Invalid argument

When I change the field to `-` in order to prompt for a password and then rebuild the initramfs, it boots as expected.

I think this is fixed by upstream PR 11805 (https://github.com/systemd/systemd/pull/11805), which is included in version 242. 

Version-Release number of selected component (if applicable):
systemd-241-8.git9ef65cb.fc30.x86_64

I'm not sure if the failure to open the file is new, or if it has never worked. I didn't see any related error messages on a successful boot with that key file still in place.

Comment 1 Steeve McCauley 2019-05-21 16:38:15 UTC
I finally discovered this over the weekend after much experimentation and gnashing of teeth.  I could still boot on the Fedora 29 kernel, but all of the Fedora 30 kernels failed to boot with the systemd-cryptsetup error "Failed to activate with key file ... Invalid argument".

I have two luks encrypted devices defined in /etc/crypttab, both were setup by gnome disks with plain-text passwords stored in /etc/luks-keys.  The root filesystem containing /etc is encrypted on disk UUID=ea56bffa-c0f1-49df-a68c-c7370cf7d146, so I changed its password reference in crypttab to "none" and it now boots after prompting for that password.

   luks-ea56bffa-c0f1-49df-a68c-c7370cf7d146 UUID=ea56bffa-c0f1-49df-a68c-c7370cf7d146 none luks
   luks-8d4ee900-a98f-47a3-84f8-e13906caac91 UUID=8d4ee900-a98f-47a3-84f8-e13906caac91 /etc/luks-keys/luks-8d4ee900-a98f-47a3-84f8-e13906caac91 luks

I don't know if it was necessary, but I also rebuilt the initramfs file,

   cd /boot
   dracut -f initramfs-5.0.11-300.fc30.x86_64.img 5.0.11-300.fc30.x86_64

and reinstalled grub2 efi,

   grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

Comment 2 jesse 2019-06-09 16:17:03 UTC
I experienced this same issue. After an upgrade to Fedora 30 I was unable to boot using the Fedora 30 kernels. The Fedora 29 kernel would still boot.

The steps outlined in Comment #1 fixed the issue for me.

Comment 3 Zbigniew Jędrzejewski-Szmek 2019-11-22 12:57:53 UTC
Please set status==POST if there's an upstream patch (or even PR). This makes it easier to see
stuff to backport in the sea of open tickets.

Comment 4 Fedora Update System 2020-02-06 15:27:16 UTC
FEDORA-2020-f8e267d6d0 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2020-f8e267d6d0

Comment 5 Fedora Update System 2020-02-07 01:03:51 UTC
systemd-241-14.git18dd3fb.fc30 has been pushed to the Fedora 30 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-2020-f8e267d6d0

Comment 6 Fedora Update System 2020-02-21 01:17:37 UTC
systemd-241-14.git18dd3fb.fc30 has been pushed to the Fedora 30 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.