ArgoCD Troubleshooting
This guide provides solutions for common ArgoCD issues and troubleshooting steps for maintaining a healthy ArgoCD deployment.
Common Issues and Solutions
Section titled “Common Issues and Solutions”Sync Failures
Section titled “Sync Failures”Issue: Application Won’t Sync
Section titled “Issue: Application Won’t Sync”Symptoms:
- Application shows “OutOfSync” status
- Sync operations fail or time out
Troubleshooting Steps:
-
Check for sync errors in the status:
Terminal window kubectl get application <app-name> -n argocd -o jsonpath='{.status.conditions}' | jq -
Check resource constraints:
Terminal window kubectl top pod -n argocd -
Examine application controller logs:
Terminal window kubectl logs -n argocd -l app.kubernetes.io/name=argocd-application-controller -c argocd-application-controller
Solutions:
-
Force a refresh of the application:
Terminal window kubectl patch application <app-name> -n argocd --type=merge -p '{"metadata":{"annotations":{"argocd.argoproj.io/refresh":"hard"}}}' -
Restart the application controller:
Terminal window kubectl rollout restart deployment argocd-application-controller -n argocd
Resource Issues
Section titled “Resource Issues”Issue: Resource is “Progressing” Forever
Section titled “Issue: Resource is “Progressing” Forever”Symptoms:
- Resources stay in “Progressing” health status
- Deployments never reach ready state
Troubleshooting Steps:
-
Check the health status details:
Terminal window kubectl get application <app-name> -n argocd -o jsonpath='{.status.resources}' | jq 'map(select(.health.status=="Progressing"))' -
Check the problematic resource directly:
Terminal window kubectl describe <resource-kind> <resource-name> -n <resource-namespace>
Solutions:
- Check for resource constraints in target namespace
- Verify the image exists and is accessible
- Check for pod errors using
kubectl describe pod
Issue: Resources Out of Sync but No Changes
Section titled “Issue: Resources Out of Sync but No Changes”Symptoms:
- Application shows “OutOfSync” but Git comparison shows no differences
Solutions:
-
Enable resource tracking via labels:
Terminal window kubectl patch application <app-name> -n argocd --type=merge -p '{"spec":{"syncPolicy":{"syncOptions":["CreateNamespace=true","RespectIgnoreDifferences=true"]}}}' -
Add ignore differences for fields that change frequently:
Terminal window kubectl patch application <app-name> -n argocd --type=merge -p '{"spec":{"ignoreDifferences":[{"group":"apps","kind":"Deployment","jsonPointers":["/spec/replicas"]}]}}'
ApplicationSet Issues
Section titled “ApplicationSet Issues”Issue: ApplicationSet Not Generating Applications
Section titled “Issue: ApplicationSet Not Generating Applications”Symptoms:
- No applications are created from an ApplicationSet
- Only some of the expected applications are created
Troubleshooting Steps:
-
Check ApplicationSet controller logs:
Terminal window kubectl logs -n argocd -l app.kubernetes.io/name=argocd-applicationset-controller -
Verify the ApplicationSet spec:
Terminal window kubectl get applicationset <appset-name> -n argocd -o yaml
Solutions:
-
Restart the ApplicationSet controller:
Terminal window kubectl rollout restart deployment argocd-applicationset-controller -n argocd -
Check if your generator (git, list, cluster, etc.) is correctly configured
-
Verify Git repository access and credentials
Authentication and Access Issues
Section titled “Authentication and Access Issues”Issue: Repository Connection Issues
Section titled “Issue: Repository Connection Issues”Symptoms:
- Unable to connect to Git repository
- “connection refused” or SSL errors
Troubleshooting Steps:
-
Check repository secret:
Terminal window kubectl get secret <repo-secret> -n argocd -o yaml -
Test connection using ArgoCD CLI:
Terminal window argocd repo list
Solutions:
- Update repository credentials
- Check network policies that might be blocking outbound connections
- Verify SSL certificates for private repositories
ArgoCD Component Diagnostics
Section titled “ArgoCD Component Diagnostics”Component Health Check
Section titled “Component Health Check”Run a quick diagnostic on all ArgoCD components:
kubectl get pods -n argocdkubectl top pod -n argocdkubectl describe statefulset,deployment -n argocdFixing Stuck ArgoCD Components
Section titled “Fixing Stuck ArgoCD Components”If a component is in a bad state:
# Force restart the componentkubectl rollout restart deployment <component-name> -n argocd
# For example, to restart the API server:kubectl rollout restart deployment argocd-server -n argocdChecking ArgoCD Server Health
Section titled “Checking ArgoCD Server Health”# Check server statuskubectl exec -it $(kubectl get pods -n argocd -l app.kubernetes.io/name=argocd-server -o name | head -n 1) -n argocd -- argocd admin server healthRecovering from Serious Issues
Section titled “Recovering from Serious Issues”Dealing with Corrupted Applications
Section titled “Dealing with Corrupted Applications”-
Export the corrupted application:
Terminal window kubectl get application <app-name> -n argocd -o yaml > corrupted-app.yaml -
Delete the application without cascade:
Terminal window kubectl delete application <app-name> -n argocd --cascade=false -
Edit the exported YAML to fix issues, then reapply:
Terminal window kubectl apply -f fixed-app.yaml
Recovering from Database Issues
Section titled “Recovering from Database Issues”If the ArgoCD Redis database is corrupted:
# Backup before attempting recoverykubectl get all,secrets,configmaps,applications,appprojects -n argocd -o yaml > argocd-backup.yaml
# Delete and recreate Rediskubectl delete pod -n argocd -l app.kubernetes.io/name=argocd-redisPerformance Troubleshooting
Section titled “Performance Troubleshooting”Addressing High CPU/Memory Usage
Section titled “Addressing High CPU/Memory Usage”# Check resource usagekubectl top pod -n argocd
# Scale up application controller if neededkubectl scale deployment argocd-application-controller -n argocd --replicas=2
# Adjust application controller processing parallelismkubectl edit configmap argocd-cmd-params-cm -n argocd# Add --application-controller-operation-processors=10Optimizing for Large Clusters
Section titled “Optimizing for Large Clusters”For clusters with many applications:
# Set higher limits for the controllerkubectl patch deployment argocd-application-controller -n argocd --type=json -p='[{"op":"replace","path":"/spec/template/spec/containers/0/resources/limits","value":{"cpu":"2","memory":"4Gi"}}]'