{"record":{"id":"bf295cb49e64eba7","repo":"GoogleContainerTools/skaffold","slug":"statuscheck-custom-resource-fetch-err","errorCode":"STATUSCHECK_CUSTOM_RESOURCE_FETCH_ERR","errorMessage":"could not fetch custom resources: %w","messagePattern":"could not fetch custom resources: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/kubernetes/status/status_check.go","lineNumber":233,"sourceCode":"\t\t\ts.seenResources.Add(pods)\n\t\t}\n\n\t\tnewConfigConnectorResources, err := getConfigConnectorResources(client, dynClient, s.manifests, n, s.labeller, getDeadline(s.deadlineSeconds), s.tolerateFailures)\n\t\tif err != nil {\n\t\t\treturn proto.StatusCode_STATUSCHECK_CONFIG_CONNECTOR_RESOURCES_FETCH_ERR, fmt.Errorf(\"could not fetch config connector resources: %w\", err)\n\t\t}\n\t\tfor _, d := range newConfigConnectorResources {\n\t\t\tif s.seenResources.Contains(d) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tresources = append(resources, d)\n\t\t\ts.seenResources.Add(d)\n\t\t}\n\n\t\tfor _, selector := range s.crSelectors {\n\t\t\tcustomResources, err := getCustomResources(client, dynClient, s.manifests, n, getDeadline(s.deadlineSeconds), s.tolerateFailures, selector)\n\t\t\tif err != nil {\n\t\t\t\treturn proto.StatusCode_STATUSCHECK_CUSTOM_RESOURCE_FETCH_ERR, fmt.Errorf(\"could not fetch custom resources: %w\", err)\n\t\t\t}\n\n\t\t\tfor _, d := range customResources {\n\t\t\t\tif s.seenResources.Contains(d) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tresources = append(resources, d)\n\t\t\t\ts.seenResources.Add(d)\n\t\t\t}\n\t\t}\n\t}\n\n\tvar wg sync.WaitGroup\n\tc := newCounter(len(resources))\n\n\tctx, cancel := context.WithCancel(ctx)\n\tdefer cancel()\n\tvar exitStatusOnce sync.Once","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/kubernetes/status/status_check.go#L215-L251","documentation":"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.","triggerScenarios":"m.SelectResources(selector) errors for a crSelectors entry configured in skaffold.yaml statusCheck — invalid selector config or a manifest that cannot be selected/parsed.","commonSituations":"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.","solutions":["Validate the GroupKindSelector in skaffold.yaml (group and kind spelled correctly, e.g. group: 'example.com', kind: 'MyResource')","Validate manifests parse: 'skaffold render' + 'kubectl apply --dry-run=client'","Confirm the CRD/GVK still exists: 'kubectl api-resources | grep <kind>'","Bisect manifests to find the one breaking SelectResources","Re-run after fixing config/manifests"],"exampleFix":"// before: skaffold.yaml selector typo\n//   - GroupKind: { group: exampl.com, kind: MyResource }\n// after:\n//   - GroupKind: { group: example.com, kind: MyResource }","handlingStrategy":"validation","validationCode":"const apiRes = execSync('kubectl api-resources -o name').toString();\nfor (const sel of crSelectors) {\n  if (!apiRes.toLowerCase().includes(sel.GroupKind.kind.toLowerCase())) {\n    throw new Error(`CRD kind ${sel.GroupKind.kind} not found in cluster`);\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  await statusCheck();\n} catch (err) {\n  if (err.message.includes('could not fetch custom resources')) {\n    // validate skaffold.yaml GroupKindSelector and manifests\n  }\n  throw err;\n}","preventionTips":["Verify group/kind spelling in statusCheck customResources config against kubectl api-resources","Dry-run render manifests before deploy","Update selectors when CRDs change between versions","Bisect manifests quickly when selection fails"],"tags":["kubernetes","custom-resources","manifest","configuration"],"backgroundTag":"manifest-selection-failed","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}