How to fix Startup probe failed: HTTP probe failed with statuscode: 500 in Kubernetes
A container fails startup probe checks repeatedly, causing it to restart continuously (CrashLoopBackOff). Startup probes verify the application has started before liveness and readiness probes begin. Fix by increasing failureThreshold, adjusting periodSeconds, or ensuring the health endpoint is accessible during startup.
Quick fix
Fixes Startup probe failed: HTTP probe failed with statuscode: 500
kubectl get pod <pod-name> -n <namespace>
kubectl describe pod <pod-name> -n <namespace>- Check pod status and restart history
- Review startup probe configuration
- Increase failureThreshold
- Adjust periodSeconds for faster checks
kubectl get pod <pod-name> -n <namespace>kubectl describe pod <pod-name> -n <namespace>Startup probe failed: HTTP probe failed with statuscode: 500
What this error means
A startup probe verifies that an application inside a container has started. It runs only at pod startup and blocks liveness and readiness probes from running until it succeeds. If the startup probe fails repeatedly (based on failureThreshold), kubelet restarts the container. Startup probes are designed for slow-starting applications (database migrations, cache warming, large initialization). Without startup probes, liveness probes may kill containers before they finish starting. The total startup window is failureThreshold × periodSeconds.
Typical symptoms
- Pod enters CrashLoopBackOff state immediately
- Container keeps restarting without reaching Running state
- Events show "Startup probe failed"
- Container logs indicate application still initializing when probe runs
- Pod eventually becomes healthy if given more time but killed before reaching it
- Azure Kubernetes Service or other cloud deployments showing repeated restarts
Common causes
- failureThreshold × periodSeconds too short for application startup
- Probe endpoint not available during initialization
- Wrong port, path, or protocol in probe configuration
- Application requires time for database migrations, dependency loading
- Resource constraints (CPU/memory) slowing startup
- External dependencies (database, cache) unavailable at startup
How to fix "Startup probe failed: HTTP probe failed with statuscode: 500"
View repeated restarts:
kubectl get pod <pod-name> -n <namespace>
kubectl describe pod <pod-name> -n <namespace>Expect high restart count and reason "Unhealthy".
Check the probe settings:
kubectl get pod <pod-name> -n <namespace> -o yaml | grep -A10 startupProbeNote failureThreshold and periodSeconds.
Allow more time for startup:
startupProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 30
periodSeconds: 10
failureThreshold: 30 # ~300 seconds total = 30 * 10sFor slow apps (Java with migrations): use failureThreshold: 60-90.
Check more frequently if needed:
startupProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 30
periodSeconds: 5 # Check every 5 seconds instead of 10
failureThreshold: 60 # 300 seconds = 60 * 5sTest manually if possible:
kubectl logs <pod-name> -n <namespace>
grep -i health /var/log/app.log # Check app logs for endpoint startupEndpoint may not be listening immediately.
TCP probes are simpler for startup:
startupProbe:
tcpSocket:
port: 8080
initialDelaySeconds: 5
periodSeconds: 5
failureThreshold: 30This just checks if port is listening, doesn't require HTTP endpoint.
Identify why startup is slow:
kubectl logs <pod-name> -n <namespace> | grep -i "starting|initializing|migration|timeout"Database migrations and dependency initialization often cause delays.
Resource starvation slows startup:
resources:
requests:
cpu: 500m
memory: 512Mi
limits:
cpu: 1000m
memory: 1GiCheck actual usage:
kubectl top pod <pod-name> -n <namespace>Advanced notes
Total startup window = failureThreshold × periodSeconds. For 5-minute startup, use failureThreshold: 30, periodSeconds: 10. Startup probes block liveness and readiness probes; once startup succeeds, those take over. For slow-starting apps (Java, Python with heavy initialization), startup probes are essential to prevent premature container kills. Use TCP socket probes for connectivity checks (faster, no HTTP overhead). HTTP probes require application to expose health endpoint during startup. Startup probes with liveness and readiness create three independent checks, each with different failure thresholds. Monitor container startup time in logs to tune failureThreshold appropriately. For cloud deployments, check cloud platform documentation for default timeouts that may override your configuration.
Frequently asked questions
- What does "Startup probe failed: HTTP probe failed with statuscode: 500" mean?
- A startup probe verifies that an application inside a container has started. It runs only at pod startup and blocks liveness and readiness probes from running until it succeeds. If the startup probe fails repeatedly (based on failureThreshold), kubelet restarts the container.
- How do I fix "Startup probe failed: HTTP probe failed with statuscode: 500"?
- A container fails startup probe checks repeatedly, causing it to restart continuously (CrashLoopBackOff). Startup probes verify the application has started before liveness and readiness probes begin. Fix by increasing failureThreshold, adjusting periodSeconds, or ensuring the health endpoint is accessible during startup.
- What causes "Startup probe failed: HTTP probe failed with statuscode: 500"?
- failureThreshold × periodSeconds too short for application startup Probe endpoint not available during initialization Wrong port, path, or protocol in probe configuration
- Is the "Startup probe failed: HTTP probe failed with statuscode: 500" error serious?
- Yes. This is a high-severity error that usually blocks work until it is fixed, but the steps above resolve it.