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

one or more objects failed to apply, reason: error when patching "/dev/shm/1490806802": CronJob.batch "consumer" is invalid: spec.schedule: Required value (retried 5 times) #19584

Closed
3 tasks done
mathieux51 opened this issue Aug 19, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@mathieux51
Copy link

Checklist:

  • I've searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
  • I've included steps to reproduce the bug.
  • I've pasted the output of argocd version.

Describe the bug

I can't remove a cronjob. Removing the cronjob in the code will trigger the following error:

one or more objects failed to apply, reason: error when patching "/dev/shm/1490806802": CronJob.batch "consumer" is invalid: spec.schedule: Required value (retried 5 times)

If I leave the cronjob I get a failed sync and if I remove the cronjob I'm out of sync.
At first I thought it was related to #9226 or #10759 but as the hard refresh + restart of the application didn't do anything I'm not sure it's related anymore.

To Reproduce

Create a cronjob with this application chart:

application:
  cronJob:
    enabled: true
    jobs:
      consumer:
        schedule: "0 0 1 1 *"

Expected behavior

I'd expect the cronjob to be deleted.

Screenshots

image
image

Version

{
    "Version": "v2.12.1+26b2039",
    "BuildDate": "2024-08-16T16:42:13Z",
    "GitCommit": "26b2039a55b9bdf807a70d344af8ade5171d3d39",
    "GitTreeState": "clean",
    "GoVersion": "go1.22.4",
    "Compiler": "gc",
    "Platform": "linux/amd64",
    "KustomizeVersion": "v5.4.2 2024-05-22T15:19:38Z",
    "HelmVersion": "v3.15.2+g1a500d5",
    "KubectlVersion": "v0.29.6",
    "JsonnetVersion": "v0.20.0"
}

Logs

Didn't anything special in the logs

@mathieux51 mathieux51 added the bug Something isn't working label Aug 19, 2024
@mathieux51
Copy link
Author

I struggled for a week on this and then 5 minutes after I create this Github issue, I managed to fix it 🙈. If you experience something similar this is what worked for me:

  • edited the YAML of my application kind: Application (apiVersion: argoproj.io/v1alpha1)
  • removed the references to the cronjob
  • synced the ArgoCD appliation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant