Skip to content

Troubleshoot

This page documents Tsunaro v0.24.0, an archived release. Current documentation.

Symptoms

SymptomLook atTypical cause
Tailnet ApiReachable=False/Unreachablecondition messageapiUrl wrong, NetworkPolicy blocks the operator
Tailnet ApiReachable=False/UnhealthyHeadscale /health, its databaseHeadscale answers but cannot reach its database (it then returns 401 on every API call)
Tailnet ApiKeyValid=False/RejectedHeadscale apikeys listworking key expired or deleted on the server; Error = rotation failed (bootstrap key expired)
HeadscaleCompatible=False/Incompatiblecondition messagemissing policy/check endpoint (requires ≥ 0.29), or file policy mode
PolicyMode=False/File, PolicyApplied=False/PolicyModeFileHeadscale policy.modeswitch to database mode using Migrating from file mode ; writes are skipped until mode detection changes
Preflight Unknown/ProbeFailedAPI/key conditions and Headscale logsfailed requests or invalid response shape; not proof of file mode
SplitDNS=False/Missing or Mismatchcondition message (observed vs expected resolver) and Headscale dns.nameservers.splitpoint the named zone at the gateway LoadBalancer IP; Headscale has no DNS API, so this is a manual edit
SplitDNS=Unknown/CannotVerifycondition messageno TailnetGateway binds the Tailnet, or no agent (ingress/egress) is online to read the netmap
UsersUnique=False/Duplicate, PolicyApplied=False/PolicyRejectedheadscale users listduplicate user names (typically OIDC plus a CLI-created user); destroy the surplus user, the next reconcile clears both
Egress TagKnown=False/Unknownkubectl describe tailnetegresstag missing in tagOwners (file mode)
Egress TagKnown=False/PolicyPendingkubectl describe tailnet → PolicyAppliedpolicy not applied yet / rejected
Registered=False/WorkloadBlockedcondition message, kubectl -n <ns> describe deploy <agent>agent pod refused by a LimitRange/ResourceQuota/PodSecurity — raise spec.resources or Tailnet.spec.proxy.resources (Agent resources )
status.targets[].reason=NotAdvertisedrouter --advertise-routesroute not advertised
… NotApprovedheadscale nodes list-routes, kubectl describe tailnet eventsroute not approved; with operator-owned policy it is re-approved on the next policy reconcile — persists → autoApprovers entry missing or router tag differs
… NoGrantpolicy grantsno grant tag → /32:port (file mode)
TargetsReachable=Falseagent log dial …: context deadline exceededsite firewall, target down
Alias does not resolve in a podkubectl -n tailnet-system get cm tailnet-dns-hosts, resolver logzone not forwarded, ConfigMap not mounted, Service not created yet
Ingress PolicyGranted=False/PolicyDeniedcondition messageallowFrom entry not covered by ingressSourceAllowlist
PolicyRendered=False/PolicyEmptybase ConfigMapbase has no tagOwners or no acls/grants — refused to avoid a lock-out
PolicyApplied=False/ApplyFailedcondition message (read: …; write: …)Headscale still in file mode, empty policy table, API unreachable
Event PolicyDriftOverwrittenkubectl get events -A --field-selector reason=PolicyDriftOverwrittensomeone ran headscale policy set
hosts/rendered ConfigMap not updating; Event ConfigMapNotOwnedkubectl get events -A --field-selector reason=ConfigMapNotOwned, kubectl -n tailnet-system get cm <name> -o yamla ConfigMap of that name is controlled by another resource — rename it or remove the foreign one (an ownerRef-less one with label tsunaro.io/role is adopted automatically)

Diagnosis cheat sheet

QuestionCommandHealthy output
Is the control server reachable?kubectl describe tailnet corpApiReachable=True, ApiKeyValid=True
Does preflight pass?kubectl get tailnet corp, kubectl describe tailnet corpCOMPAT=Compatible, PolicyMode=True/Database; DNS=Configured once a gateway and one agent are up; Missing/Mismatch name the Headscale dns.nameservers.split fix
Why is an egress not ready?kubectl -n tailnet-system get tailnetegress X -o jsonpath='{range .status.targets[*]}{.name} {.present} {.reachable} {.reason}{"\n"}{end}'true true per target, empty reason
Is the route on the router?kubectl -n tailnet-system exec deploy/headscale -- headscale nodes list-routesthe target’s /32 or a covering subnet under the router’s approved routes
Does the agent reach the host?kubectl -n tailnet-system logs deploy/X | grep targetno dial …: context deadline exceeded
What does the agent probe say?wget -qO- http://<agent-pod-ip>:9080/targets from any pod"reachable":true per target
Does an alias resolve?kubectl -n <tenant> exec deploy/app -- getent hosts api.corp.examplethe Service ClusterIP
Is the hosts file current?kubectl -n tailnet-system get cm tailnet-dns-hosts -o jsonpath='{.data.hosts}'one line per alias / ingress name
Resolver errors?kubectl -n <resolver-ns> logs <coredns-pod> | grep -i errornone; i/o timeout = upstream unreachable
What did the policy render?kubectl get tailnet corp -o jsonpath='{.status.policy}', ConfigMap headscale-policy-renderedhashes equal, PolicyApplied=True
Who is on the tailnet?kubectl -n tailnet-system exec deploy/headscale -- headscale nodes listegress/ingress nodes online with their tags

Clients time out right after an agent restart

An egress agent Pod carries no state: each start registers a new Headscale node with a new tailnet IP (Limitations ); an ingress keeps its node across restarts and is not affected. The operator rewrites the split-DNS zone within seconds and deletes the old node on its next reconcile, but a client that resolved the name just before the restart keeps the old address until the 30 s record TTL expires — connections time out for up to that long, on top of the restart itself. It is a symptom of the restart, not a second fault: check why the agent restarted (kubectl -n <ns> describe deploy <agent>, OOM, LimitRange) and confirm the new identity is live:

kubectl -n <ns> get tailnetingress <name> -o jsonpath='{.status.nodeId} {.status.tailnetIps}{"\n"}'
dig +short <dnsName> @<gateway DNS Service IP>   # must show the new IP

Address agents by name, never by tailnet IP; the name is the contract that survives a restart.

Known CNI behavior: ICMP errors

Kubernetes NetworkPolicy specifies TCP, UDP and SCTP; ICMP handling is up to the CNI, and some implementations drop node-generated ICMP errors (unreachable, fragmentation-needed) to policy-selected pods. A timeout on an agent is therefore not proof of reachability, and path-MTU discovery may not work; Tailnet.spec.proxy.mtu (default 1200) sidesteps the latter.

Source: docs/how-to/troubleshooting.md at v0.24.0 — found a mistake? Tell us.