Gotcha: argocd-repo-server CrashLoopBackOff (copyutil “Already exists”)#
Symptom#
ArgoCD UI shows:
| |
And on any Application detail page:
| |
What Port 8081 Is#
Port 8081 is the argocd-repo-server - the component that renders manifests (Kustomize, Helm, plain YAML). If it’s down, ArgoCD can’t diff or sync any app.
Root Cause#
The argocd-repo-server Deployment includes a copyutil init container that
copies the ArgoCD binary and creates symlinks into a shared emptyDir volume
(/var/run/argocd).
When the main container exits (e.g. after receiving SIGTERM during a Rancher
Desktop restart) and Kubernetes restarts the pod without deleting it, the
emptyDir volume is preserved across container restarts. On the next
restart attempt, copyutil tries to ln files that already exist, fails with:
| |
…and exits with code 1. This puts copyutil into CrashLoopBackOff, the
main container never starts, and port 8081 is never opened.
How to Diagnose#
| |
Fix#
Delete the pod. The Deployment recreates it with a fresh emptyDir, so
copyutil succeeds and the main server starts normally.
| |
Why This Happens on Rancher Desktop#
Rancher Desktop suspends/resumes the underlying VM. On resume, the k3s node
may send SIGTERM to pods. If the container restarts in-place (without pod
deletion), the emptyDir survives and copyutil hits the stale symlinks on
the next init run.
Key Takeaway#
emptyDir volumes persist across container restarts within the same pod
lifetime, but are cleared on pod deletion. Init containers that are not
idempotent (i.e. will fail if run twice) can get stuck in this state. The fix
is always to delete the pod, not just restart the container.