GoogleContainerTools/skaffold · error

STATUSCHECK_CUSTOM_RESOURCE_FETCH_ERR

STATUSCHECK_CUSTOM_RESOURCE_FETCH_ERR

Error message

could not fetch custom resources: %w

What it means

statusCheck wraps failures from getCustomResources with STATUSCHECK_CUSTOM_RESOURCE_FETCH_ERR. Like the Config Connector path, this fires when manifest list SelectResources with a user-configured GroupKindSelector fails, before any cluster API call.

Source

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

			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)
			s.seenResources.Add(d)
		}

		for _, selector := range s.crSelectors {
			customResources, err := getCustomResources(client, dynClient, s.manifests, n, getDeadline(s.deadlineSeconds), s.tolerateFailures, selector)
			if err != nil {
				return proto.StatusCode_STATUSCHECK_CUSTOM_RESOURCE_FETCH_ERR, fmt.Errorf("could not fetch custom resources: %w", err)
			}

			for _, d := range customResources {
				if s.seenResources.Contains(d) {
					continue
				}
				resources = append(resources, d)
				s.seenResources.Add(d)
			}
		}
	}

	var wg sync.WaitGroup
	c := newCounter(len(resources))

	ctx, cancel := context.WithCancel(ctx)
	defer cancel()
	var exitStatusOnce sync.Once

View on GitHub (pinned to a1189de023)

Solutions

  1. Validate the GroupKindSelector in skaffold.yaml (group and kind spelled correctly, e.g. group: 'example.com', kind: 'MyResource')
  2. Validate manifests parse: 'skaffold render' + 'kubectl apply --dry-run=client'
  3. Confirm the CRD/GVK still exists: 'kubectl api-resources | grep <kind>'
  4. Bisect manifests to find the one breaking SelectResources
  5. Re-run after fixing config/manifests

Example fix

// before: skaffold.yaml selector typo
//   - GroupKind: { group: exampl.com, kind: MyResource }
// after:
//   - GroupKind: { group: example.com, kind: MyResource }
Defensive patterns

Strategy: validation

Validate before calling

const apiRes = execSync('kubectl api-resources -o name').toString();
for (const sel of crSelectors) {
  if (!apiRes.toLowerCase().includes(sel.GroupKind.kind.toLowerCase())) {
    throw new Error(`CRD kind ${sel.GroupKind.kind} not found in cluster`);
  }
}

Try / catch

try {
  await statusCheck();
} catch (err) {
  if (err.message.includes('could not fetch custom resources')) {
    // validate skaffold.yaml GroupKindSelector and manifests
  }
  throw err;
}

Prevention

When it happens

Trigger: m.SelectResources(selector) errors for a crSelectors entry configured in skaffold.yaml statusCheck — invalid selector config or a manifest that cannot be selected/parsed.

Common situations: statusCheck.customResources selectors referencing GVKs with typos (group/kind swapped or empty); manifests failing to parse; CRD renamed between versions so the configured selector no longer matches.

Related errors


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