platform-support

A knowledge base where we share helpful tips for platform engineers and teams who write code for them

View on GitHub

ArgoCD Troubleshooting

This guide provides solutions for common ArgoCD issues and troubleshooting steps for maintaining a healthy ArgoCD deployment.

Common Issues and Solutions

Sync Failures

Issue: Application Won’t Sync

Symptoms:

Troubleshooting Steps:

  1. Check for sync errors in the status:
    kubectl get application <app-name> -n argocd -o jsonpath='{.status.conditions}' | jq
    
  2. Check resource constraints:
    kubectl top pod -n argocd
    
  3. Examine application controller logs:
    kubectl logs -n argocd -l app.kubernetes.io/name=argocd-application-controller -c argocd-application-controller
    

Solutions:

Resource Issues

Issue: Resource is “Progressing” Forever

Symptoms:

Troubleshooting Steps:

  1. Check the health status details:
    kubectl get application <app-name> -n argocd -o jsonpath='{.status.resources}' | jq 'map(select(.health.status=="Progressing"))'
    
  2. Check the problematic resource directly:
    kubectl describe <resource-kind> <resource-name> -n <resource-namespace>
    

Solutions:

Issue: Resources Out of Sync but No Changes

Symptoms:

Solutions:

ApplicationSet Issues

Issue: ApplicationSet Not Generating Applications

Symptoms:

Troubleshooting Steps:

  1. Check ApplicationSet controller logs:
    kubectl logs -n argocd -l app.kubernetes.io/name=argocd-applicationset-controller
    
  2. Verify the ApplicationSet spec:
    kubectl get applicationset <appset-name> -n argocd -o yaml
    

Solutions:

Authentication and Access Issues

Issue: Repository Connection Issues

Symptoms:

Troubleshooting Steps:

  1. Check repository secret:
    kubectl get secret <repo-secret> -n argocd -o yaml
    
  2. Test connection using ArgoCD CLI:
    argocd repo list
    

Solutions:

ArgoCD Component Diagnostics

Component Health Check

Run a quick diagnostic on all ArgoCD components:

kubectl get pods -n argocd
kubectl top pod -n argocd
kubectl describe statefulset,deployment -n argocd

Fixing Stuck ArgoCD Components

If a component is in a bad state:

# Force restart the component
kubectl rollout restart deployment <component-name> -n argocd

# For example, to restart the API server:
kubectl rollout restart deployment argocd-server -n argocd

Checking ArgoCD Server Health

# Check server status
kubectl exec -it $(kubectl get pods -n argocd -l app.kubernetes.io/name=argocd-server -o name | head -n 1) -n argocd -- argocd admin server health

Recovering from Serious Issues

Dealing with Corrupted Applications

  1. Export the corrupted application:
    kubectl get application <app-name> -n argocd -o yaml > corrupted-app.yaml
    
  2. Delete the application without cascade:
    kubectl delete application <app-name> -n argocd --cascade=false
    
  3. Edit the exported YAML to fix issues, then reapply:
    kubectl apply -f fixed-app.yaml
    

Recovering from Database Issues

If the ArgoCD Redis database is corrupted:

# Backup before attempting recovery
kubectl get all,secrets,configmaps,applications,appprojects -n argocd -o yaml > argocd-backup.yaml

# Delete and recreate Redis
kubectl delete pod -n argocd -l app.kubernetes.io/name=argocd-redis

Performance Troubleshooting

Addressing High CPU/Memory Usage

# Check resource usage
kubectl top pod -n argocd

# Scale up application controller if needed
kubectl scale deployment argocd-application-controller -n argocd --replicas=2

# Adjust application controller processing parallelism
kubectl edit configmap argocd-cmd-params-cm -n argocd
# Add --application-controller-operation-processors=10

Optimizing for Large Clusters

For clusters with many applications:

# Set higher limits for the controller
kubectl 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"}}]'

See Also

hypermedia tech logo