error converting YAML to JSON Kubernetes Origin: Platform & cloud Last updated 14 Oct 2026

error converting YAML to JSON: yaml: line 12: did not find expected key

The manifest isn’t valid YAML — usually indentation, a tab character, or an unquoted special character.

Exact message you may see error converting YAML to JSONdid not find expected keymapping values are not allowed in this contextfound character that cannot start any tokenerror parsing
Seen on: Kubernetes

Meaning

kubectl parses YAML before talking to the cluster. “did not find expected key”, “mapping values are not allowed in this context” and “found character that cannot start any token” all point at the reported line (or the one before it). Tabs are never allowed for indentation.

Common causes

  • Mixed or inconsistent indentation
  • Tab characters
  • Unquoted values containing ': ' or starting with @, *, {, %
  • Helm template producing broken indentation (missing nindent)

⚡ Quick fix

  1. Check the reported line and the line above
  2. Replace tabs with spaces
  3. Quote strings with special characters
  4. Lint: yamllint file.yaml / helm template | kubectl apply --dry-run=client -f -

Detailed fix by platform

Shell

  1. bash
    yamllint deploy.yaml
    grep -nP '\t' deploy.yaml

How to diagnose

  1. Line — Reported line ±1
  2. Tabs — Any tab characters?
  3. Template — Rendered output valid?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):

1048 — MySQL ERROR 1048 (23000): Column 'x' cannot be null (MySQL)10481264 — MySQL ERROR 1264 (22003): Out of range value for column 'x' at row 1 (MySQL)12641366 — MySQL ERROR 1366 (HY000): Incorrect integer value: '' for column 'x' at row 1 (MySQL)13661406 — MySQL ERROR 1406: Data too long for column (MySQL)140622001 — ERROR: value too long for type character varying(255) (PostgreSQL)2200122P02 — ERROR: invalid input syntax for type integer: "abc" (PostgreSQL)22P0222P02 uuid — ERROR: invalid input syntax for type uuid: "x" (PostgreSQL)22P02 uuid23502 — ERROR: null value in column "x" of relation "y" violates not-null constraint (PostgreSQL)23502error con…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.