{"record":{"id":"2708f32df06ce078","repo":"kubernetes/kops","slug":"error-trying-to-locate-asset-q-v","errorCode":null,"errorMessage":"error trying to locate asset %q: %v","messagePattern":"error trying to locate asset %q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nodeup/pkg/model/kubectl.go","lineNumber":48,"sourceCode":"type KubectlBuilder struct {\n\t*NodeupModelContext\n}\n\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}","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/nodeup/pkg/model/kubectl.go#L30-L66","documentation":"KubectlBuilder.Build installs kubectl on API-server nodes by looking up the \"kubectl\" asset through b.Assets.Find(assetName, assetPath). When the asset resolution mechanism itself fails (network/download error, hash mismatch, malformed assets config), the error is wrapped as \"error trying to locate asset %q: %v\". Note this is distinct from the asset simply being absent, which produces \"unable to locate asset\" on the next line.","triggerScenarios":"Running nodeup on a node with an API server where kops' Assets.Find for name=\"kubectl\" returns a non-nil error — e.g. failure resolving the kubectl download URL, an unreachable/misconfigured KOPS_BASE_URL or assets location, or an error computing the asset hash.","commonSituations":"Air-gapped or firewalled clusters where the kops asset mirror/base URL is unreachable; broken KOPS_BASE_URL or custom assetBundles config; kops version with no published kubectl artifact for the target GOOS/GOARCH; proxy/TLS problems on the node.","solutions":["Verify network access from the node to the kops asset location (KOPS_BASE_URL / asset mirror) and fix connectivity or proxy settings","Set a correct, reachable base URL (e.g. KOPS_BASE_URL or --kops-base-url) matching your kops version","Use a custom asset configuration (kops set cluster cluster.spec.assets) pointing at an internally hosted kubectl binary with the correct hash","Upgrade/downgrade kops so a published kubectl artifact exists for the node OS/arch"],"exampleFix":"# before: node cannot reach the default mirror\nexport KOPS_BASE_URL=https://unreachable.internal/kops\n# after: point at a reachable mirror hosting the matching kubectl asset\nexport KOPS_BASE_URL=https://s3.amazonaws.com/kops-releases/latest\n# or pre-pin the asset\nkops set cluster mycluster cluster.spec.assets.nodeUrlAmd64=https://internalMirror/kubectl","handlingStrategy":"try-catch","validationCode":"// Verify the kubectl asset is reachable before bootstrapping\nbaseURL := os.Getenv(\"KOPS_BASE_URL\")\nurl := baseURL + \"/linux/amd64/kubectl\"\nresp, err := http.Head(url)\nif err != nil || resp.StatusCode != http.StatusOK {\n\treturn fmt.Errorf(\"kubectl asset unreachable at %s: %v\", url, err)\n}","typeGuard":null,"tryCatchPattern":"if err := runNodeup(cfg); err != nil {\n\tif strings.Contains(err.Error(), \"error trying to locate asset\") {\n\t\tlog.Errorf(\"asset resolution failed; check KOPS_BASE_URL/mirror reachability and assets config: %v\", err)\n\t\treturn fmt.Errorf(\"bootstrap blocked by asset lookup: %w\", err)\n\t}\n\treturn err\n}","preventionTips":["Pre-pin cluster.spec.assets to internally hosted binaries with correct sha hashes","Verify KOPS_BASE_URL / asset mirror reachability from every node subnet before upgrades","For air-gapped clusters, mirror kops releases and kubectl artifacts inside the VPC","Confirm a published kubectl artifact exists for your node OS/arch in the kops version you run"],"tags":["go","nodeup","kubectl","asset-download","network"],"backgroundTag":"asset-lookup-failed","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"}