zfs + encryption fails with plucky iso dated 20250415 - Requested offset is beyond real size of device /dev/zvol/rpool/keystore

Bug #2107381 reported by Tim Andersson
22
This bug affects 2 people
Affects Status Importance Assigned to Milestone
curtin
Fix Committed
Undecided
Olivier Gayot
subiquity
Fix Released
Undecided
Unassigned
Ubuntu
Fix Released
Critical
Olivier Gayot
Noble
Fix Released
Undecided
Unassigned
subiquity (Ubuntu)
Fix Released
Undecided
Unassigned
Noble
Fix Released
Undecided
Dan Bungert

Bug Description

Title, log attached, installer crashes simply with system problem detected etc

```
An error occured handling 'zpool-1': ProcessExecutionError - Unexpected error while running command.
        Command: ['cryptsetup', 'open', '--type', 'luks', '/dev/zvol/rpool/keystore', 'keystore-rpool', '--key-file', '/tmp/zpool-key-p4shdf2v']
        Exit code: 1
        Reason: -
        Stdout: ''
        Stderr: Requested offset is beyond real size of device /dev/zvol/rpool/keystore.

        finish: cmd-install/stage-partitioning/builtin/cmd-block-meta: FAIL: configuring zpool: zpool-1
        TIMED BLOCK_META: 22.242
        finish: cmd-install/stage-partitioning/builtin/cmd-block-meta: FAIL: curtin command block-meta
        Traceback (most recent call last):
          File "/snap/ubuntu-desktop-bootstrap/361/lib/python3.12/site-packages/curtin/commands/main.py", line 202, in main
            ret = args.func(args)
                  ^^^^^^^^^^^^^^^
          File "/snap/ubuntu-desktop-bootstrap/361/lib/python3.12/site-packages/curtin/log.py", line 97, in wrapper
            return log_time("TIMED %s: " % msg, func, *args, **kwargs)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "/snap/ubuntu-desktop-bootstrap/361/lib/python3.12/site-packages/curtin/log.py", line 79, in log_time
            return func(*args, **kwargs)
                   ^^^^^^^^^^^^^^^^^^^^^
          File "/snap/ubuntu-desktop-bootstrap/361/lib/python3.12/site-packages/curtin/commands/block_meta.py", line 128, in block_meta
            return meta_custom(args)
                   ^^^^^^^^^^^^^^^^^
          File "/snap/ubuntu-desktop-bootstrap/361/lib/python3.12/site-packages/curtin/commands/block_meta.py", line 2284, in meta_custom
            handler(command, storage_config_dict, context)
          File "/snap/ubuntu-desktop-bootstrap/361/lib/python3.12/site-packages/curtin/commands/block_meta.py", line 2041, in zpool_handler
            zfs.zpool_create(poolname, vdevs_byid,
          File "/snap/ubuntu-desktop-bootstrap/361/lib/python3.12/site-packages/curtin/block/zfs.py", line 303, in zpool_create
            encryption.setup(storage_config, context)
          File "/snap/ubuntu-desktop-bootstrap/361/lib/python3.12/site-packages/curtin/block/zfs.py", line 114, in setup
            util.subp(cmd, capture=True)
          File "/snap/ubuntu-desktop-bootstrap/361/lib/python3.12/site-packages/curtin/util.py", line 323, in subp
            return _subp(*args, **kwargs)
                   ^^^^^^^^^^^^^^^^^^^^^^
          File "/snap/ubuntu-desktop-bootstrap/361/lib/python3.12/site-packages/curtin/util.py", line 172, in _subp
            raise ProcessExecutionError(stdout=out, stderr=err,
        curtin.util.ProcessExecutionError: Unexpected error while running command.
        Command: ['cryptsetup', 'open', '--type', 'luks', '/dev/zvol/rpool/keystore', 'keystore-rpool', '--key-file', '/tmp/zpool-key-p4shdf2v']
        Exit code: 1
        Reason: -
        Stdout: ''
        Stderr: Requested offset is beyond real size of device /dev/zvol/rpool/keystore.

        Unexpected error while running command.
        Command: ['cryptsetup', 'open', '--type', 'luks', '/dev/zvol/rpool/keystore', 'keystore-rpool', '--key-file', '/tmp/zpool-key-p4shdf2v']
        Exit code: 1
        Reason: -
        Stdout: ''
        Stderr: Requested offset is beyond real size of device /dev/zvol/rpool/keystore.

Stderr: ''

```

Related branches

Revision history for this message
Tim Andersson (andersson123) wrote :
Revision history for this message
Tim Andersson (andersson123) wrote :

(ignore the duplicated files in the tar, that was just a whoopsie, any duplicate should be identical)

description: updated
summary: - zfs + encryption fails with plucky iso dated 20250415
+ zfs + encryption fails with plucky iso dated 20250415 - Requested
+ offset is beyond real size of device /dev/zvol/rpool/keystore
Revision history for this message
Tim Andersson (andersson123) wrote :

This failed for me twice on 2 separate VMs, and failed also on:
HP pro sff 400 g9
hp elite sff 805 g9

I can also confirm this passed (at least on a VM) as recently as 2025-04-03

Revision history for this message
Tim Andersson (andersson123) wrote :

ogayot has confirmed this has been failing as early as 04/01/2025

no longer affects: ubuntu-desktop-provision
Revision history for this message
Tim Andersson (andersson123) wrote :

From cursory git archaeology it seems it may be as a result of this commit:
https://github.com/canonical/curtin/commit/204562c277b096229ca20ba546149deef1d85e38

Revision history for this message
Tim Andersson (andersson123) wrote :

diff between the manifest from the beta release and today's ISO (61d088d5b4f9a361ee95dc5bae65d9245c64cfe2f455f50caea046066b949a58)

Revision history for this message
Tim Andersson (andersson123) wrote :
Revision history for this message
Olivier Gayot (ogayot) wrote (last edit ):

$ sudo dd if=/dev/zero of=test.img count=1000 bs=1M
$ sudo zpool create testrpool "$PWD"/test.img
$ sudo zfs create -o encryption=off -V 20971520 testrpool/keystore
$ sudo cryptsetup luksFormat /dev/zvol/testrpool/keystore /tmp/key

On oracular, this produces no warnings. On plucky this leads to:

Device /dev/zvol/testrpool/keystore is too small for activation, there is no remaining space for data.

And then, when running cryptsetup open, it fails on plucky with:

Requested offset is beyond real size of device /dev/zvol/testrpool/keystore

Revision history for this message
Olivier Gayot (ogayot) wrote :

$ sudo cryptsetup luksDump /dev/zvol/testrpool/keystore

On oracular
-----------

Data segments:
  0: crypt
 offset: 16777216 [bytes]
 length: (whole device)
 cipher: aes-xts-plain64
 sector: 512 [bytes]

On plucky
---------

Data segments:
  0: crypt
 offset: 33554432 [bytes]
 length: (whole device)
 cipher: aes-xts-plain64
 sector: 512 [bytes]

This would explain why 20M (i.e., 20971520) is too low on plucky.

Olivier Gayot (ogayot)
Changed in curtin:
status: New → In Progress
assignee: nobody → Olivier Gayot (ogayot)
Changed in ubuntu:
milestone: none → ubuntu-25.04
status: New → In Progress
importance: Undecided → Critical
assignee: nobody → Olivier Gayot (ogayot)
Revision history for this message
Tim Andersson (andersson123) wrote :

added ubuntu distribution and subscribed ubuntu release, targeted to 25.04 milestone.

Olivier Gayot (ogayot)
Changed in curtin:
status: In Progress → Fix Committed
Changed in subiquity:
status: New → In Progress
Revision history for this message
Olivier Gayot (ogayot) wrote :

Pull request for main (includes other changes):

https://github.com/canonical/subiquity/pull/2195

Pull request for plucky (single commit):

https://github.com/canonical/subiquity/pull/2196

Changed in subiquity (Ubuntu):
status: New → In Progress
Olivier Gayot (ogayot)
Changed in subiquity (Ubuntu):
status: In Progress → Fix Committed
Olivier Gayot (ogayot)
Changed in subiquity:
status: In Progress → Fix Committed
Changed in ubuntu:
status: In Progress → Fix Committed
Revision history for this message
Utkarsh Gupta (utkarsh) wrote :

This is done already - unsubscribing the release team.

Olivier Gayot (ogayot)
Changed in ubuntu:
status: Fix Committed → Fix Released
Changed in subiquity (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Olivier Gayot (ogayot) wrote :

The fix is included in Subiquity 25.04 https://github.com/canonical/subiquity/releases/tag/25.04

Changed in subiquity:
status: Fix Committed → Fix Released
Dan Bungert (dbungert)
Changed in subiquity (Ubuntu Noble):
milestone: none → ubuntu-24.04.3
assignee: nobody → Dan Bungert (dbungert)
status: New → In Progress
Revision history for this message
Paride Legovini (paride) wrote :

Hey, what is the status of this one in Noble?

Dan Bungert (dbungert)
Changed in subiquity (Ubuntu Noble):
status: In Progress → Fix Committed
Revision history for this message
Dan Bungert (dbungert) wrote :

> Hey, what is the status of this one in Noble?

Server is unaffected because the running kernel doesn't trigger this bug. Server still has the bugfix.
The fix was merged to noble for subiquity in https://github.com/canonical/subiquity/pull/2241 and further merged to noble for bootstrap in https://github.com/canonical/ubuntu-desktop-provision/pull/1136

Just now I confirmed that the version of ./curtin/block/zfs.py in bootstrap build 413, as found on 24.04/stable, indeed matches the expected copy of that file.

Revision history for this message
Olivier Gayot (ogayot) wrote :

I tested on noble using the desktop installer with the latest ubuntu-desktop-bootstrap snap (rev 413) and latest daily ISO (20250801). The installation went successfully.

When installing on a VM, I did run into an issue on first boot and filed bug 2119293 (which I don't consider critical for .3 since it is not a regression).

Marking fix released since the regression with the zfs luks header size is addressed.

Changed in subiquity (Ubuntu Noble):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.