Not able to create containers after upgrade to lxd 5.5

Hello,

I am running lxd on debian 11.4. After upgrading from lxd 5.0.0 to 5.5,I couldn’t create any containers anymore . Getting the below error.

note: I am not using the lxd snap version, using lxd version which compiled manually from source

root@cpu-6286:~# lxc launch images:debian/buster test
Creating test
Error: Failed instance creation: Failed creating instance from image: Unpack failed: Failed to run: tar --restrict --force-local -C /var/lib/lxd/storage-pools/default/images/023e5952681e699612e4d5b0807e0dbdc3236168d3ce95ed0c4616badee623d9 --numeric-owner --xattrs-include=* -Jxf -: Process exited with non-zero value 2 (tar (grandchild): xz: Cannot exec: Permission denied
tar (grandchild): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now)

here is the details from kern.log

root@cpu-6286:~# tail /var/log/kern.log
Aug 27 09:06:10 cpu-6286 kernel: [2246807.671707] audit: type=1400 audit(1661583970.808:56312): apparmor="DENIED" operation="exec" profile="lxd_archive-var-lib-lxd-storage-pools-default-images-bb75e1557060d5153898de297ba1f1d11cb5d49cca1fc71987eb8215115e266a" name="/usr/bin/xz" pid=465007 comm="tar" requested_mask="x" denied_mask="x" fsuid=0 ouid=0
Aug 27 09:06:10 cpu-6286 kernel: [2246807.674908] audit: type=1400 audit(1661583970.808:56313): apparmor="DENIED" operation="exec" profile="lxd_archive-var-lib-lxd-storage-pools-default-images-bb75e1557060d5153898de297ba1f1d11cb5d49cca1fc71987eb8215115e266a" name="/usr/bin/xz" pid=465007 comm="tar" requested_mask="x" denied_mask="x" fsuid=0 ouid=0
Aug 27 09:06:10 cpu-6286 kernel: [2246807.742857] audit: type=1400 audit(1661583970.892:56314): apparmor="STATUS" operation="profile_remove" profile="unconfined" name="lxd_archive-var-lib-lxd-storage-pools-default-images-bb75e1557060d5153898de297ba1f1d11cb5d49cca1fc71987eb8215115e266a" pid=465013 comm="apparmor_parser"
Aug 27 12:58:10 cpu-6286 kernel: [2260727.006851] audit: type=1400 audit(1661597890.255:56315): apparmor="STATUS" operation="profile_load" profile="unconfined" name="lxd_archive-var-lib-lxd-storage-pools-default-images-023e5952681e699612e4d5b0807e0dbdc3236168d3ce95ed0c4616badee623d9" pid=2737508 comm="apparmor_parser"
Aug 27 12:58:10 cpu-6286 kernel: [2260727.018528] audit: type=1400 audit(1661597890.259:56316): apparmor="DENIED" operation="exec" profile="lxd_archive-var-lib-lxd-storage-pools-default-images-023e5952681e699612e4d5b0807e0dbdc3236168d3ce95ed0c4616badee623d9" name="/usr/bin/xz" pid=2737541 comm="tar" requested_mask="x" denied_mask="x" fsuid=0 ouid=0
Aug 27 12:58:10 cpu-6286 kernel: [2260727.021625] audit: type=1400 audit(1661597890.259:56317): apparmor="DENIED" operation="exec" profile="lxd_archive-var-lib-lxd-storage-pools-default-images-023e5952681e699612e4d5b0807e0dbdc3236168d3ce95ed0c4616badee623d9" name="/usr/bin/xz" pid=2737541 comm="tar" requested_mask="x" denied_mask="x" fsuid=0 ouid=0
Aug 27 12:58:10 cpu-6286 kernel: [2260727.024746] audit: type=1400 audit(1661597890.259:56318): apparmor="DENIED" operation="exec" profile="lxd_archive-var-lib-lxd-storage-pools-default-images-023e5952681e699612e4d5b0807e0dbdc3236168d3ce95ed0c4616badee623d9" name="/usr/bin/xz" pid=2737541 comm="tar" requested_mask="x" denied_mask="x" fsuid=0 ouid=0
Aug 27 12:58:10 cpu-6286 kernel: [2260727.037083] audit: type=1400 audit(1661597890.259:56319): apparmor="DENIED" operation="exec" profile="lxd_archive-var-lib-lxd-storage-pools-default-images-023e5952681e699612e4d5b0807e0dbdc3236168d3ce95ed0c4616badee623d9" name="/usr/bin/xz" pid=2737541 comm="tar" requested_mask="x" denied_mask="x" fsuid=0 ouid=0
Aug 27 12:58:10 cpu-6286 kernel: [2260727.040018] audit: type=1400 audit(1661597890.259:56320): apparmor="DENIED" operation="exec" profile="lxd_archive-var-lib-lxd-storage-pools-default-images-023e5952681e699612e4d5b0807e0dbdc3236168d3ce95ed0c4616badee623d9" name="/usr/bin/xz" pid=2737541 comm="tar" requested_mask="x" denied_mask="x" fsuid=0 ouid=0
Aug 27 12:58:10 cpu-6286 kernel: [2260727.063616] audit: type=1400 audit(1661597890.315:56321): apparmor="STATUS" operation="profile_remove" profile="unconfined" name="lxd_archive-var-lib-lxd-storage-pools-default-images-023e5952681e699612e4d5b0807e0dbdc3236168d3ce95ed0c4616badee623d9" pid=2737543 comm="apparmor_parser"

any help on this?

Thanks in advance

2 Likes

What I find more interesting is that this only happened after the update. Shouldn’t it always have been an issue?

My guess is that LXD 5.0.0 pre-dates the apparmor profile for the unpacker.

thanks @stgraber @m1cha