Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mysterious Image Digest being pulled by the image-updater #530

Open
huynhj93 opened this issue Jan 31, 2023 · 4 comments
Open

Mysterious Image Digest being pulled by the image-updater #530

huynhj93 opened this issue Jan 31, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@huynhj93
Copy link

huynhj93 commented Jan 31, 2023

Describe the bug
Two Thursday ago we encountered an issue with the image updater. We are using the following for our CI/CD pipeline:

  1. github actions to build and push to AWS ECR (using buildX action step)
  2. argocd-image-updater with Git write back method and digest strategy

The image-updater started commiting SHAs to git with unknown origins. This resulted in an issue with the following error:

docker pull private-ecr@release-development@sha256:fbe6d
Error response from daemon: manifest unknown

To Reproduce
Use a github action with the buildX action plugin to build your image to ECR. Set argocd image updater to use the digest method.

Expected behavior
The image updater actually pulls in an image that exists.

Additional context
Here is the timeline for our entire build: (redacted private ecr host name and shortened shas)
3:47 PST: Merged PR into main, which kicked off a github action.
3:50 PST: Docker build finished within github action with ImageID: sha256:13b65 and digest: sha256:13b65 . they are the same for some reason, but this happened in earlier build where it succeeded. We are also using buildX as suggested here.
3:56 PST: Got these logs from ArgoCD-image-updater pod:

time="2023-01-19T23:56:35Z" level=debug msg="Processing application experts-store-dev"
time="2023-01-19T23:56:35Z" level=debug msg="Considering this image for update" alias=experts-store application=experts-store-dev image_name=experts-store image_tag="sha256:7bf5" registry=private-ecr
time="2023-01-19T23:56:35Z" level=debug msg="Using version constraint 'release-development' when looking for a new tag" alias=experts-store application=experts-store-dev image_name=experts-store image_tag="sha256:7bf5" registry=private-ecr
time="2023-01-19T23:56:37Z" level=debug msg="found 1 from 1 tags eligible for consideration" image="private-ecr/experts-store@sha256:7bf5"
time="2023-01-19T23:56:37Z" level=info msg="Setting new image to private-ecr/experts-store@sha256:fbe6d alias=experts-store application=experts-store-dev image_name=experts-store image_tag="sha256:7bf51" registry=private-ecr
time="2023-01-19T23:56:37Z" level=debug msg="target parameters: image-spec= image-name=image.repository, image-tag=image.tag" application=experts-store-dev image=private-ecr/experts-store
time="2023-01-19T23:56:37Z" level=info msg="Successfully updated image 'private-ecr/experts-store@sha256:7bf51' to 'private-ecr@sha256:fbe6d5', but pending spec update (dry run=false)" alias=experts-store application=experts-store-dev image_name=experts-store image_tag="sha256:7bf5" registry=private-ecr
time="2023-01-19T23:56:37Z" level=debug msg="Using commit message: build: automatic update of experts-store-dev\n\nupdates image experts-store tag 'sha256:7bf51' to 'sha256:fbe6d'\n"

3:56 PST : Double checked above within github and the argocd image updater file that the image sources and it shows that image updater commited the unknown fbe6d digest to VCS, which makes the pod spin up with “manifest unknown”
3:56 pst:Double checked with ECR and we see the actual digest being the one shown in the github action: sha256:13b65

I’m wondering if anyone has encountered this issue? I expected argo to have commited the SHA from the github action: `asha256:13b65 but instead we see this mysterious sha that can’t be found anywhere inside our ECR fbe6d. I noticed that the source code sorts the digest strategy by alphabetically instead of by date, is this intended? https://github.com/argoproj-labs/argocd-image-updater/blob/master/pkg/image/version.go#L95

Monkey Patch fix for others encountering this issue

We have reverted to using the latest strategy in combination with the allowed_tags annotation. The latest strategy actually pulls in an image that exists.

** Other user notes **

  1. Brandon Helms in the slack channel has stated that this only happens on his github actions where he uses the buildX step. Other repositories are working just fine.
  2. I've attempted to downgrade my buildx action to fix the problem but to no avail. Downgraded to v0.9.1 but issue still occured.
  3. Brandon helms in the slack channel has said that the buildx action is behaving weirdly as well where it commits untagged images, which is happening to us as well.

image

For other users statements, see slack thread here. https://cloud-native.slack.com/archives/C0296T47CHY/p1674584570398149

@huynhj93 huynhj93 added the bug Something isn't working label Jan 31, 2023
@subourbonite
Copy link

I see this behavior sometimes when querying ECR - images that don't really "exist" get picked up by the updater, causing cascading failures on our end when it tries to apply the update.

@Cr0n1c
Copy link

Cr0n1c commented Feb 28, 2023

@ralf-berger
Copy link

ralf-berger commented May 10, 2023

Same here. Maybe this is caching data or related to multiarch manifests? But strangely enough, there doesn't seem to be any problem when using write-back-method: argocd. 🤔

Has anybody tried provenance: false as the build-push-action release notes suggest (to not create OCI images)?

@andremetzen
Copy link

@huynhj93 @Cr0n1c @ralf-berger Disabling provenance fixes the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants