-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LUKS device reported as wrong type even though type is set correctly #1209
Comments
So the specific issue here is that Ignition cannot validate that a given clevis backed LUKS device matches the config. Purely being able to unlock a device is not sufficient to say that it's configured exactly as specified in the config. I believe the current resolution for this bug will be either the modification of that error string or another error path with a more exact error string as the actual behavior here is expected. |
Okay, so let's discuss that general thing in #1210. However, I now tried specifying a keyfile that I know is sure unlockable for Ignition and get the same error – so maybe my speculation about the keyfile being the fault, is wrong after all? variant: fcos
version: 1.3.0
storage:
luks:
# external disk
- name: external
label: luks-external
device: /dev/disk/by-id/[…]:0-part1
# disabled, because MBR disk is not properly configured yet as this
# device: /dev/disk/by-partlabel/external
clevis:
tpm2: false
threshold: 1
tang:
- url: # […]
# temporary key"file" i.e. password to unlock disk at provisioning step as clevis unlocking at provisioning is not yet supported
# see https://github.com/coreos/ignition/issues/1210
key_file:
inline: |-
******************
wipe_volume: false I know the password as a key-file I put into |
Wait, now I'm confused when comparing the source code. I added this to my OP:
However even the first command is not logged that checks whether that is a LUKS device? I.e. Note: Also witched to corect branch/tag now, it's of course Ignition v2.9.0, but as far as I see no big changes were made there. |
Also tried it without having a Uhm… I guess improving the error messages here (so that they show what property is actually missing why it claims the type is wrong) would be useful. Edit: Now also manually verified that Or does Ignition maybe improperly create key files with a line ending? |
Ignition is not currently designed to reuse existing Clevis-backed LUKS volumes; see #1210 (comment) for some additional context. Since you don't actually want Ignition to modify the device, you don't need to specify the |
Okay fine, but anyway, the approach here should also work, should not it? After all reusing LUKS volumes (with a keyfile) is implemented. So, to eliminate this:
I now attached a keyfile to the LUKS volume with a line ending and it still does not work. So that's not the issue. Still, something in Also how do I get these detailed command logs that appear in the source code ( |
If your existing LUKS volume is only configured with a keyfile, it should work. If it's also configured with Clevis unlocking, it won't work, since Ignition can't verify that the config matches the volume. |
It is. As explained I explicitly added a keyslot. And it does not work…
well… it is too, but that should not matter, should it? I did not see it anywhere in the source code that Ignition would compare keyslots or so. |
Okay, so I've removed all key slots, and kept only one remaining keyslot with a keyfile (respectively passphrase) that Ignition can unlock because it is given to it… It still does not work. The LUKS device is now exactly as specified (no Clevis included anymore, I I still get the "wrong type" error.
variant: fcos
version: 1.3.0
storage:
luks:
# external disk
- name: external
label: luks-external
device: /dev/disk/by-id/[…]:0-part1
# disabled, because MBR disk is not properly configured yet as this
# device: /dev/disk/by-partlabel/external
clevis:
tpm2: false
threshold: 1
tang:
- url: # …
thumbprint: # …
# temporary key"file" i.e. password to unlock disk at provisioning step as clevis unlocking at provisioning is not yet supported
# see https://github.com/coreos/ignition/issues/1210
key_file:
inline: |-
******
wipe_volume: false |
My phrasing was a bit unclear in #1209 (comment). Stating this as clearly as possible: you need to remove the |
Error reporting improvements in #1211. |
Bug
Background information:
https://discussion.fedoraproject.org/t/how-to-mount-re-use-an-existing-luks-volume/29767?u=rugk
Operating System Version
FCOS 34
fedora-coreos-34.20210503.1.1-live.x86_64
Ignition Version
2.9.0
Environment
bare-metal
Expected Behavior
Do not report this error.
Or report a more detailed error, at least?
Actual Behavior
I get the error that the volume is not of the correct type;
ignition/internal/exec/stages/disks/luks.go
Lines 203 to 204 in 0cbe33f
I guess this is wrong, see below.
Reproduction Steps
Other Information
I explicitly set the correct LUKS label, as you can see when I
luksDump
the resource:AFAIK the code goes in here from here, in here and gets all information.
Given everything looks correct AFAIK, I guess
checkLuksDeviceExists
somehow works improperly…The only way, where it could fail may be when opening it with a keyfile – that does not exist.
However, if it cannot open the existing LUKS partition (why does not it try to use Clevis BTW? It is already configured but well…), then it should report this as an error and not complain about the type of the partition.
Whether the device can be opened has nothing to do with what "type" (in whatever meaning) it is.
Edit: I should note the string
opening luks device
does not appear in my journalctl logs, so after all maybe my speculation at the end is wrong.The text was updated successfully, but these errors were encountered: