From 5b3dd3cbe8d9e697c3e81f1f9476492e812f6dd8 Mon Sep 17 00:00:00 2001 From: 0xdeadd Date: Fri, 5 Jun 2026 12:13:12 -0400 Subject: [PATCH] fix(luks): surface cryptsetup error output when unlock fails Luks2.unlock() ran 'cryptsetup open' with no error handling, so a failure raised a bare CalledProcessError. Python renders that exception with only the exit status and discards the captured output, so cryptsetup's stderr (merged into stdout by run()) never reached the install log. encrypt() already wraps its cryptsetup call and raises a DiskError that includes the captured output. Mirror that for unlock() so a failure reports the actual cryptsetup message instead of an opaque traceback. Reported in #4327, where the underlying 'device-mapper: crypt: unknown table type' error was hidden from the log for this reason. --- archinstall/lib/disk/luks.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/archinstall/lib/disk/luks.py b/archinstall/lib/disk/luks.py index 5d62abc8..3a3679d0 100644 --- a/archinstall/lib/disk/luks.py +++ b/archinstall/lib/disk/luks.py @@ -149,7 +149,11 @@ class Luks2: 'luks2', ] - result = run(cmd, input_data=passphrase) + try: + result = run(cmd, input_data=passphrase) + except CalledProcessError as err: + output = err.stdout.decode().rstrip() + raise DiskError(f'Could not unlock luks2 device "{self.luks_dev_path}": {output}') debug(f'cryptsetup open output: {result.stdout.decode().rstrip()}')