Kustomize: Key error messages are not available in some condition

Created on 15 Mar 2020  路  7Comments  路  Source: kubernetes-sigs/kustomize

Kustomize may encounter multiple errors during build, but sometimes only the last one is displayed. This makes it hard for user find out the root cause.

For example, given the error message below

Error: accumulating resources: accumulateFile "accumulating resources from 'https://github.com/kustless/kustomize-examples/archive/master.zip//kustomize-example-master': YAML file [https://github.com/kustless/kustomize-examples/archive/master.zip//kustomize-example-master] encounters a format error.\nerror converting YAML to JSON: yaml: line 134: mapping values are not allowed in this context\n", loader.New "evalsymlink failure on '/private/var/folders/k9/wwyq7x_n5jvbb68q7c0mbblm0000gn/T/kustomize-418159327/archive/master.zip/kustomize-example-master' : lstat /private/var/folders/k9/wwyq7x_n5jvbb68q7c0mbblm0000gn/T/kustomize-418159327/archive: no such file or directory"

The user has no idea about the actual error subdir "kustomize-example-master" not found returned from remote getter.

The limitation is cause by newLoaderAtConfirmedDir, which never returns an error. The error detection is delayed to later stage, where the previous errors (in git clone or remote get) are no longer available.

We need a better mechanism to show the error stack to make kustomize more user friendly.

areapi kinfeature prioritbacklog triagaccepted

Most helpful comment

This is really hard to debug indeed... Any advice for how to troubleshoot this?

Running make apply as part of this guide:
https://www.kubeflow.org/docs/gke/deploy/deploy-cli/#deploy-kubeflow

and getting the following:

Error: accumulating resources: accumulateFile "accumulating resources from '../../../upstream/manifests/stacks/gcp': read /Users/thophile/relyance-kf/upstream/manifests/stacks/gcp: is a directory", accumulateDirector: "recursed accumulation of path '/Users/thophile/relyance-kf/upstream/manifests/stacks/gcp': accumulating resources: accumulateFile \"accumulating resources from '../../pipeline/installs/multi-user': read /Users/thophile/relyance-kf/upstream/manifests/pipeline/installs/multi-user: is a directory\", accumulateDirector: \"recursed accumulation of path '/Users/thophile/relyance-kf/upstream/manifests/pipeline/installs/multi-user': accumulating resources: accumulateFile \\\"accumulating resources from 'api-service': read /Users/thophile/relyance-kf/upstream/manifests/pipeline/installs/multi-user/api-service: is a directory\\\", accumulateDirector: \\\"couldn't make target for path '/Users/thophile/relyance-kf/upstream/manifests/pipeline/installs/multi-user/api-service': json: unknown field \\\\\\\"env\\\\\\\"\\\"\""

All 7 comments

please fix this.

For now is there any way to get to those error-messages?

Still a problem

This is really hard to debug indeed... Any advice for how to troubleshoot this?

Running make apply as part of this guide:
https://www.kubeflow.org/docs/gke/deploy/deploy-cli/#deploy-kubeflow

and getting the following:

Error: accumulating resources: accumulateFile "accumulating resources from '../../../upstream/manifests/stacks/gcp': read /Users/thophile/relyance-kf/upstream/manifests/stacks/gcp: is a directory", accumulateDirector: "recursed accumulation of path '/Users/thophile/relyance-kf/upstream/manifests/stacks/gcp': accumulating resources: accumulateFile \"accumulating resources from '../../pipeline/installs/multi-user': read /Users/thophile/relyance-kf/upstream/manifests/pipeline/installs/multi-user: is a directory\", accumulateDirector: \"recursed accumulation of path '/Users/thophile/relyance-kf/upstream/manifests/pipeline/installs/multi-user': accumulating resources: accumulateFile \\\"accumulating resources from 'api-service': read /Users/thophile/relyance-kf/upstream/manifests/pipeline/installs/multi-user/api-service: is a directory\\\", accumulateDirector: \\\"couldn't make target for path '/Users/thophile/relyance-kf/upstream/manifests/pipeline/installs/multi-user/api-service': json: unknown field \\\\\\\"env\\\\\\\"\\\"\""

I solved it by add option --load_restrictor none.

kustomize build --load_restrictor none  </your/path>

Same error for me even with --load_restrictor none .

Consider using https://github.com/hashicorp/go-multierror to aggregate errors.

/assign

Was this page helpful?
0 / 5 - 0 ratings

Related issues

drekle picture drekle  路  4Comments

bcbrockway picture bcbrockway  路  5Comments

pst picture pst  路  4Comments

davidsbond picture davidsbond  路  3Comments

Liujingfang1 picture Liujingfang1  路  4Comments