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

**Code:** `error converting YAML to JSON` · **Category:** Kubernetes · **Seen on:** Kubernetes

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

## 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?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/kubernetes/yaml-error-converting-to-json)
