Error: Failed container creation: local error: tls: bad record MAC

When I try to download a new image

lxc launch ubuntu:19.10 test
Creating test
Retrieving image: rootfs: 11% (9.58MB/s)

This error come during downloading.

Error: Failed container creation: local error: tls: bad record MAC

One thing I see is, that it downloads up to 100% but then it starts again by 0% and then at arount 10% this error comes.

It worked before! I have created e.g. a Ubuntu 18.04 container but now it does not work anymore. I think not, that I changed something in my setup.

Can anyone please help?

I just hit exactly this today running lxd 4.21 on Ubuntu 20.04. I even tried completely purging lxd and reinstalling, to no avail. Turns out it was because I was running Ubuntu in a VM, and for various reasons had the VM configured to connect to the internet through a bridge instead of a NAT. As soon as I switched the VM back to using a NAT (which is generally how I use it), lxc launch worked just like it always has. I can’t really explain why that is, but wanted to share.