udisks
udisks copied to clipboard
udisks_partition_table_call_create_partition_and_format_sync fails with "Error waiting for LUKS UUID"
A user reported that our tool which calls udisks_partition_table_call_create_partition_and_format_sync consistently results in a Error waiting for LUKS UUID: Timed out waiting for object (0) error on their system.
The udisks version is 2.9.2-2+deb11u1 from Debian stable (bullseye) but what I assume is the relevant code (the call to udisks_daemon_wait_for_object_sync and its implementation) doesn't seem to have changed since that version.
I couldn't find anything relevant in the system logs beside that error.
It's not clear to me what could cause this and if there is any workaround we could try. The timeout value used here doesn't seem to be configurable.
Original error report: https://gitlab.tails.boum.org/tails/tails/-/issues/19569
This is difficult to debug and reliable reproducer is crucial. Generally those "Timed out waiting for object" errors mean that UDisks couldn't find the expected device (based on specific identifier) in its internal device tree. This might be an actual bug or simply a timing issue where the device is either slow or an uevent hasn't been received or processed in time.
The calling code is this: https://github.com/storaged-project/udisks/blob/6ab828870cb23a7fcbfb0079702815f83f95e1c1/src/udiskslinuxblock.c#L3102-L3135
You may try issuing udevadm trigger while waiting. If that doesn't help, you may need to have a closer look at the actual system state, e.g. if the LUKS volume has been created, what ID or block device does it have, etc.
If you can come up with an isolated reproducer, we can debug and fix it ourselves. Otherwise it's just guessing what could've gone wrong.
Thanks for the reply! I don't think we can come up with an isolated reproducer, so far there has only been one user who seems to be able to reproduce the issue. I asked them to reproduce with a version which calls udevadm trigger and, in case that still fails, asked for an error report including the output of lsblk --output-all.