# Can't create Cron jobs

**URL:** <https://forums.suse.com/t/cant-create-cron-jobs/14386>\
**Category:** SUSE Rancher Prime\
**Created:** [May 27, 2019, 1:34am UTC](https://forums.suse.com/t/cant-create-cron-jobs/14386 "2019-05-27T01:34:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![gonzalo.martinez](https://avatars.discourse-cdn.com/v4/letter/g/278dde/32.png) [@gonzalo.martinez](https://forums.suse.com/u/gonzalo.martinez)\
**Post date:** [May 27, 2019, 1:34am UTC](https://forums.suse.com/t/cant-create-cron-jobs/14386/1 "2019-05-27T01:34:26Z")

</div>

Hello guys.

I’m trying to create a Cron Job on Rancher UI, but no matter what I put on the field for the cron specification (for example “0 \* \* \* \*”,"@hourly" or anything), I always receive this error when pressing the “Launch” button:

“Validation failed in API: CronJob.batch “rapi-scheduler” is invalid: spec.jobTemplate.spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{“controller-uid”:“159b276c-801f-11e9-b31c-0a1076b70042”}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: `selector` will be auto-generated”

Honestly, I don’t understand what is it.

If I create a normal job (not croned), it works without any issue, so neither the container nor the command are the problem.

Can someone help me?

---

<div class="post-metadata">

**Author:** ![toms049](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/toms049/32/4874_2.png) [@toms049](https://forums.suse.com/u/toms049)\
**Post date:** [June 25, 2019, 9:03pm UTC](https://forums.suse.com/t/cant-create-cron-jobs/14386/2 "2019-06-25T21:03:57Z")

</div>

Hi, i am having the same problem. Tried to solve it, but no luck yet.  
I can create normal jobs, everything works, but can not create CronJobs.

Rancher version 2.2.4.

Do not know what “spec.jobTemplate.spec.selector” means. Could not find anything that could help.  
Is someone having sorted this or similar provlem?  
Thanks  
TomS

---

<div class="post-metadata">

**Author:** ![cjellick](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/cjellick/32/2876_2.png) [@cjellick](https://forums.suse.com/u/cjellick)\
**Post date:** [June 28, 2019, 5:33pm UTC](https://forums.suse.com/t/cant-create-cron-jobs/14386/3 "2019-06-28T17:33:47Z")

</div>

are there any other fields you are setting? like, further down in the UI?

---

<div class="post-metadata">

**Author:** ![mrmiagi](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/mrmiagi/32/5394_2.png) [@mrmiagi](https://forums.suse.com/u/mrmiagi)\
**Post date:** [July 10, 2019, 7:37am UTC](https://forums.suse.com/t/cant-create-cron-jobs/14386/4 "2019-07-10T07:37:23Z")

</div>

Had the same issue.  
Turns out that this only happens when I try to clone from an existing workload which is configured as “Scalable Deployment” and then changing it to “Cronjob”.  
Looks pretty much like a bug, anyways creating a fresh workload instead of cloning an existing one solved it for me.

---

<div class="post-metadata">

**Author:** ![ksv510](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/ksv510/32/6933_2.png) [@ksv510](https://forums.suse.com/u/ksv510)\
**Post date:** [July 22, 2019, 12:30pm UTC](https://forums.suse.com/t/cant-create-cron-jobs/14386/5 "2019-07-22T12:30:01Z")

</div>

I have the same issue, is there any solution?

---

<div class="post-metadata">

**Author:** ![mober\_muncha](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/mober_muncha/32/7512_2.png) [@mober\_muncha](https://forums.suse.com/u/mober_muncha)\
**Post date:** [April 27, 2021, 8:37pm UTC](https://forums.suse.com/t/cant-create-cron-jobs/14386/6 "2021-04-27T20:37:49Z")

</div>

Hey don’t know if this is still an issue but I just had to create a cronjob in rancher 2.4.x and this is now an UI version. Also you can write the yaml file with a:

apiVersion: batch/v1beta1  
kind: CronJob  
metadata:

One thing to note, it does appear that you can’t use / or other cronjob abbreviations. So I had to explicitly say run at 0,30.
