race condition in 'az acr import' can lead to 'manifest unknown' error in target registry #29974
Labels
Auto-Assign
Auto assign by bot
Auto-Resolve
Auto resolve by bot
bug
This issue requires a change to an existing behavior in the product in order to be resolved.
Container Registry
az acr
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
Service Attention
This issue is responsible by Azure service team.
Similar-Issue
Describe the bug
When running az acr import like
to copy the image by tag (e.g. 'latest') from sourceacr to targetacr, there is a race condition when the manifest for the tag in the source registry changes while the az acr import command is in progress.
In that case, the 'az acr import' command completes without any errors. However,
docker pull
fails withLooking into the azure ACR I can see the tag + digest:
but receive a 404 NotFound error when trying to fetch the manifest:
I believe this is the same issue that was described in #21944.
As described in #21944, this is very dangerous if the ACR is used by a kubernetes cluster, since it results in pod startup issues with ImagePullBackoff errors.
Related command
Here's a timeline of all commands that ran to bring the ACR in a bad state:
1) myimage:142506623 with digest 02f3... pushed to source acr and gets tagged with latest
2) az acr import to target registry starts
3) myimage:142506638 with digest 3107... pushed to source acr and tagged with latest
4) az acr import to target registry completes
The az acr import in 4) completes without any errors, but from that time on the target registry is in a bad state.
Probably does not make a difference, but we're using a PullToken to connect to the source registry when transferring the image like
Errors
docker pull
on target acr fails with:az acr import
to copy the image from target acr to a different acr fails with:Issue script & Debug output
Captured debug output via
but afraid that it might contain sensitive information. Will provide if required.
Expected behavior
az acr import should leave the registry in a consistent state. it should either use the old or the new tag, and keep the corresponding manifest.
If the image associated with 'latest' changes while the command is running, it should either:
Environment Summary
azure-cli 2.245.5
Additional context
No response
The text was updated successfully, but these errors were encountered: