Skip to content

Troubleshooting

This page covers exit codes, check results, and common errors for kinder env and kinder doctor.

Exit codeMeaning
0Success — provider detected, output written
1Error — unsupported output format or provider detection failure

Unknown output format

  • Symptom: kinder env --output yaml returns an error.
  • Cause: Only json and the default text format are supported. yaml, table, and other formats are not recognized.
  • Fix: Use kinder env (default text) or kinder env --output json.

Wrong cluster name in output

  • Symptom: kinder env shows KIND_CLUSTER_NAME=kind but your cluster has a different name.
  • Cause: The --name flag defaults to "kind". If you created a cluster with --name my-cluster, you must also pass --name my-cluster to kinder env.
  • Fix: kinder env --name my-cluster
Exit codeMeaning
0All checks passed
1One or more checks failed
2One or more checks warned (no failures)

If both failures and warnings exist, exit code 1 takes priority over exit code 2.

Check nameWhat it checksPossible statuses
docker / podman / nerdctlContainer runtime binary found and daemon respondingok, warn, fail
container-runtimeFallback name when no runtime binary is found at allfail
kubectlkubectl binary found and kubectl version --client succeedsok, warn

No container runtime found

  • Symptom: Exit code 1. JSON output shows {"name":"container-runtime","status":"fail","message":"no container runtime found..."}.
  • Cause: None of docker, podman, or nerdctl is installed or in PATH.
  • Fix: Install Docker, Podman, or nerdctl. Then re-run kinder doctor.

Docker found but not responding

  • Symptom: Exit code 2. JSON shows {"name":"docker","status":"warn","message":"docker found but not responding..."}.
  • Cause: The docker binary is on PATH but the Docker daemon is not running.
  • Fix: Start the Docker daemon (systemctl start docker on Linux, open Docker Desktop on macOS/Windows), then re-run kinder doctor.

kubectl not found

  • Symptom: Exit code 1 (if combined with a runtime fail) or exit code 2 (if runtime is ok but kubectl warns). JSON shows {"name":"kubectl","status":"warn"} or {"name":"kubectl","status":"fail"}.
  • Cause: kubectl is not installed or not in PATH.
  • Fix: Install kubectl: https://kubernetes.io/docs/tasks/tools/. Then re-run kinder doctor.

All checks pass but cluster still fails

  • Symptom: kinder doctor returns exit code 0 but kinder create cluster fails.
  • Cause: kinder doctor checks prerequisites (runtime and kubectl), not cluster state. Issues like insufficient disk space, port conflicts, or Docker resource limits are not checked.
  • Fix: Check Docker resource settings (memory, disk), ensure no port conflicts on the host, and review the kinder create cluster error output.

kinder doctor checks prerequisites (host environment, Docker daemon, kernel limits). When a cluster has already been created and a workload misbehaves, the cryptic kubelet/kubeadm/containerd error in the logs is usually the real signal — and that’s what kinder doctor decode is for.

Terminal window
kinder doctor decode

The decoder scans recent docker logs from every node and kubectl get events (Warnings only by default), matches lines against a 16-pattern catalog covering kubelet, kubeadm, containerd, docker, and addon-startup failures, and prints plain-English explanations with suggested fixes.

FlagDefaultPurpose
--namekindCluster to scan (positional cluster name also accepted)
--since30mTime window for docker logs and event filtering (Go duration: 30m, 2h, 90s)
--outputhumanOutput format: human or json
--auto-fixfalseApply whitelisted, non-destructive remediations (preview shown first)
--include-normalfalseInclude Normal-type Kubernetes events (default: Warnings only)
ScopePattern IDsExamples
kubeletKUB-01..05inotify exhaustion, image-pull failures, node not ready, kubelet OOM
kubeadmKADM-01..03preflight failures, certificate-mismatch, CoreDNS rollout stuck
containerdCTD-01..03image-import errors, snapshotter failures, OCI runtime errors
dockerDOCK-01..03daemon socket errors, disk-pressure events, volume-mount failures
addonADDON-01..02MetalLB CRD-not-ready, Envoy Gateway controller crash

--auto-fix only applies these three remediations, all idempotent and non-destructive:

RemediationTriggered byAction
inotify-raiseKUB-01, KUB-02Raise fs.inotify.max_user_watches and max_user_instances via sudo sysctl
coredns-restartKADM-02kubectl rollout restart deployment/coredns -n kube-system
node-container-restartKUB-05docker start <node-container> for the node identified in the matched line

Cluster delete/recreate is never auto-fixable. The preview is always printed before any apply, and --auto-fix is skipped silently when the process is not running as root.

Terminal window
# Default scan: last 30 minutes, human output, warnings-only events
kinder doctor decode
# Wider scan with normal events included
kinder doctor decode --since 2h --include-normal
# JSON output for piping into log-aggregation tools
kinder doctor decode --output json | jq '.matches[] | select(.scope == "kubelet")'
# Apply known-safe fixes on a workstation (you'll be prompted via preview)
sudo kinder doctor decode --auto-fix