ZFS pool has leftover datasets

After fiddling with OpenTofu and some pools and volumes in a custom created project, I ended up with an error regarding ZFS pool management.

at 20:24:41 ❯ incus storage delete immich
Error: ZFS pool has leftover datasets: custom/immich_immich_cache_volume

However, the pool itself is empty according to Incus:

at 20:25:26 ❯ incus storage volume list immich
+------+------+-------------+--------------+---------+
| TYPE | NAME | DESCRIPTION | CONTENT-TYPE | USED BY |
+------+------+-------------+--------------+---------+

incus storage shows the following:

at 20:25:27 ❯ incus storage show immich
config:
  size: 60GiB
  source: /var/lib/incus/disks/immich.img
  zfs.pool_name: immich
description: ""
name: immich
driver: zfs
used_by: []
status: Created
locations:
- none

As I’m on IncusOS (6.20) it appears my options are limited now. How should I recover from this?

Related topic: Lxc storage delete Error: ZFS pool has leftover datasets: containers/cobalaunch

Try:

incus storage volume create immich immich_immich_cache_volume
incus storage volume delete immich immich_immich_cache_volume
incus storage delete immich

I tried some variations, but to no avail:

at 08:34:33 ❯ incus storage volume create immich immich_immich_cache_volume
              incus storage volume delete immich immich_immich_cache_volume
              incus storage delete immich

Storage volume immich_immich_cache_volume created
Storage volume immich_immich_cache_volume deleted
Error: ZFS pool has leftover datasets: custom/immich_immich_cache_volume

:frowning:

Do you have any more ideas?

Oh, duy you maybe have an immich project?
If so, it may need to be:

incus storage volume create immich immich_cache_volume --project immich
incus storage volume delete immich immich_cache_volume --project immich
incus storage delete immich

Yeah, though something like that as well. However:

incus storage volume create immich immich_cache_volume --project immich
              incus storage volume delete immich immich_cache_volume --project immich
              incus storage delete immich
Error: Failed to run: zfs create -o mountpoint=legacy -o canmount=noauto immich/custom/immich_immich_cache_volume: exit status 1 (cannot create 'immich/custom/immich_immich_cache_volume': dataset already exists)
Error: Storage pool volume not found
Error: ZFS pool has leftover datasets: custom/immich_immich_cache_volume

That would have been too easy… :frowning:

Can you show incus admin os system storage show?

incus admin os system storage show
WARNING: The IncusOS API and configuration is subject to change

Error: unable to determine pool type for immich

I’m inclined to leave it for now. The data is recoverable and it was in a test set-up, so I’m thinking this is more of a glitch of the matrix than anything else. I haven’t seen this on my non-virtualized Incus instance so far :slight_smile: