<p>I've created and pushed a cron job to deployment, but when I see it running in OpenShift, I get the following error message:</p>
<blockquote>
<p>Cannot determine if job needs to be started: Too many missed start time (&gt; 100). Set or decrease .spec.startingDeadlineSeconds or check clock skew.</p>
</blockquote>
<p>From what I understand by this, is that a job failed to run. But I don't understand why it is failing. Why isn't that logged somewhere? - or if it is, where can I find it?</p>
<p>The CronJob controller will keep trying to start a job according to the most recent schedule, but keeps failing and obviously it has done so &gt;100 times.</p>
<p>I've checked the syntax of my cron job, which doesn't give any errors. Also if there are any syntax messages, I'm not even allowed to push.</p>
<p>Anyone know what's wrong?</p>
<p>my Cron Job:</p>
<pre><code>apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: my-cjob
  labels:
    job-name: my-cjob
spec:
  schedule: &quot;*/5 * * * *&quot; 
  # activeDeadlineSeconds: 180 # 3 min &lt;&lt;- should this help and why?      
  jobTemplate:
      spec:
        template:         
          metadata:
            name: my-cjob
            labels:
              job-name: my-cjob
          spec:
            containers:
            - name: my-cjob
              image: my-image-name
            restartPolicy: OnFailure
</code></pre>
<p>Or should I be using <code>startingDeadlineSeconds</code>? Anyone who has hit this error message and found a solution?</p>
<p><strong>Update as according to comment</strong></p>
<p>When running <code>kubectl get cronjob</code> I get the following:</p>
<pre><code>NAME           SCHEDULE      SUSPEND   ACTIVE    LAST SCHEDULE   AGE
my-cjob        */5 * * * *   False     0         &lt;none&gt;          2d
</code></pre>
<p>When running <code>kubectl logs my-cjob</code> I get the following:</p>
<pre><code>Error from server (NotFound): pods &quot;my-cjob&quot; not found
</code></pre>
<p>When running <code>kubectl describe cronjob my-cjob</code> I get the following:</p>
<pre><code>Error from server (NotFound): the server could not find the requested resource
</code></pre>
<p>When running <code>kubectl logs &lt;cronjob-pod-name&gt;</code> I get many lines o code... Very difficult for me to understand and sort out..</p>
<p>When running <code>kubectl describe pod &lt;cronjob-pod-name&gt;</code> I also get a lot, but this is way easier to sort. Anything specific?</p>
<p>Running <code>kubectl get events</code> I get a lot, but I think this is the related one:</p>
<pre><code>LAST SEEN   FIRST SEEN   COUNT     NAME                                            KIND                    SUBOBJECT                                 TYPE      REASON              SOURCE                                      MESSAGE
1h          1h           2         xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx             Pod                     spec.containers{apiproxy}                 Warning   Unhealthy           kubelet, xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx   Liveness probe failed: Get http://xxxx/xxxx: dial tcp xxxx:8080: connect: connection refused
</code></pre>

nelion
<p>Setting the startingDeadlineSeconds to 180 fixed the problem + removing the spec.template.metadata.labels.</p>
