{"record":{"id":"a6150eb6ae588750","repo":"kubernetes/kops","slug":"unable-to-remap-cni-plugin-binaries-asset-v","errorCode":null,"errorMessage":"unable to remap CNI plugin binaries asset: %v","messagePattern":"unable to remap CNI plugin binaries asset: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/nodemodel/wellknownassets/cni.go","lineNumber":75,"sourceCode":"\tcniAssetHash := os.Getenv(ENV_VAR_CNI_ASSET_HASH)\n\n\tif cniAssetURL != \"\" && cniAssetHash != \"\" {\n\t\tklog.V(2).Infof(\"Using CNI asset URL %q, as set in %s\", cniAssetURL, ENV_VAR_CNI_ASSET_URL)\n\t\tklog.V(2).Infof(\"Using CNI asset hash %q, as set in %s\", cniAssetHash, ENV_VAR_CNI_ASSET_HASH)\n\n\t\tu, err := url.Parse(cniAssetURL)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to parse CNI plugin binaries asset URL %q: %v\", cniAssetURL, err)\n\t\t}\n\n\t\th, err := hashing.FromString(cniAssetHash)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to parse CNI plugin binaries asset hash %q: %v\", cniAssetHash, err)\n\t\t}\n\n\t\tasset, err := assetBuilder.RemapFile(u, h)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to remap CNI plugin binaries asset: %v\", err)\n\t\t}\n\n\t\treturn asset, nil\n\t}\n\n\tswitch arch {\n\tcase architectures.ArchitectureAmd64:\n\t\tswitch {\n\t\tcase ig.KubernetesVersion().IsGTE(\"1.36\"):\n\t\t\tcniAssetURL = defaultCNIAssetAmd64K8s_36\n\t\tcase ig.KubernetesVersion().IsGTE(\"1.35\"):\n\t\t\tcniAssetURL = defaultCNIAssetAmd64K8s_35\n\t\tcase ig.KubernetesVersion().IsGTE(\"1.34\"):\n\t\t\tcniAssetURL = defaultCNIAssetAmd64K8s_34\n\t\tcase ig.KubernetesVersion().IsGTE(\"1.32\"):\n\t\t\tcniAssetURL = defaultCNIAssetAmd64K8s_32\n\t\t}\n\tcase architectures.ArchitectureArm64:","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/nodemodel/wellknownassets/cni.go#L57-L93","documentation":"After parsing the env-var-provided CNI URL and hash, FindCNIAssets calls assetBuilder.RemapFile(u, h), which resolves the asset — including rewriting it to a mirror/CDN and computing/validating its hash when building the cluster manifest. This error is thrown when RemapFile fails, typically because the URL can't be fetched (HTTP error, network issue, DNS failure) or the downloaded content's hash doesn't match CNI_ASSET_HASH_STRING.","triggerScenarios":"Both CNI_VERSION_URL and CNI_ASSET_HASH_STRING are set and assetBuilder.RemapFile(u, h) returns an error during BuildKubernetesFileAssets — e.g. the override URL 404s, the host is unreachable, or the hash of the remote file disagrees with the provided hash.","commonSituations":"CNI_VERSION_URL points to a deleted/moved GitHub release asset; a corporate proxy or air-gapped network blocks the download; the hash was computed for a different file/arch than the URL points to; typo swapping amd64 and arm64 URLs/hashes.","solutions":["Open the CNI_VERSION_URL in a browser or `curl -I` it to confirm the asset exists and is reachable from the build machine","Recompute the checksum (`curl -L <url> | sha256sum`) and update CNI_ASSET_HASH_STRING to match, keeping the \"sha256:\" prefix","Ensure the URL and hash correspond to the same file and CPU architecture (amd64 vs arm64)","Fix network/proxy access (set HTTPS_PROXY, whitelist the host) or use an internal mirror URL you control","Unset both env vars to use kOps' built-in default CNI assets"],"exampleFix":"// before\nexport CNI_VERSION_URL=\"https://dist.example.com/cni-plugins-v1.6.2.tgz\" # 404\n// after\nexport CNI_VERSION_URL=\"https://github.com/containernetworking/plugins/releases/download/v1.6.2/cni-plugins-linux-amd64-v1.6.2.tgz\"\nexport CNI_ASSET_HASH_STRING=\"sha256:<hash of that exact file>\"","handlingStrategy":"try-catch","validationCode":"resp, err := http.Head(os.Getenv(\"CNI_VERSION_URL\"))\nif err != nil || resp.StatusCode != http.StatusOK {\n    return fmt.Errorf(\"CNI_VERSION_URL not reachable: %v\", err)\n}","typeGuard":null,"tryCatchPattern":"asset, err := FindCNIAssets(ig, assetBuilder, arch)\nif err != nil {\n    if strings.Contains(err.Error(), \"unable to remap CNI plugin binaries asset\") {\n        klog.Errorf(\"CNI override unreachable or hash mismatch; verify URL and CNI_ASSET_HASH_STRING: %v\", err)\n    }\n    return err\n}","preventionTips":["curl -I the override URL before building","Recompute the hash whenever you change the URL","Keep URL and hash for the same file/architecture","Host a mirror for air-gapped/proxied environments"],"tags":["kops","cni","asset-download","http","checksum-mismatch"],"backgroundTag":"asset-download-failed","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}