Snapshot 'c1-20201218-03' cannot be restored due to subsequent snapshot(s). Set zfs.remove_snapshots to override

I am using LXD 4.0.4 , when trying to restore a snapshot I get the following error message

Snapshot 'c1-20201218-03' cannot be restored due to subsequent snapshot(s). Set zfs.remove_snapshots to override

So I ran

$ lxc storage set default volume.zfs.remove_snapshots=true

Now I get a different error message

More recent snapshots must be deleted: [c1-20201218-04]

Am I misunderstanding something here, I thought by setting that setting it will delete subsequent snapshots.

This looks like a bug to me, there appears to be a missing return nil at the end of this block:

If you try and restore again it should work as it appears it will have removed the problem snapshots already.

Nope. No snapshots are deleted.

You’re right, have reproduced issue and this PR fixes it:

This has now been merged.

1 Like