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

The ConfigMap is invalid: metadata.annotations: Too long: must have at most 262144 characters #5704

Closed
3 tasks done
abdennour opened this issue Mar 7, 2021 · 13 comments
Closed
3 tasks done
Labels
bug Something isn't working
Milestone

Comments

@abdennour
Copy link

If you are trying to resolve an environment-specific issue or have a one-off question about the edge case that does not require a feature then please consider asking a question in argocd slack channel.

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
configmap with big size cannot be synced thru ArgoCD while it can be deployed thru helm and other alternatives

To Reproduce

  1. Use jenkins helm chart or grafana helm chart or any chart accept evolved configmap(s)
  2. Try to put many things inside this configmap thru helm values.
  3. Try now to sync the app with ArgoCD.
  4. You have to see this error in "Sync Status"
ConfigMap "ARGOCD_APP_NAME" is invalid: metadata.annotations: Too long: must have at most 262144 bytes

Expected behavior

ArgoCD should apply the changes as long as there is no restriction from server ( etcd,... )

Screenshots

image

Version

argocd: v1.8.4+28aea3d
#.....
argocd-server: v1.8.4+28aea3d
#.....

Logs

ConfigMap is invalid: metadata.annotations: Too long: must have at most 262144 characters 

Duplicate of #820 . However, no way to get this one opened again while it's resolved and it's reproducable for more than 3 years

@abdennour abdennour added the bug Something isn't working label Mar 7, 2021
@rajivml
Copy link

rajivml commented Mar 7, 2021

I have also run into this just now and kinda stuck here
image

@abdennour
Copy link
Author

@rajivml just to get things done, i created configmap with kubectl :

  • if it's 1st time: use kubectl create -f ............ not kubect apply -f
  • if it's not 1st time: use kubectl replace -f .. not kubect apply -f

But note that the argocd app will be remaining in outOfSync status,, which is actually embarrassing me in front of the crew :(

@servo1x
Copy link

servo1x commented Mar 8, 2021

Related: #2730

@rajivml
Copy link

rajivml commented Mar 8, 2021

@abdennour do we have to do this manually instead through argoCD because argocd uses apply for everything ?

@abdennour
Copy link
Author

@rajivml Unfortunately , no way to do it thru ArgoCD. I just did it manually : i broke the whole the gitOps approach, and i provided ugly README.md to the team to do it if i was not there.

@abdennour
Copy link
Author

I opened issue on the related helm chart git repo jenkinsci/helm-charts#280
I am helping owners of this chart, to design it in a different way, so it can scale.

I would suggest to try to do the same with your charts where you are facing the same problem.

I know this issue is related initially with the executor ( ArgoCD), but let's help others with any way.

@abdennour
Copy link
Author

any deadline for fixing this issue ?
Could you , for example, patching the YAML before applying it ( removing the annotation last-applied-configuration , .. so on) ?
If the resource does not work because of this error, try to run k replace instead of k apply ?

@alexmt
Copy link
Collaborator

alexmt commented Mar 18, 2021

PR that introduces Replace=true sync option support has been merged. The sync option can be set per resource using argocd.argoproj.io/sync-options: Replace=true annotation or for the whole application.

Feature, will be available as part of v2.0-rc1 ( hopefully by end of tomorrow )

@alexmt alexmt added this to the v2.0 milestone Mar 18, 2021
@diranged
Copy link

@alexmt,
Are we sure that the feature actually solves the issue? I upgraded to 2.0.0-rc1 and we are still seeing Argo fail here. I have tried setting the syncOptions in the application itself as a test through the Web UI and that had no effect on the sync failing:

image

I also tried editing the live CRD resource and adding in that annotation:

$ k get crd kafkas.kafka.strimzi.io -o json | jq .metadata.annotations | grep argocd.argoproj.io/sync-options
  "argocd.argoproj.io/sync-options": "Replace=true",

And I get the same behavior as above.. and I know of no other way in a CRD installed by a Helm chart to add in that annotation. Am I missing something?

@diranged
Copy link

image

Here is our current argocd version tab..

@alexmt
Copy link
Collaborator

alexmt commented Mar 26, 2021

Hello @diranged ,

You are right, CRD case was not fixed. The kubectl replace is dangerous to use with CRDs since kubectl might delete and recreate it. Since CRDs are often causing too long annotation issue we added support as well: now Argo CD tries to use K8S update API if Replace=true sync option is specified. This change was merged yesterday and will be cherry-picked into 2.0

@alexmt
Copy link
Collaborator

alexmt commented Apr 2, 2021

The closing issue as a duplicate of #820

@armenr
Copy link

armenr commented Dec 29, 2021

I have also run into this, just today...and I have no clue how to debug this or otherwise fix/approach it.

This still appears to be an issue. I'm seeing it currently.

I tried to read around, google a bit, but haven't come up with much...and I'm not sure how to fix or debug this. ANY help would be much appreciated.

In ArgoCD, the Error being displayed is:

Failed sync attempt to fa68c5c19c15882e88f303478b91b9cabbec7d39: one or more objects failed to apply, reason: CustomResourceDefinition.apiextensions.k8s.io "applicationsets.argoproj.io" is invalid: metadata.annotations: Too long: must have at most 262144 bytes

I've adapted my approach by following the same pattern that argocd-autopilot takes with its bootstrap method...with my own slight modifications.

This is where the code lives: https://github.com/armenr/5thK8s/tree/main/dependencies/bootstrap

After installing and configuring argo-cd, this is the only file I kubectl apply -f in order to "bootstrap" all the other ArgoCD projects and apps:

https://github.com/armenr/5thK8s/blob/main/dependencies/bootstrap/autopilot-bootstrap.yaml

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

6 participants