KubeErrors

couldn't get current server API group list: kubectl could not complete API discovery

Before most operations, kubectl asks the server which APIs exist. A failure here blocks nearly every command, and it usually means connectivity or authentication rather than anything about the resource you asked for.

Applies to: All Kubernetes versions

What it means

kubectl performs discovery to learn which resource types and versions the cluster serves, and caches the result. When discovery fails, the error names the API group list rather than the command you ran, which makes it look unrelated to what you were doing. The underlying causes are the familiar ones: the API server is unreachable, the credential is invalid, or an aggregated API server is registered and unavailable — that last case being particularly awkward, because one broken extension API can degrade discovery for the whole cluster.

Most common causes

How to diagnose it

  1. Read the wrapped error after the phrase — it names the real cause.
  2. Test connectivity and authentication with a minimal call: kubectl version.
  3. Check for unavailable aggregated APIs: kubectl get apiservices | grep -v True.
  4. Clear the discovery cache to rule it out — the cache directory under the kubectl home can be removed safely.
  5. Check proxy environment variables.

How to fix it

  1. Restore connectivity or refresh the credential, depending on the wrapped error.
  2. Fix or remove an unavailable APIService. A registered-but-broken aggregated API affects far more than its own resources.
  3. Delete the discovery cache if it is stale.
  4. Correct proxy settings, including NO_PROXY for internal addresses.

Notes

A single unavailable aggregated API server is a disproportionately disruptive failure: kubectl's discovery slows down or fails, and commands unrelated to that API start reporting errors. Checking kubectl get apiservices is worth doing early whenever the whole CLI feels broken.

Related

Sources

Pages on this site are written with AI assistance from the primary sources listed on each page, then checked against those sources before publishing.