Skip to content
Latchkey

kustomize "trouble configuring builtin ... plugin" in CI

kustomize configures its builtin transformers and generators from your kustomization fields. "trouble configuring builtin ... plugin" means one of those fields is malformed, misnamed, or has the wrong shape for the plugin it feeds.

What this error means

kustomize build fails with "trouble configuring builtin PatchTransformer with config: ..." or a similar plugin name, followed by a YAML unmarshal error.

kustomize
Error: trouble configuring builtin PatchTransformer with config:
```
path: patch.yaml
targets: {kind: Deployment}
```
: unable to parse SM or JSON patch from [patch.yaml]

Common causes

A misnamed or mis-typed field

A field like targets instead of target, or a scalar where a list is expected, cannot be unmarshalled into the builtin plugin config.

A patch file that is neither strategic-merge nor JSON6902

The referenced patch is not a valid strategic-merge or JSON6902 patch, so the transformer cannot parse it.

How to fix it

Use the correct field name and shape

  1. Read which builtin plugin and field the message names.
  2. Correct the field to the documented spelling and type.
  3. Ensure a referenced patch is a valid SM or JSON6902 patch.
kustomization.yaml
patches:
  - path: patch.yaml
    target:
      kind: Deployment
      name: api

Validate the kustomization structure

Run the build on just the offending directory to isolate which field the plugin rejects.

Terminal
kustomize build overlays/prod 2>&1 | head -30

How to prevent it

  • Follow the exact field names in the kustomization schema.
  • Keep patches valid strategic-merge or JSON6902 documents.
  • Build overlays in CI to catch config errors before apply.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →