argocd-image-updater
argocd-image-updater copied to clipboard
Could not update application spec: stat /tmp: no such file or directory
Describe the bug ArgoCD Image Updater is correctly discovering that there is a new image in the registry, however it is unable to update the Application spec and fails with this error in the log:
Could not update application spec: stat /tmp: no such file or directory
I have verified that the Connected Repo is working(it says "Connection Status: Successful" on the Connected Repos page), and the Image Registry connection is also good as it is able to pull the tags.
To Reproduce
Create an Application in ArgoCD UI using the following annotations:
argocd-image-updater.argoproj.io/image-list: argocdapp=myregistry/argocd-test-app:0.0.x
argocd-image-updater.argoproj.io/write-back-method: git
argocd-image-updater.argoproj.io/git-branch: develop
argocd-image-updater.argoproj.io/argocdapp.update-strategy: semver
argocd-image-updater.argoproj.io/argocdapp.force-update: "true"
Expected behavior
I would expect that the new image would get deployed into K8S, and the new image version would be committed back to git successfully.
Additional context
Kubernetes: Minikube Running on MacOS (M2 Max)
Version
ArgoCD Version: v2.6.7+5bcd846 Image Updater Version: 0.12.0
Logs
time="2023-05-01T16:51:33Z" level=info msg="Setting new image to myregistry/argocd-test-app:0.0.5" alias=argocdapp application=cid-uat-build image_name=argocd-test-app image_tag=0.0.2 registry=myregistry
time="2023-05-01T16:51:33Z" level=info msg="Successfully updated image 'myregistry/argocd-test-app:0.0.2' to 'myregistry/argocd-test-app:0.0.5', but pending spec update (dry run=false)" alias=argocdapp application=cid-uat-build image_name=argocd-test-app image_tag=0.0.2 registry=myregistry
time="2023-05-01T16:51:33Z" level=info msg="Committing 1 parameter update(s) for application cid-uat-build" application=cid-uat-build
time="2023-05-01T16:51:33Z" level=info msg="Starting configmap/secret informers"
time="2023-05-01T16:51:33Z" level=info msg="Configmap/secret informer synced"
time="2023-05-01T16:51:33Z" level=error msg="Could not update application spec: stat /tmp: no such file or directory" application=cid-uat-build
time="2023-05-01T16:51:33Z" level=info msg="configmap informer cancelled"
time="2023-05-01T16:51:33Z" level=info msg="secrets informer cancelled"
time="2023-05-01T16:51:33Z" level=info msg="Processing results: applications=2 images_considered=2 images_skipped=0 images_updated=0 errors=1"
This seems to only be an issue when running Kubernetes(Minikube) on arm64. I used the exact same config on a cluster deployed on amd64 and everything worked fine.
I've encountered the same problem while running the Image Updater on version v0.12.0 on a Raspberry Pi 4 (also arm64).
I've traced the error back to this line
tempRoot, err := os.MkdirTemp(os.TempDir(), fmt.Sprintf("git-%s", app.Name))
And one possible cause, as seen in other places the same error popped up, could be the lack of the /tmp
directory.
Given that the project uses alpine:latest
image and it comes with the /tmp
directory, I decide to rebuild the argo-image-updater
image and check if the error would go away. And that's exactly what happened.
Checking the registry, I've noticed there are some builds to newer releases (v0.12.2 at the time of this writing), so I decided to try them out as well. And the error also did not pop up.
So, I guess, for this issue to be finally closed it is for the stable install manifest to be updated to v0.12.0.
I've encountered the same problem while running the Image Updater on version v0.12.0 on a Raspberry Pi 4 (also arm64).
I've traced the error back to this line
tempRoot, err := os.MkdirTemp(os.TempDir(), fmt.Sprintf("git-%s", app.Name))
And one possible cause, as seen in other places the same error popped up, could be the lack of the
/tmp
directory. Given that the project usesalpine:latest
image and it comes with the/tmp
directory, I decide to rebuild theargo-image-updater
image and check if the error would go away. And that's exactly what happened.Checking the registry, I've noticed there are some builds to newer releases (v0.12.2 at the time of this writing), so I decided to try them out as well. And the error also did not pop up.
So, I guess, for this issue to be finally closed it is for the stable install manifest to be updated to v0.12.0.
Not the case for me. Using on Pi4 v 0.12.0 and same issue pops up. Together with the x509 for docker.io registries. May be you meant "...updated to 0.12.2"?
Can confirm updatng manually to 0.12.2 resolves all the issues ...
I don't think so :'( at least on M1 I also have a:
time="2023-11-16T18:44:10Z" level=error msg="Could not update application spec: chdir /tmp/git-zio-hexagonal-apps675939650/base: no such file or directory" application=zio-hexagonal-apps
Just thought I'd update this issue for others facing similar issues.
I'm on an Apple M1. I installed argocd-image-updater using this manifest and I had the same issue as chrismith-equinix has described.
I can confirm, using the same manifest above and instead of using argocd-image-updater:v0.12.0
and replacing it with argocd-image-updater:v0.12.2
immediately resolved my issue and the expected commit was made to my target repository/branch.
I hope this will help others.