Skip to content

Instantly share code, notes, and snippets.

@tnm
Created October 28, 2025 23:06
Show Gist options
  • Select an option

  • Save tnm/f4a021b43fb545d47d1840b0789ba9fd to your computer and use it in GitHub Desktop.

Select an option

Save tnm/f4a021b43fb545d47d1840b0789ba9fd to your computer and use it in GitHub Desktop.
Debugging 502 Errors (No DNS Issues) - Cased CD Enterprise

Debugging 502 Errors (No DNS Issues) - Josh

Good news: The DNS fix worked! No more DNS timeout errors. Bad news: Now getting 502 errors for a different reason.

The 502 without DNS errors means nginx can resolve the hostname but can't connect to the enterprise backend. Let's debug:

Step 1: Check Pod Status

kubectl get pods -n argocd -l app.kubernetes.io/name=cased-cd

Expected: Both cased-cd-* and cased-cd-enterprise-* should be Running and Ready (1/1)

Step 2: Check Enterprise Pod Logs

kubectl logs -n argocd deployment/cased-cd-enterprise --tail=50

Looking for:

  • Startup errors
  • Crash loops
  • Port binding issues
  • Any error messages

Step 3: Check Services

kubectl get svc -n argocd | grep cased-cd

Expected: Should see both services:

  • cased-cd (port 80)
  • cased-cd-enterprise (port 8081)

Step 4: Check Service Endpoints

kubectl get endpoints -n argocd cased-cd-enterprise

Expected: Should show the pod IP and port 8081 Problem if: Shows <none> - means service selector doesn't match pod labels

Step 5: Check Frontend Pod Logs

kubectl logs -n argocd deployment/cased-cd --tail=50

Looking for:

  • Connection refused errors to enterprise backend
  • Any proxy errors

Step 6: Test Direct Connection to Enterprise

# Port forward directly to enterprise pod
kubectl port-forward -n argocd deployment/cased-cd-enterprise 8081:8081 &

# Test the health endpoint
curl http://localhost:8081/health

# Kill the port forward
pkill -f "port-forward.*8081"

Expected: Should return health check response Problem if: Connection refused or timeout

Step 7: Check Pod Describe for Issues

kubectl describe pod -n argocd -l app.kubernetes.io/component=enterprise

Looking for:

  • ImagePullBackOff
  • CrashLoopBackOff
  • Failed to pull image errors
  • Readiness probe failures

Common Causes

  1. ImagePullBackOff: Wrong registry credentials or image doesn't exist
  2. CrashLoopBackOff: Enterprise pod keeps crashing (check logs in Step 2)
  3. Service selector mismatch: Service can't find the pod (check Step 4)
  4. Readiness probe failing: Pod exists but not passing health checks

Please share the output of all 7 steps above

Copy/paste all the outputs so we can see what's happening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment