GoogleContainerTools/skaffold · error

STATUSCHECK_STANDALONE_PODS_FETCH_ERR

STATUSCHECK_STANDALONE_PODS_FETCH_ERR

Error message

could not fetch standalone pods: %w

What it means

statusCheck wraps failures from getStandalonePods with this message and STATUSCHECK_STANDALONE_PODS_FETCH_ERR. The inner error is produced when NewStandalonePodsSelector(client).Select(...) cannot list pods filtered by the run-id label.

Source

Thrown at pkg/skaffold/kubernetes/status/status_check.go:208

			resources = append(resources, d)
			s.seenResources.Add(d)
		}

		newStatefulSets, err := getStatefulSets(ctx, client, n, s.labeller, getDeadline(s.deadlineSeconds), s.tolerateFailures)
		if err != nil {
			return proto.StatusCode_STATUSCHECK_STATEFULSET_FETCH_ERR, fmt.Errorf("could not fetch statefulsets: %w", err)
		}
		for _, d := range newStatefulSets {
			if s.seenResources.Contains(d) {
				continue
			}
			resources = append(resources, d)
			s.seenResources.Add(d)
		}

		newStandalonePods, err := getStandalonePods(ctx, client, n, s.labeller, getDeadline((s.deadlineSeconds)), s.tolerateFailures)
		if err != nil {
			return proto.StatusCode_STATUSCHECK_STANDALONE_PODS_FETCH_ERR, fmt.Errorf("could not fetch standalone pods: %w", err)
		}
		for _, pods := range newStandalonePods {
			if s.seenResources.Contains(pods) {
				continue
			}
			resources = append(resources, pods)
			s.seenResources.Add(pods)
		}

		newConfigConnectorResources, err := getConfigConnectorResources(client, dynClient, s.manifests, n, s.labeller, getDeadline(s.deadlineSeconds), s.tolerateFailures)
		if err != nil {
			return proto.StatusCode_STATUSCHECK_CONFIG_CONNECTOR_RESOURCES_FETCH_ERR, fmt.Errorf("could not fetch config connector resources: %w", err)
		}
		for _, d := range newConfigConnectorResources {
			if s.seenResources.Contains(d) {
				continue
			}
			resources = append(resources, d)

View on GitHub (pinned to a1189de023)

Solutions

  1. Run 'kubectl auth can-i list pods -n <ns>' and fix RBAC (add pods to get/list/watch resources)
  2. Verify the namespace in skaffold.yaml statusCheck settings exists
  3. Confirm cluster connectivity: 'kubectl get pods -n <ns>'
  4. Check the labeller's run-id label for empty/invalid characters (e.g. runID with illegal label values)
  5. Retry once the cluster/credentials are healthy

Example fix

// before: namespace 'prod ' (trailing space) in skaffold.yaml
//   statusCheck: { namespace: 'prod ' }
// after:
//   statusCheck: { namespace: 'prod' }
Defensive patterns

Strategy: try-catch

Validate before calling

const canList = execSync(`kubectl auth can-i list pods -n ${ns}`).toString().trim();
if (canList !== 'yes') throw new Error(`RBAC: cannot list pods in ${ns}`);

Type guard

function isStandalonePodsFetchErr(err) {
  return err != null && typeof err.message === 'string' && err.message.includes('could not fetch standalone pods');
}

Try / catch

try {
  await statusCheck();
} catch (err) {
  if (err.message.includes('could not fetch standalone pods')) {
    log.error('pod list failed:', err.cause ?? err.message);
  }
  throw err;
}

Prevention

When it happens

Trigger: selector.Select(ctx, ns, metav1.ListOptions{LabelSelector: l.RunIDSelector()}) errors: RBAC denies listing pods, namespace missing, API server unreachable, or invalid label selector string.

Common situations: Namespaces lacking pod list permissions (common in multi-tenant clusters); nonexistent namespace passed via skaffold config statusCheck.namespace; cluster unreachable after network switch; selector label encoding issues after labeller changes.

Related errors


AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05). Data as JSON: /api/errors/43fddb98a18af79b. Report an issue: GitHub.