Opsphere
← All articles

Argo CD and GitHub: Troubleshooting Sync, Drift and Failed Rollouts

Argo CD and GitHub: Troubleshooting Sync, Drift and Failed Rollouts

Abstract GitOps sync and drift title card

When an Argo CD application built from a GitHub repository goes red, the first job is to decide what kind of problem it is. A repository that Argo CD cannot read, a manifest that does not render, a cluster it cannot reach, a Kubernetes resource that never becomes healthy and an application that crashes after a clean sync all look similar in the UI. They need different fixes. This guide shows how to tell them apart, in what order to check, and what to verify before you change anything.

Opsphere
opsphere.io
See Cloud Operations in One Place
Opsphere brings Argo CD, Kubernetes, cloud, observability, CI/CD and code evidence together to help teams investigate operational issues.
Explore Opsphere

TL;DR

  • Problem: “OutOfSync” or “Degraded” in Argo CD says something is wrong but not where. The cause can sit in GitHub, the manifests, the cluster connection, Kubernetes or the application itself.
  • Key takeaway: Separate sync status (does the cluster match Git?) from health status (are the resources actually working?), then work from the outside in: repository, rendering, cluster, resources, application.
  • Verify before remediating: Confirm the revision Argo CD is tracking, the exact diff, the target cluster and the recent change history before you sync, roll back or force anything.
  • Next step: Use the workflow and the troubleshooting table below. Opsphere, a read-only operational intelligence layer, can help you gather Argo CD, Kubernetes, cloud, observability, CI/CD and code evidence in one place.

Table of Contents

How Argo CD and GitHub fit together

Argo CD is a declarative GitOps continuous delivery tool for Kubernetes, maintained as an open source project on GitHub. Git holds the desired state. Argo CD compares it with the live state in the cluster and reports the difference.

AWS’s guidance on GitOps tooling frames Git as the auditable source of truth: reconciliation makes deployments repeatable, drift visible and rollback a Git operation. That framing is also the key to troubleshooting. Every Argo CD problem is a gap between three things:

  1. What GitHub says should exist (a repository, a revision and a path).
  2. What Argo CD can render and apply from that source.
  3. What Kubernetes actually runs and whether the application inside it works.

An Application points at all of these. Its source specifies the repository URL, revision and path, and its destination specifies the target cluster and namespace. A mistake in any one field produces a failure that can look like a deployment bug.

Two statuses, two questions

Every application carries a sync status and a health status. They answer different questions, and mixing them up is the most common reason teams chase the wrong layer.

Status Question it answers Typical wrong assumption
Sync status (Synced, OutOfSync) Does the live state match what Git declares? “OutOfSync means the deployment is broken.” It may only mean a new commit is waiting.
Health status (Healthy, Progressing, Degraded, Missing and others) Are the resources running as intended? “Synced means it works.” Manifests can be applied exactly as written and still fail at runtime.

The official Getting Started guide shows the benign case: a newly created Application starts out OutOfSync until you run a sync, which retrieves the manifests and applies them to Kubernetes. OutOfSync alone is not a fault.

The useful combinations:

  • OutOfSync and Healthy: a change is pending, or something drifted. The running workload may be fine.
  • Synced and Degraded: Git was applied correctly, but a resource fails at runtime. Look at Kubernetes and the application, not at Argo CD.
  • OutOfSync and Degraded: two problems may overlap. Resolve the sync question first so you know what the cluster is supposed to look like.
  • Unknown or comparison errors: Argo CD often cannot render or fetch the desired state. Look at the repository, credentials and manifest generation.

A step-by-step investigation workflow

Work through these steps in order. Each step rules out one layer, so you stop guessing.

Step 1: Pin down what Argo CD is comparing

Before reading any error, write down four facts from the Application:

  • The repository URL and the tracked revision (branch, tag or commit).
  • The path inside the repository.
  • The destination cluster and namespace.
  • The sync policy: manual or automated, and whether prune and self-heal are on.

Many “mystery” incidents end here. The application tracks a branch nobody pushes to, a path was renamed in a refactor, or the destination points at the wrong namespace.

Step 2: Check that Argo CD can read GitHub

If the Application shows a comparison error or never updates, test the repository connection first. In the Argo CD UI, check Settings, then Repositories, for connection status and authentication errors.

For a private repository, Argo CD’s documentation describes connecting through the CLI with argocd repo add, or through Settings and Repositories with HTTPS credentials, and testing the connection before creating the Application. A GitHub App with read-only Contents access is a good choice for credentials, stored in Kubernetes Secrets or AWS Secrets Manager.

Signs that this layer is the problem:

  • Authentication or authorization errors on the repository.
  • Errors that began right after a token, app installation or secret was rotated.
  • Every Application from the same repository failing at once.

That last sign is a strong clue. A repository problem is shared. A resource problem is usually local to one Application.

Step 3: Check whether the commit was seen

If the repository connects but a merged pull request has not appeared, the cause may be timing. Argo CD polls Git every three minutes, and a GitHub webhook at /api/webhook can trigger an earlier refresh. Webhook payloads are untrusted and only refresh applications. They do not deploy anything by themselves.

If you expected an instant update, check that the webhook delivers JSON payloads and that the delivery shows a successful response on the GitHub side. If the change is older than a few minutes and still missing, compare the revision shown in Argo CD with the commit on GitHub. A mismatch means the wrong branch is tracked or the refresh is blocked. A match means the commit was seen and the problem is further down.

Webhook and revision checks for a missed Git commit

Step 4: Render the manifests

Argo CD may reach the repository and still fail to produce valid Kubernetes objects. Look for:

  • Helm values that reference a missing key, or a chart version that no longer exists.
  • Kustomize overlays that point at a deleted base.
  • YAML syntax errors introduced in the last commit.
  • Resources whose API version the cluster no longer serves.

These are configuration or repository problems, not sync problems. The fix is a Git commit, so the evidence you need is the failing commit and its author, not a cluster log.

Step 5: Read the diff, not the status

When the application is OutOfSync, the diff tells you whether the difference is expected. Run argocd app diff or open the diff view in the UI and sort the differences into three groups:

  • Pending change: Git moved forward and the cluster has not caught up yet.
  • Real drift: someone or something changed a live resource, for example a manual scale or an edited ConfigMap.
  • Noise: fields that controllers or admission webhooks mutate, such as defaulted values or injected sidecars, which show up as a perpetual difference.

Drift is an important case. Per the automated sync documentation, self-healing is disabled by default, and setting selfHeal: true makes Argo CD resynchronize when live state drifts from Git. If an engineer scaled a deployment by hand and the application stays OutOfSync, self-heal is probably off. If the change keeps reverting, self-heal is probably on and the manual edit is losing to Git.

Step 6: Confirm the cluster connection

For an in-cluster deployment, Argo CD can use https://kubernetes.default.svc, while an external target cluster must first be registered with Argo CD. If many applications on one destination fail together, suspect the cluster connection: an expired credential, a changed API endpoint, a network rule or a private endpoint that Argo CD can no longer reach.

Keep this separate from a Kubernetes resource failure. A cluster connectivity problem means Argo CD cannot see or change the target at all. A resource failure means it can, and the workload is unhealthy.

Step 7: Inspect the unhealthy resources

If the sync completed and health is Degraded or stuck in Progressing, move into Kubernetes. Start at the resource Argo CD marks, then follow its owners and dependents:

  • Deployment: check rollout conditions and the ReplicaSet that never reached its desired count.
  • Pods: look for ImagePullBackOff, CrashLoopBackOff, Pending and failed readiness probes.
  • Events: scheduling failures, quota limits, failed volume mounts.
  • Services and Ingresses: missing endpoints, selectors that match no pods.

This is where most failed rollouts get explained, and it is where Argo CD offers the least. It tells you which resource is unhealthy. Kubernetes tells you why.

Step 8: Decide whether it is the application

If the pods run and probes pass but users see errors, the sync is not the issue. Compare the time of the deploy with error rates, latency and logs in your observability tools, and check the code change that shipped. For that, tracing from a production symptom back to a commit is the useful skill, covered in our guide on tracing incidents to code changes in GitHub.

Troubleshooting table

Use this table to match what you see with the likely layer, the evidence that confirms it, and the owner of the fix.

Symptom Likely layer Evidence that confirms it Usual fix lives in
Comparison error, repository not accessible Repository access Failed connection under Settings, Repositories; expired token or app permission Credentials or GitHub App settings
Merged PR not showing for several minutes Detection timing Tracked revision older than the GitHub commit; webhook delivery failing Webhook setup or tracked branch
Application cannot generate manifests Configuration Helm, Kustomize or YAML error tied to a specific commit Git commit in the config repository
OutOfSync, resources otherwise fine Pending change or drift Diff shows a newer Git revision or a manually edited live field Sync, or revert the manual edit
Permanently OutOfSync on fields you never set Mutated fields Diff on defaulted or injected values that return after every sync Diff customization in the Application
Resource deleted from Git still in cluster Sync policy Prune not enabled Sync policy, then review before enabling
Many apps fail for one destination Cluster connectivity Shared destination, credential or network errors Cluster registration, credentials, networking
Synced but Degraded Kubernetes Pod events, failed rollout conditions, quota or scheduling errors Manifests, resources or node capacity
Synced, Healthy, users see errors Application Error spike after deploy in logs and metrics; matching code change Application code or runtime configuration

Examples from real operating patterns

The following scenarios are illustrative, not customer stories. They show how the layers separate.

Example 1: Every application from one repository turns Unknown

A platform team sees a dozen applications stop updating at the same time. The common factor is one GitHub repository. Checking Settings, then Repositories, shows an authentication failure. The credentials were rotated that morning. Nothing is wrong with the workloads, so no cluster action is needed. Updating the credential restores the connection, and a hard refresh confirms the comparison runs again.

The lesson: when failures share a source, look at the source.

Example 2: Synced and Degraded after a clean merge

A pull request raises a memory request in a Helm values file. The sync succeeds, but the new pods stay Pending and the application shows Degraded. Argo CD did its job. The events show insufficient memory on available nodes. The fix is capacity or a smaller request, and the change goes back through Git.

The lesson: Synced means the cluster matches Git, not that Git is right.

Example 3: A drift that keeps coming back

During an incident, an engineer scales a deployment up by hand. The application turns OutOfSync. Later the replica count drops again without anyone touching it. Self-heal is on, so Argo CD reapplied the declared value. The durable answer is to change the replica count in Git, or to deliberately delegate scaling to an autoscaler and exclude that field from comparison.

The lesson: during an incident, decide whether a live change should survive. If yes, it must reach Git.

Example 4: Deleted in Git, still running

A team removes a CronJob from the repository, yet it keeps running. Automated pruning is disabled by default, so Argo CD does not delete resources that have disappeared from Git unless prune: true is set. The same documentation describes allowEmpty as an extra safeguard for an empty target. Before enabling prune, list what it would remove. Teams planning cleanup of orphaned resources at scale can also look at Kubernetes patterns for web app scalability for ideas on structuring that work.

Verification conditions before remediation

Syncing, rolling back or toggling a policy changes production. Check these conditions first, and write down the answers in the incident channel.

  1. The tracked revision is the one you think it is. Compare the revision in Argo CD with the commit on GitHub, including author and time.
  2. The diff is understood. Every changed field is classified as pending change, drift or noise. Do not sync a diff you cannot explain.
  3. The destination is correct. Cluster, namespace and project match the intended environment, especially with several similarly named clusters.
  4. The failing layer is identified. A repository, cluster connectivity, Kubernetes or application cause is confirmed with evidence, not inferred from the status color.
  5. Pruning impact is known. If the sync would delete resources, you have a list of what will be removed and confirmed none is stateful or still needed.
  6. A recent change explains the timing. There is a commit, deploy, credential rotation or infrastructure change that lines up with the first failure. If infrastructure drift is a suspect, five setup checks for Terraform on AWS help establish whether the cloud side changed.
  7. Rollback path is ready. Because rollback is a Git operation in a GitOps model, the previous known-good commit is identified and reviewable.
  8. Secrets stay out of Git. If the fix involves a Secret, do not commit it unencrypted; use your organization’s sealed or external secret process.

After remediation, verify the outcome the same way: sync status matches, health is Healthy, the rollout completed, and the user-facing symptom is gone in your observability data.

Where Opsphere fits

Argo CD shows the state of GitOps applications. It does not by itself explain why a pod could not be scheduled, which commit changed an error rate, or whether a cloud change preceded the failure. That evidence lives in Kubernetes, AWS, observability tools, CI/CD and GitHub, and investigations slow down when engineers switch between them.

Opsphere is designed as a read-only operational intelligence layer. It connects to the tools a team already uses, without requiring replacement, and brings operational context into one interface. In an Argo CD investigation, the aim is to let you inspect application state and correlate it with Kubernetes resources, cloud signals, observability data, pipeline runs and code changes. The platform includes more than 300 read-only operational tools and supports AI agents and Model Context Protocol (MCP) workflows. Opsphere does not replace Argo CD and does not change your applications automatically. Decisions to sync, roll back or edit Git stay with your team and your existing process.

Teams that want to see the access model can read about the MCP operational gateway, and platform teams can see how Opsphere supports platform engineering work. A Community plan is available at €0 per month, and the Developer plan is €19 per month; the pricing page lists every plan.

Opsphere

If your investigations regularly cross GitHub, Argo CD, Kubernetes and your monitoring stack, a single read-only view of the evidence shortens the path from alert to cause.

Keeping GitHub and Argo CD easier to debug

Some habits make the next incident shorter.

FAQ

Does OutOfSync always mean something is broken?

No. OutOfSync means the live state differs from Git. A new commit that has not been applied produces it, and so does a newly created Application. Read the diff to see whether the difference is a pending change, real drift or a field that controllers mutate.

Why is my application Synced but still Degraded?

Synced only says the cluster matches Git. Degraded says a resource is failing at runtime, for example pods that cannot schedule, crash on start or fail readiness probes. Investigate in Kubernetes events and application logs, and fix the cause through a Git change.

How fast does Argo CD pick up a GitHub commit?

By default, Argo CD polls Git every three minutes. A GitHub webhook pointed at /api/webhook can trigger a refresh sooner, but it only refreshes applications and does not deploy on its own. Whether the new revision is applied then depends on your sync policy.

Can Opsphere fix or sync my Argo CD applications?

No. Opsphere is a read-only operational intelligence layer. It helps you inspect application state and correlate it with Kubernetes, cloud, observability, CI/CD and code evidence. Remediation stays in your hands and in your Git workflow.

Next step

If you want one read-only place to inspect Argo CD application state next to Kubernetes, cloud, observability and code evidence, start with the Argo CD integration on Opsphere and connect it to a non-production environment first. START FREE TRIAL or BOOK A 20-MIN DEMO from the site to see the investigation workflow above on your own stack.

Sources

Opsphere
Discuss Your GitOps Challenges
Contact Opsphere to discuss how unified operational context can help your team investigate Argo CD and Kubernetes issues.

This article is provided for general informational purposes only and does not constitute professional, legal, security, or compliance advice. Please evaluate recommendations against your organization’s specific environment and requirements.