# Fix an Argo CD Application stuck in Progressing

> A sync never ends and the app never turns Healthy. Break a sync-wave deadlock on a volume claim, then fix an Ingress that waits for an address. In Git.

Level: Advanced · Topic: GitOps · About 18 minutes
Try it in the browser: https://k8wiz.com/playground/fix-an-argo-cd-application-stuck-in-progressing

The playground is a simulated Kubernetes cluster that runs in the browser. kubectl output and errors follow the real ones.

## The situation

`shop-web` deploys `apps/web` from Git into the `shop` namespace. Someone added sync waves to order the rollout: the volume claim first, then the Deployment and Service, then the Ingress. The first sync has been running ever since and no Pod exists.

Find what the sync waits for and fix it in Git: the repository is in the editor under `git/shop-deploy/`, and changes reach the cluster after `git commit`, `git push` and a sync.

Once the sync goes through, one more resource keeps the application from turning Healthy. Fix that in Git too, and finish with `http://shop.example.com` answering.

## Objectives

1. Find the resource the sync is waiting for (`argocd app get shop-web`)
2. In Git, the claim no longer syncs in a wave before the Pod that uses it
3. The sync finishes: web runs with its volume bound
4. Find the resource that keeps the application Progressing (`argocd app get shop-web` again)
5. shop-web is Synced and Healthy, and http://shop.example.com answers

## Hints

1. `argocd app get shop-web` shows the operation still running, `waiting for healthy state of /PersistentVolumeClaim/uploads`. Argo CD applies a wave, waits until everything in it is Healthy, then applies the next.
2. `kubectl get pvc -n shop` says Pending, and `kubectl describe pvc uploads -n shop` says `waiting for first consumer`. The `gp3` class binds a volume only when a Pod that uses the claim is scheduled. That Pod is in wave 1, which never starts.
3. Put the claim in the same wave as the Deployment: `sed -i 's/sync-wave: "0"/sync-wave: "1"/' git/shop-deploy/apps/web/pvc.yaml`, then `git commit -am "Sync the claim with its consumer" && git push`.
4. The stuck operation still holds the application. `argocd app terminate-op shop-web`, then `argocd app sync shop-web`.
5. The sync succeeds and the application stays Progressing: `argocd app get shop-web` shows the Ingress. Argo CD calls an Ingress Healthy once a controller has written an address into `status.loadBalancer`. `kubectl get ingressclass` shows the cluster has `traefik`, and the manifest asks for `nginx`.
6. `sed -i 's/ingressClassName: nginx/ingressClassName: traefik/' git/shop-deploy/apps/web/ingress.yaml`, commit, push and sync again.

## Solution

```bash
argocd app get shop-web
```
```bash
kubectl describe pvc uploads -n shop
```
```bash
sed -i 's/sync-wave: "0"/sync-wave: "1"/' git/shop-deploy/apps/web/pvc.yaml
```
```bash
git commit -am 'Sync the claim with its consumer'
```
```bash
git push
```
```bash
argocd app terminate-op shop-web
```
```bash
argocd app sync shop-web
```
```bash
sleep 5
```
```bash
argocd app get shop-web
```
```bash
sed -i 's/ingressClassName: nginx/ingressClassName: traefik/' git/shop-deploy/apps/web/ingress.yaml
```
```bash
git commit -am 'Use the Traefik ingress class'
```
```bash
git push
```
```bash
argocd app sync shop-web
```
```bash
sleep 5
```
```bash
curl -s http://shop.example.com/
```

## What it teaches

- An application's health is the worst health among its resources. One Ingress in Progressing next to healthy workloads gives a Progressing application.
- During a sync Argo CD waits for each wave to be Healthy before it applies the next. A claim of a `WaitForFirstConsumer` class in an earlier wave than its Pod can never become Healthy, and the sync waits forever.
- A running operation blocks new ones. `argocd app terminate-op` ends it; then sync again from the fixed revision.
- Argo CD's built-in checks call an Ingress, and a Service of type LoadBalancer, Healthy only when `status.loadBalancer.ingress` has an entry. An Ingress no controller claims never gets one.
- Fix the manifests in Git. A change made with kubectl leaves the application OutOfSync and is undone by the next sync.
