Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cronjob suspend failed #4842

Closed
Allen-yan opened this issue Oct 15, 2020 · 8 comments
Closed

cronjob suspend failed #4842

Allen-yan opened this issue Oct 15, 2020 · 8 comments

Comments

@Allen-yan
Copy link

What kind of request is this bug:

Steps to reproduce (least amount of steps as possible):

  1. create a cronjob in rancher UI
  2. REDEPLOY it
  3. suspend it
  4. refresh the UI ,

Result:
The cronjob is active and the suspended icon disappeared ...

Other details that may be helpful:
The PUT request's response:
"CronJob.batch "update-b-asset-withdraw" is invalid: spec.jobTemplate.spec.template.spec.restartPolicy: Unsupported value: "Always": supported values: "OnFailure", "Never"

REDEPLOY button update the cronjob's metadata restartPolicy to "Always" , but cronjob does not support it.
So when I suspend the job , failed

Environment information

  • Rancher version (rancher/rancher/rancher/server image tag or shown bottom left in the UI):
  • Installation option (single install/HA):

rancher/rancher v2.3.4

gz#13569

@sadhugit
Copy link

The above-mentioned problem exists in v2.4.x & upgraded setups( v2.4.x to v2.5.2) But On a fresh install of v2.5.1 or v2.5.2, they cannot reproduce the issue because it's sending the right parameter ("restartPolicy":"Never").

The main culprit is "restartPolicy": "Always" parameter is passed while performing the suspend cron job operation, and the expected value is "restart policy: Never." Due to that, suspend operation is returned with status code422. And when you refresh the page, it shows the cronjob is active because the previous operation is not completed successfully and failed with the below error message:

{"baseType":"error","code":"Invalid","message":"CronJob.batch "testcron" is invalid: spec.jobTemplate.spec.template.spec.restartPolicy: Unsupported value: "Always": supported values: "OnFailure", "Never"","status":422,"type":"error"}

@sadhugit
Copy link

Hi Team, Any update on this.

@gaktive gaktive transferred this issue from rancher/rancher Dec 30, 2021
@gaktive gaktive added this to the v2.6.4 milestone Dec 30, 2021
@gaktive
Copy link
Member

gaktive commented Dec 30, 2021

Internal reference: SURE-2605

Not sure what can be fixed here based on Vue and Ember, especially if 2.5.1+ resolves this. Need to investigate.

@nwmac
Copy link
Member

nwmac commented Feb 24, 2022

Checking the code for 2.6.4, it looks like the dashboard does the right thing here.

@nwmac
Copy link
Member

nwmac commented Feb 24, 2022

Verified on 2.6.4 in old UI - no longer an issue.

@samjustus
Copy link

@nwmac @Jono-SUSE-Rancher what does team 1 need to do here? No longer an issue?

@maxsokolovsky
Copy link

Dev-validated in new UI of 2.6-head (e4af246, close tov2.6.4 release), could not reproduce the issue.

@Allen-yan, maybe I am missing something about CronJobs, but what does redeploying entail? If I modify its labels and even image, then the same cronjob still exists and isn't really redeployed, only its jobs and ultimately pods will be different when it's time to run another job.

@sowmyav27
Copy link

On 2.6-head c2d8e32

  • Deployed a Cron JOb.
  • Clicked on Suspend. restartPolicy: "Never" is sent in the request
  • Refresh the UI, the Cron Job is still in suspended state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants