How to fix Job not found in Kubernetes
A Job that was previously running or scheduled has become unavailable. This occurs when Jobs are deleted, garbage collected due to TTL settings, or removed by parent resources. Resolve by checking Job history, TTL configuration, and cleanup policies.
Quick fix
Fixes Job not found
kubectl get jobs
kubectl get jobs --all-namespaces
kubectl get jobs --all-namespaces | grep <job-name>- List all jobs to verify existence
- Verify the correct namespace
- Check job history and TTL settings
- Look for orphaned pods from deleted job
kubectl get jobskubectl get jobs --all-namespaceskubectl get jobs --all-namespaces | grep <job-name>Job not found
What this error means
This error occurs when kubectl or applications cannot locate an expected Kubernetes Job resource. Jobs can disappear through explicit deletion, TTL-based auto-cleanup, cascade deletion from parent CronJobs, or garbage collection. Understanding Job lifecycle and retention policies is essential for troubleshooting.
Typical symptoms
- kubectl get job returns "not found" error
- Job disappears after successful completion
- CronJob cannot find previously created Job objects
- Job references show dangling references in events
- Application cannot retrieve Job status or logs
- Pod events indicate Job deletion due to TTL
- Job history is empty or missing expected entries
Common causes
- Job explicitly deleted with kubectl delete
- TTL (ttlSecondsAfterFinished) expired for completed Job
- Parent CronJob deleted, triggering cascade deletion
- Successful jobs cleaned up by successfulJobsHistoryLimit
- Failed garbage collection or etcd corruption
- Job ownership changed, affecting deletion behavior
- Race condition between completion and status check
How to fix "Job not found"
Check if the job exists in your current namespace:
kubectl get jobs
kubectl get jobs --all-namespaces
kubectl get jobs --all-namespaces | grep <job-name>If the job exists but kubectl can't find it, check namespace:
kubectl config view --minify --output='jsonpath={..namespace}'
kubectl config set-context --current --namespace=<namespace>
kubectl get job <job-name> -n <namespace>View completed jobs that may have been garbage collected:
kubectl get jobs --show-kind --all-namespaces
kubectl get job <job-name> -o yaml | grep -A2 ttlSecondsAfterFinishedIf the job was deleted, its pods may still exist:
kubectl get pods --all-namespaces -l job-name=<job-name>
kubectl delete pods -l job-name=<job-name>If the job needs to be rerun:
kubectl apply -f job.yamlIf jobs are disappearing too quickly, increase TTL:
spec:
ttlSecondsAfterFinished: 3600 # Keep for 1 hourIf created by CronJob:
kubectl get cronjobs
kubectl describe cronjob <cronjob-name>
kubectl get jobs -l cron-job=<cronjob-name>Advanced notes
Jobs are immutable after creation. To make changes, delete and recreate the job. For long-running or important jobs, set ttlSecondsAfterFinished to a large value or null to disable automatic cleanup. When a Job is deleted, its child pods are typically deleted due to ownerRef garbage collection.
Frequently asked questions
- What does "Job not found" mean?
- This error occurs when kubectl or applications cannot locate an expected Kubernetes Job resource. Jobs can disappear through explicit deletion, TTL-based auto-cleanup, cascade deletion from parent CronJobs, or garbage collection. Understanding Job lifecycle and retention policies is essential for troubleshooting.
- How do I fix "Job not found"?
- A Job that was previously running or scheduled has become unavailable. This occurs when Jobs are deleted, garbage collected due to TTL settings, or removed by parent resources. Resolve by checking Job history, TTL configuration, and cleanup policies.
- What causes "Job not found"?
- Job explicitly deleted with kubectl delete TTL (ttlSecondsAfterFinished) expired for completed Job Parent CronJob deleted, triggering cascade deletion
- Is the "Job not found" error serious?
- It is a medium-severity error โ more of a blocker than a risk. The steps above resolve it.
Official resources & further reading
- ๐Kubernetes Official Documentation
- ๐K8s: Jobs(Official Docs)
- ๐K8s GitHub Issues(GitHub)
- ๐ฌSO: K8s Jobs(Stack Overflow)