{"record":{"id":"eb009cd11b6206ad","repo":"kubernetes/kops","slug":"unable-to-locate-asset-q","errorCode":null,"errorMessage":"unable to locate asset %q","messagePattern":"unable to locate asset %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nodeup/pkg/model/kubectl.go","lineNumber":51,"sourceCode":"\nvar _ fi.NodeupModelBuilder = &KubectlBuilder{}\n\n// Build is responsible for managing the kubectl on the nodes\nfunc (b *KubectlBuilder) Build(c *fi.NodeupModelBuilderContext) error {\n\tif !b.HasAPIServer {\n\t\treturn nil\n\t}\n\n\t{\n\t\t// TODO: Extract to common function?\n\t\tassetName := \"kubectl\"\n\t\tassetPath := \"\"\n\t\tasset, err := b.Assets.Find(assetName, assetPath)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error trying to locate asset %q: %v\", assetName, err)\n\t\t}\n\t\tif asset == nil {\n\t\t\treturn fmt.Errorf(\"unable to locate asset %q\", assetName)\n\t\t}\n\n\t\tc.AddTask(&nodetasks.File{\n\t\t\tPath:     b.KubectlPath() + \"/\" + assetName,\n\t\t\tContents: asset,\n\t\t\tType:     nodetasks.FileType_File,\n\t\t\tMode:     s(\"0755\"),\n\t\t})\n\t}\n\n\t{\n\t\tname := nodetasks.PKIXName{\n\t\t\tCommonName:   \"kubecfg\",\n\t\t\tOrganization: []string{rbac.SystemPrivilegedGroup},\n\t\t}\n\t\tkubeconfig := b.BuildIssuedKubeconfig(\"kubecfg\", name, c)\n\n\t\tc.AddTask(&nodetasks.File{","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/nodeup/pkg/model/kubectl.go#L33-L69","documentation":"In KubectlBuilder.Build, nodeup resolves the kubectl binary as a cluster asset via b.Assets.Find(assetName, assetPath). After the lookup returns without error, a nil asset means the kubectl asset was not found in the compiled-in or on-disk asset list, so nodeup cannot create the kubectl file task on the node.","triggerScenarios":"Running nodeup on a node when the kubectl asset is absent from the cluster's Assets (e.g. assets produced from an asset registry that did not include kubectl, an incorrect kubernetesVersion, or a missing/isolated file:// mirror).","commonSituations":"Air-gapped clusters where the kubectl mirror path is wrong or the file was not uploaded; mismatched KOPS_BASE_URL / asset store contents; versions of kOps where the kubectl asset for the target arch was not built.","solutions":["Verify the kubectl asset exists in the asset store / file mirror referenced by the cluster spec (correct base URL, correct arch suffix).","Check the cluster's kubernetesVersion is a valid, downloadable version so the kubectl asset URL resolves.","Re-run kops update/apply so the asset manifest is regenerated, then retry nodeup.","If on an air-gapped install, re-upload the missing kubectl binary to the mirror and confirm permissions."],"exampleFix":"// before (nodeup run against empty mirror)\nkops update cluster ... --url=https://internal-mirror/broken\n// after (asset uploaded / correct base URL)\nkops update cluster ... --url=https://internal-mirror/latest","handlingStrategy":"validation","validationCode":"// before running nodeup, confirm the kubectl asset is fetchable\nu := fmt.Sprintf(\"%s/%s/bin/linux/amd64/kubectl\", baseURL, k8sVersion)\nresp, err := http.Head(u)\nif err != nil || resp.StatusCode != http.StatusOK {\n    return fmt.Errorf(\"kubectl asset missing at %s\", u)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pre-upload all kubectl/kubelet assets to air-gapped mirrors before nodeup.","Pin kubernetesVersion to a released, published version.","Re-run kops update cluster after changing base URLs or mirrors."],"tags":["nodeup","assets","kubectl"],"backgroundTag":"asset-not-found","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}