You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The output of "lxc info" or if that fails: info.txt
Issue description
If one downloads the image using CopyImage AND uses lxc import with the same image fingerprint concurrently, LXD returns an error due to the latter not locking for the image access, apparently.
While the image is being downloaded, in the second terminal, run lxc image import <local-file-meta> <local-file-squashfs> (you get both files in step 1).
Fixescanonical#13855
This needs to happen late in the upload process because we need to verify
the uploaded image's fingerprint before acquiring a lock.
Signed-off-by: Wesley Hershberger <[email protected]>
Fixes#13855
`imageOperationLock`s are not being taken at the start of a `POST
/1.0/images` because the image fingerprint can't be trusted until the
file has been uploaded (see
[lxd/images/go](https://github.com/canonical/lxd/blob/main/lxd/images.go#L1225)).
This makes it fairly easy to forget to take a lock at all.
Fixescanonical#13855
This needs to happen late in the upload process because we need to verify
the uploaded image's fingerprint before acquiring a lock.
Signed-off-by: Wesley Hershberger <[email protected]>
(cherry picked from commit 8a59f7f)
Required information
info.txt
Issue description
If one downloads the image using CopyImage AND uses
lxc import
with the same image fingerprint concurrently, LXD returns an error due to the latter not locking for the image access, apparently.Steps to reproduce
lxc export <image> .
lxc image import <local-file-meta> <local-file-squashfs>
(you get both files in step 1).Problem
Step 2 will fail with the following:
Expected
It should not be possible to import an image if it is locked by another operation.
The text was updated successfully, but these errors were encountered: