You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Cluster stuck in "Setting up primary" when instance creation Job fails #11042
When restoring or bootstrapping a cluster, if the instance creation Job exhausts its backoff limit and terminates with a BackoffLimitExceeded failure, the cluster remains stuck in the "Setting up primary" phase indefinitely.
The operator counts the failed Job as still running, so reconciliation keeps waiting on it forever without surfacing the failure. Operators have no indication that the restore has failed — the cluster simply never progresses.
Expected Behavior
When an instance creation Job reaches a terminal JobFailed condition, the cluster should transition to the unrecoverable phase with a clear reason pointing to the failed Job and its logs. Jobs that are still legitimately retrying within their backoff limit should be left untouched — only terminal failures should trigger this transition.
This issue is already being addressed in PR #11035, which introduces explicit detection of terminal JobFailed conditions (including BackoffLimitExceeded) and transitions the cluster to PhaseUnrecoverable with a clear failure reason pointing to the failed Job.
The root cause is that the reconciliation loop's runningJobNames() guard historically relied on Status.Succeeded counts to determine Job completion — a terminal failure was indistinguishable from a still-running Job, causing the cluster to poll indefinitely at 5-second intervals [1].
The fix adds a JobHasFailed(job) utility in pkg/utils/job_conditions.go that checks for the batchv1.JobFailed condition, and a failedJobNames() method to collect permanently failed Jobs. Failed Jobs are preserved for investigation rather than cleaned up [2].
There's also a related feature request in #10733 proposing a Provisioning condition on cluster.status.conditions to surface provisioning failures (quota exceeded, admission denials, scheduling constraints) that occur before the Job even creates a Pod — complementary to this fix which handles failures after the Job has started running.
Activity
dosubot commentedon Jun 25, 2026
This issue is already being addressed in PR #11035, which introduces explicit detection of terminal
JobFailedconditions (includingBackoffLimitExceeded) and transitions the cluster toPhaseUnrecoverablewith a clear failure reason pointing to the failed Job.The root cause is that the reconciliation loop's
runningJobNames()guard historically relied onStatus.Succeededcounts to determine Job completion — a terminal failure was indistinguishable from a still-running Job, causing the cluster to poll indefinitely at 5-second intervals [1].The fix adds a
JobHasFailed(job)utility inpkg/utils/job_conditions.gothat checks for thebatchv1.JobFailedcondition, and afailedJobNames()method to collect permanently failed Jobs. Failed Jobs are preserved for investigation rather than cleaned up [2].There's also a related feature request in #10733 proposing a
Provisioningcondition oncluster.status.conditionsto surface provisioning failures (quota exceeded, admission denials, scheduling constraints) that occur before the Job even creates a Pod — complementary to this fix which handles failures after the Job has started running.To reply, just mention @dosu.
Share context across your team and agents. Try Dosu.
fix: report failed instance creation jobs instead of waiting forever (#…
fix: report failed instance creation jobs instead of waiting forever (#…
fix: report failed instance creation jobs instead of waiting forever (#…
fix: report failed instance creation jobs instead of waiting forever (#…