Why am I getting an error when trying to export a ZFS container?

When trying to export I get the following.

$ lxc export mycontainer backup-test.tar.gz
Error: Create backup: Backup storage: Vanilla backup: Mount snapshot: Failed to mount ZFS filesystem:

Am I doing something wrong? How should I debug this? Or should I great a issue on Github?

about the syntax ? nothing wrong.
Did you do something wrong before ? that’s impossible to say for sure from the little detail you are providing, but it’s not unthinkable in theory.

Before creating any issue, you should indeed to some basic debugging. Check first the obvious; disk space. If not, the next most obvious reason for something like that happening is your storage pool being in some trouble.

The best way to test this is to create a new test storage pool, create a simple container from a basic image in this new storage pool and try to export it. If your computer is a physical one a simple way to do that is to dedicate an usb key. If it’s a hosted server or a VM in the cloud, it can be more tricky, but if you use LVM it’s somehow easy to reduce a partition and create a new one on which you can create a new test ZFS partition.

If a basic test storage pool works for exporting a test container, if possible copy the problematic container in your test storage pool and try to export it.
if it works you can be sure that your storage pool is damaged and you have to either try to repair it or extend the good storage pool, copy all your containers in it, then remove the damaged one and do the new one the default. If you have enough available disk space it may be a good way to solve the problem.

If the basic export test from a test storage pool fails, you may have a system issue. You should post again explaining your config with more details (always a good idea in fact)

Do you get the same behavior with --optimized-storage?

I’m trying again. The process is taking a long time, but it is a very slow computer. Only 2 GB of memory.

What does --optimized-storage do?

The export worked this time with the same command. I’m not sure what happened last time. It did take a long time (an hour or two) to produce a 7.3G tar.gz export.