-
Notifications
You must be signed in to change notification settings - Fork 609
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
v0.6.1 fails to upgrade with kustomize build error json: unsupported type: map[interface {}]interface {} #729
Comments
How are we supposed to track this down? can you please post the bootstrap output, the full file tree of your repo and kustomize-controller logs. |
The file structure is fairly simple, cluster folder inside the root of the git repo and then inside that is flux-sytstem folder. I do not have a bootstrap output to provide, but here is the command I run from a CI script to perform the update:
kustomization log:
► checking prerequisites |
I guess it’s related to kubernetes-sigs/kustomize#3446 |
Is there something I can do on my end to use the latest version of kustomize or ? |
You could help out by identifying which file causes this, as this doesn't happen in our e2e tests and I have no way to replicate the kustomize bug. |
I'd be happy to if I even knew where to start on this, everything was fine on v0.5.3, none of my cluster files changed, so the upgrade to v0.6.1 should of went off without a hitch. Is there any way to have Flux display the filename when it throws the exception? The problem is even with a fairly simple file structure I still have lots of helm releases and deployments, so ... |
We use kustomize as a library and looks like kustomize build doesn't log anything useful, so we are stuck. See my comment here kubernetes-sigs/kustomize#3446 (comment) |
I suppose what I could do is just download kustomize binary and dry-run test against my cluster folder structure and see what pops, just surprised I'm the first person reporting this issue. |
OK, so I ran Kustomize v3.9.1 against flux-system folder as it's the only Kustomization I have present in my cluster repo and it passed no problem, so I wonder what their latest API version is actually built against ... |
Flux code does the equivalent of |
@echel0n can you please run |
same issue with this image as well
|
Ok, let's try the latest kustomize released today api/v0.7.2, here is the image:
|
testing now, will report back shortly |
{"level":"error","ts":"2021-01-17T20:46:52.028Z","logger":"controller.kustomization","msg":"Reconciler error","reconciler group":"kustomize.toolkit.fluxcd.io","reconciler kind":"Kustomization","name":"flux-system","namespace":"flux-system","error":"kustomize build failed: error marshaling into JSON: json: unsupported type: map[interface {}]interface {}"} |
Hmm do you have kustomization.yaml in your ./cluster or it’s autogenerated by Flux? |
I do not have any kustomization.yaml in my cluster, only using what Flux auto-generates, I was going to ask how does Flux auto-generate the file as what I have yet to test is creating a kustomization.yaml file that contains all my deployments and helm releases. |
Ok please do:
The above will generate the same kustomization.yaml as Flux. You can commit this file to your repo to have full control over what manifests are included. |
OK, so I tried what you asked on both Windows and Linux, no issues at all, so the bug must be present in the API, all I can think of, unless you have a way for me to test the API as well ? |
And typically I would just start removing deployments one by one till the issue is gone, but this is a production cluster so I don't want to uninstall anything. |
What's different between v0.5.3 and the next version after, cause I remember trying the version after that and got this same error. |
kustomize-controller:v0.6.0 fails so whatever changed between those 2 versions is what is causing this, and from what I can see the only real change was the upgrade to API v0.7.1 |
Have you committed the generated kustomization.yaml, does it error out the same? |
When you say committed, are you asking me to apply that to my live cluster? I'm hesitant to do that on this production cluster. In the other issue thread, you referenced you can see the person produced the same error simply by running the build command, so I would have thought we would be able to reproduce it the same way. Does Flux do any formatting of any kind prior to building the kustomization.yaml ? |
No, you can’t apply a kustomize config, it’s not a custom resource. You should commit and push that file to your repository, for Flux to use it instead of generating one. |
ok, committed and pushed, will let you know the outcome shortly. |
same error as before using v0.6.2 controller |
going through and commenting out one by one till I get a pass, will let you know what comes of this |
so would you believe this is what caused the issue, switched from int to str for keys and all was fixed, int keys are how ingress-nginx actually specifies in their documentation, anyways thank you very much for all your hard efforts, I hope this helps you and others down the road!
|
Reopening as this is not yet fixed. |
I still get errors when trying to build this one:
Did you manage to work trough this @echel0n ? You see, I have all my keys as ints. |
@echel0n you can't use integer keys in your YAMLs due to this upstream bug: kubernetes-sigs/kustomize#3446 The only way to fix this is by making it a string:
|
Thanks for having this conversation in the open here. I had the same problem (cryptic failures mentioning I changed the keys to strings and this fixed it for me, too. |
reconcile: Set observed gen only when conditions exist
When attempting to upgrade from v0.5.3 to v0.6.1 I get the following error below:
json: unsupported type: map[interface {}]interface {}
The text was updated successfully, but these errors were encountered: