strict decoding error: unknown field "spec.template.spec.containers[0].ports[0].protocl"
The manifest contains a field the API schema doesn’t know — a typo, wrong indentation, or a field from another API version.
unknown fieldstrict decoding error: unknown fielderror validating data: ValidationErrorunknown field "spec Meaning
Since Kubernetes 1.25 server-side field validation rejects unknown fields (older clients said “error validating data: ValidationError … unknown field”). Most often a key is indented one level too deep or shallow, so it lands in the wrong object.
Common causes
- Typo in a key name
- Wrong indentation putting a key under the wrong parent
- Field from a newer/older API version
- Helm template rendering a value at the wrong level
⚡ Quick fix
- Check the field path in the message
- kubectl explain <kind>.<path> to see valid fields
- Validate locally with kubectl apply --dry-run=server
Detailed fix by platform
Kubernetes
- bash
kubectl explain deployment.spec.template.spec.containers.ports kubectl apply --dry-run=server -f deploy.yaml
How to diagnose
- Path — Exact field path reported
- Indentation — Parent key in the YAML
- Version — apiVersion in use
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in Kubernetes
- provided port is not in the valid range spec.ports[0].nodePort: Invalid value: 80: provided port is not in the valid range. The range of valid ports is 30000-32767
- the object has been modified Operation cannot be fulfilled on deployments.apps "x": the object has been modified; please apply your changes to the latest version and try again
- cannot re-use a name that is still in use Error: INSTALLATION FAILED: cannot re-use a name that is still in use
Other ways to find it
Where this error sits
Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):
🧠 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.
Report a correction or suggest an improvement
Last updated 13 Oct 2026