Instance import fails with dependant volume: "Cannot attach volume with snapshots as dependent"

Hi

I had decided to rebuild my laptop with Ubuntu 26.04, so exported my instances and importing them in the new build. With one of them that has a “dependent” custom filesystem volume, it fails to import:

Error: Failed importing backup: Failed creating instance record: Failed initializing instance: Failed to add device "instance-name_disk01": Cannot attach volume with snapshots as dependent

Incus 7.3 took snapshots of the OCI container and “dependent” custom volume on every startup and expires them at 90 days.

It came from Ubuntu 24.04.4 x86_64 HWE (v7 kernel) with ZFS backed storage pools. Both the root and custom volumes were filesystem types created by Incus. It was exported with “–optimized-storage” and just used default gz compression.

So far the import actually creates the dependent custom volume with all its snapshots, but fails with the instance import/create. I’ve tried cleaning out any references to dependent custom volume in the export’s “index.yaml” and the directories in the export archive, but it is still referenced in the other (binary?) files so I get the same error.

Any ideas how to prod it to import?

Thanks.

Raised this on Github as it can be reproduced: Cannot import exported instance with dependant volume that has snapshots; "Cannot attach volume with snapshots as dependent" · Issue #3927 · lxc/incus · GitHub


user@host:\~$ incus launch images:ubuntu/24.04 testdepvol
Launching testdepvol
user@host:\~$ incus storage volume create isp01 testdepvol_disk01
Storage volume testdepvol_disk01 created
user@host:\~$ incus storage volume attach isp01 testdepvol_disk01 testdepvol testdepvol_disk01 /mnt/local/testdepvol_disk01
user@host:\~$ incus config device set testdepvol testdepvol_disk01 dependent=true
user@host:\~$ incus storage volume show isp01 testdepvol_disk01
config:
dependent: "true"
volatile.idmap.last: '\[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}\]'
volatile.idmap.next: '\[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}\]'
description: ""
name: testdepvol_disk01
type: custom
used_by:
- /1.0/instances/testdepvol?project=someproject
location: none
content_type: filesystem
project: someproject
created_at: 2026-08-30T20:48:07.138205605Z
user@host:\~$ incus snapshot create testdepvol snap0
user@host:\~$ incus storage volume snapshot list isp01 testdepvol_disk01
┌───────┬───────────────────────┬────────────┐
│ NAME  │       TAKEN AT        │ EXPIRES AT │
├───────┼───────────────────────┼────────────┤
│ snap0 │ 2026/08/30 22:51 CEST │            │
└───────┴───────────────────────┴────────────┘
user@host:\~$ incus exec testdepvol -- bash -c 'echo snap1 > snap.txt'
user@host:\~$ incus snapshot create testdepvol snap1
user@host:\~$ incus exec testdepvol -- bash -c 'echo snap2 > snap.txt'
user@host:\~$ incus snapshot create testdepvol snap2
user@host:\~$ incus exec testdepvol -- bash -c 'echo snap3 > snap.txt'
user@host:\~$ incus snapshot create testdepvol snap3
user@host:\~$ incus exec testdepvol -- bash -c 'echo snap4 > snap.txt'
user@host:\~$ incus snapshot create testdepvol snap4
user@host:\~$ incus exec testdepvol -- bash -c 'echo snap5 > snap.txt'
user@host:\~$ incus snapshot create testdepvol snap5
user@host:\~$ incus exec testdepvol -- bash -c 'echo snap6 > snap.txt'
user@host:\~$ incus snapshot create testdepvol snap6
user@host:\~$ incus export testdepvol testdepvol_export.tgz
Backup exported successfully!
user@host:\~$ incus stop testdepvol
user@host:\~$ incus delete testdepvol
user@host:\~$ incus storage volume list isp01
┌─────────────────┬──────────────────────────────────────────────────────────────────┬─────────────┬──────────────┬─────────┐
│      TYPE       │                               NAME                               │ DESCRIPTION │ CONTENT-TYPE │ USED BY │
├─────────────────┼──────────────────────────────────────────────────────────────────┼─────────────┼──────────────┼─────────┤
│ image           │ 5cdf81762f587a62a35186ead1be7c5a75da9ed82de78de136b1be4a0e4ee517 │             │ filesystem   │ 1       │
└─────────────────┴──────────────────────────────────────────────────────────────────┴─────────────┴──────────────┴─────────┘
user@host:\~$ incus import testdepvol_export.tgz testdepvol01
Error: Failed importing backup: Failed creating instance record: Failed initializing instance: Failed to add device "testdepvol_disk01": Cannot attach volume with snapshots as dependent