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

Kustomize kyaml panic on duplicate keys #243

Closed
jonaskello opened this issue Jan 18, 2021 · 2 comments · Fixed by #241
Closed

Kustomize kyaml panic on duplicate keys #243

jonaskello opened this issue Jan 18, 2021 · 2 comments · Fixed by #241
Labels
area/kustomize Kustomize related issues and pull requests bug Something isn't working

Comments

@jonaskello
Copy link

I got the kustomizations stuck in "reconciliation in progress". When I checked the logs of the kustomization controller:

{"level":"info","ts":"2021-01-18T07:10:57.568Z","logger":"controller.kustomization","msg":"Starting workers","reconciler group":"kustomize.toolkit.fluxcd.io","reconciler kind":"Kustomization","worker count":4}
2021/01/18 07:10:59 failed to decode ynode: yaml: unmarshal errors:
  line 21: mapping key "env" already defined at line 18

And sure enough there was a yaml file that had the env key twice. However it was a bit hard to find which yaml. I have a multi-tenant setup (not sure if that is relevant) and the env key was present twice on an app manifest.

I would be nice if flux would error out the kustomization on this instead of hanging on "reconciliation in progress" and present the error on the kustomization object it pertains to.

@stefanprodan
Copy link
Member

We can't log the object or manifest that triggers this since kustomize kyaml errors don't contain any information.

Using a deployment that declares two env keys, this is what kustomize build outputs:

$ kustomize build --enable_kyaml=true
2021/01/18 13:21:50 failed to decode ynode: yaml: unmarshal errors:
  line 50: mapping key "env" already defined at line 47

Note that kyaml doesn't return an error, instead it panics and crashed the whole controller, that's why the reconciliation is stuck.

The only thing we can do is disable kyaml in kustomize-controller, see #241

@stefanprodan stefanprodan transferred this issue from fluxcd/flux2 Jan 18, 2021
@stefanprodan stefanprodan changed the title Stuck in reconciliation in progress Kustomize kyaml panic on duplicate keys Jan 18, 2021
@stefanprodan stefanprodan added area/kustomize Kustomize related issues and pull requests bug Something isn't working labels Jan 18, 2021
@stefanprodan
Copy link
Member

I opened kubernetes-sigs/kustomize#3480

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kustomize Kustomize related issues and pull requests bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants