Error: Create instance from backup: Error starting unpack: Failed to run: tar --zstd -xf - --xattrs-include=*

Hi,
I have get that error after executing the command. Can someone assist me?
Regards.

indiana@mars:~/Projects/lxdbackups$ lxc import haproxy01.tar.gz haproxy01 --storage zfspool
Error: Create instance from backup: Error starting unpack: Failed to run: tar --zstd -xf - --xattrs-include=* -C /var/snap/lxd/common/lxd/storage-pools/zfspool/containers/haproxy01 --strip-components=2 backup/container: tar: unrecognized option '--zstd'
Try 'tar --help' or 'tar --usage' for more information.

Here are some of infos of the system:

indiana@mars:~/Projects/lxdbackups$ lxd --version
4.14
indiana@mars:~/Projects/lxdbackups$ lxc ls
+------+-------+------+------+------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+------+-------+------+------+------+-----------+
indiana@mars:~/Projects/lxdbackups$ lxc storage ls
+---------+--------+---------+-------------+---------+
|  NAME   | DRIVER | SOURCE  | DESCRIPTION | USED BY |
+---------+--------+---------+-------------+---------+
| zfspool | zfs    | zfspool |             | 1       |
+---------+--------+---------+-------------+---------+
indiana@mars:~/Projects/lxdbackups$ ls -al
total 3454052
drwxrwxr-x  2 indiana indiana        124 May 15 13:09 .
drwxrwxr-x 28 indiana indiana       4096 May 14 18:09 ..
-rw-rw-r--  1 indiana indiana    8308084 May 15 13:09 edgetest.tar.gz
-rw-rw-r--  1 indiana indiana  312589617 May 12 21:08 haproxy01.tar.gz
-rw-rw-r--  1 indiana indiana  299188472 May 12 22:29 haproxy02.tar.gz
-rw-r--r--  1 root    root    2061100030 May 13 09:07 lxd_backup.tgz
-rw-rw-r--  1 indiana indiana  855745622 May 15 13:07 ubuntu-gui.tar.gz

This is odd, the file extension suggests it’s gzip compressed but the LXD error suggests that the file header indicated zstd instead…

Can you show file haproxy01.tar.gz?

Sure, here it is.

indiana@mars:~/Projects/lxdbackups$ file haproxy01.tar.gz 
haproxy01.tar.gz: Zstandard compressed data (v0.8+), Dictionary ID: None

lxc containers exported like this.

lxc export haproxy01 haproxy01.tar.gz

Okay, so looks like your LXD server is configured to use zstd for backups (backups.compression_algorithm) but then the tar version we have in the snap isn’t actually capable of decompressing those.

This will likely get resolved soon as we’re about to move to a core20 base snap which will refresh the tar version.

Until then, you’ll need to change the compression of the tarball before importing it.
So something like zstd -d followed by gzip -1 or something to recompress as gzip.

Thanks for the quick response, I know that is not related with this case but, is there any method to change the network configuration as well? My network configuration changed as well.
Regards.

indiana@mars:~/Projects/lxdbackups$ lxc import haproxy01.tar.gz haproxy01 --storage zfspool
Error: Internal import request: Failed creating instance record: Invalid devices: Device validation failed for "eth0": Device IP address "10.23.4.2" not within network "lxdbr0" subnet

Ah, interesting, no there isn’t a way to override this during import of the backup (partly because of how this API works). But you could alter the yaml file in the backup tarball directly to correct or remove that address.

Thanks @graber, really appreciate. Thanks.