cilium/cilium · error

failed to fetch uname -r: %w

Error message

failed to fetch uname -r: %w

What it means

Feature detection also execs `uname -r` in the cilium-agent pod to learn the kernel version (used e.g. for the RHEL <=4.18 feature). This error wraps any failure of that pod exec call.

Source

Thrown at cilium-cli/connectivity/check/features.go:220

					Enabled: wg.NodeEncryption != "Disabled",
					Mode:    wg.NodeEncryptOptOutLabels,
				}
			}
		}
	}
	result[features.EncryptionPod] = features.Status{
		Enabled: mode != "disabled",
		Mode:    mode,
	}

	return nil
}

func (ct *ConnectivityTest) extractFeaturesFromUname(ctx context.Context, ciliumPod Pod, result features.Set) error {
	stdout, err := ciliumPod.K8sClient.ExecInPod(ctx, ciliumPod.Pod.Namespace, ciliumPod.Pod.Name,
		defaults.AgentContainerName, []string{"uname", "-r"})
	if err != nil {
		return fmt.Errorf("failed to fetch uname -r: %w", err)
	}

	kernelVersion, err := version.ParseKernelVersion(stdout.String())
	if err != nil {
		return fmt.Errorf("failed to parse kernel version: %w", err)
	}

	result[features.RHEL] = features.Status{
		Enabled: versioncheck.MustCompile("<=4.18.0")(kernelVersion),
	}

	return nil
}

func (ct *ConnectivityTest) extractFeaturesFromK8sCluster(ctx context.Context, result features.Set) {
	flavor := ct.client.AutodetectFlavor(ctx)

	result[features.Flavor] = features.Status{

View on GitHub (pinned to ac7b90affa)

Solutions

  1. Confirm the agent pod is running: kubectl -n <ns> get pods -l k8s-app=cilium
  2. Test exec manually: kubectl exec -n <ns> <pod> -c cilium-agent -- uname -r
  3. Fix cluster connectivity/kubeconfig if the API call fails
  4. Check RBAC and any policy engine blocking pod/exec
  5. Retry the connectivity test after the agent stabilizes

Example fix

// before
if err := ct.extractFeaturesFromUname(ctx, ciliumPod, result); err != nil { return err }
// after: guard with readiness wait
if err := ct.client.WaitforPods(ctx, ciliumPod.Pod.Namespace, []string{"k8s-app=cilium"}, true); err != nil {
	return fmt.Errorf("cilium agent not ready: %w", err)
}
if err := ct.extractFeaturesFromUname(ctx, ciliumPod, result); err != nil { return err }
Defensive patterns

Strategy: retry

Validate before calling

// wait for agent readiness before exec'ing uname
if err := client.WaitforPods(ctx, ciliumNamespace, []string{"k8s-app=cilium"}, true); err != nil {
	return fmt.Errorf("cilium agents not ready: %w", err)
}

Type guard

func isExecFailure(err error) bool { return err != nil && strings.Contains(err.Error(), "failed to fetch uname -r") }

Try / catch

err := retry.Do(3, retry.WithTimeout(30*time.Second), func() error {
	return ct.extractFeaturesFromUname(ctx, ciliumPod, result)
})
if err != nil { log.Warnf("kernel feature detection skipped: %v", err) }

Prevention

When it happens

Trigger: ciliumPod.K8sClient.ExecInPod(..., ["uname","-r"]) returns an error: agent pod gone/not ready, container name mismatch, exec denied by RBAC/policy, or API server connectivity failure.

Common situations: Agent restarted mid-test; exec blocked by admission policies; kubeconfig/cluster mismatch; cilium pod in CrashLoopBackOff so exec target is unavailable.

Related errors


AI-assisted analysis of cilium/cilium@ac7b90affa (2026-08-31). Data as JSON: /api/errors/257206cf491fdd4b. Report an issue: GitHub.