{"record":{"id":"3506fb7a826d6d50","repo":"kubernetes/kops","slug":"error-reading-tag-file-q-v","errorCode":null,"errorMessage":"error reading tag file %q: %v","messagePattern":"error reading tag file %q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/model/components/context.go","lineNumber":175,"sourceCode":"\t// the architecture suffix.\n\t//\n\t// i.e. registry.k8s.io/kube-apiserver:v1.20.0 is a manifest list\n\t// and we _can_ also pull\n\t// registry.k8s.io/kube-apiserver-amd64:v1.20.0 directly.  But if\n\t// we load https://.../v1.20.0/amd64/kube-apiserver.tar then\n\t// the image inside that tar file is named\n\t// \"registry.k8s.io/kube-apiserver-amd64:v1.20.0\"\n\timageName += \"-amd64\"\n\n\tbaseURL := clusterSpec.KubernetesVersion\n\tbaseURL = strings.TrimSuffix(baseURL, \"/\")\n\n\ttagURL := baseURL + \"/bin/linux/amd64/\" + component + \".docker_tag\"\n\tklog.V(2).Infof(\"Downloading docker tag for %s from: %s\", component, tagURL)\n\n\tb, err := vfs.Context.ReadFile(tagURL)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"error reading tag file %q: %v\", tagURL, err)\n\t}\n\ttag := strings.TrimSpace(string(b))\n\tklog.V(2).Infof(\"Found tag %q for %q\", tag, component)\n\n\timage := \"registry.k8s.io/\" + imageName + \":\" + tag\n\n\treturn image, nil\n}\n\n// IsCertManagerEnabled returns true if the cluster has the capability to handle cert-manager PKI\nfunc IsCertManagerEnabled(cluster *kops.Cluster) bool {\n\treturn cluster.Spec.CertManager != nil && fi.ValueOf(cluster.Spec.CertManager.Enabled)\n}\n","sourceCodeStart":157,"sourceCodeEnd":189,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/model/components/context.go#L157-L189","documentation":"When the cluster runs a non-default (CI/nightly) Kubernetes version, Image() downloads the component's .docker_tag file from the Kubernetes release bucket (baseURL + /bin/linux/amd64/<component>.docker_tag) over VFS. If that HTTP/VFS read fails, the error wraps the tag URL and underlying cause.","triggerScenarios":"Using clusterSpec.KubernetesVersion pointing at a CI build or latest (e.g. https://storage.googleapis.com/k8s-release-dev/...) and the tag file does not exist, the URL is unreachable, or network/DNS fails during BuildOptions.","commonSituations":"Nightly/alpha kubernetesVersion no longer published; offline or proxied environments blocking the release bucket; typo in the version URL; bucket path scheme changes across k8s versions.","solutions":["Pin clusterSpec.KubernetesVersion to a released version so a static registry.k8s.io image is used instead of downloading a tag","Verify network access to the release bucket URL printed in the error (curl the tagURL)","Check the kubernetesVersion string for typos or an unsupported URL form","Retry later if the CI build has not been published yet"],"exampleFix":"// before\nkubernetesVersion: \"https://storage.googleapis.com/k8s-release-dev/ci/latest.txt\"\n// after\nkubernetesVersion: \"v1.29.4\"","handlingStrategy":"retry","validationCode":"// Pre-flight: ensure the tag URL is reachable\nresp, err := http.Head(tagURL)\nif err != nil || resp.StatusCode != 200 {\n    return fmt.Errorf(\"tag file not reachable: %s\", tagURL)\n}","typeGuard":"func isReleasedVersion(v string) bool { return !strings.Contains(v, \"latest\") && !strings.Contains(v, \"ci/\") }","tryCatchPattern":"b, err := vfs.Context.ReadFile(tagURL)\nif err != nil {\n    return \"\", fmt.Errorf(\"error reading tag file %q: %v\", tagURL, err)\n}\n// retry transient network failures with backoff","preventionTips":["Pin kubernetesVersion to a stable released version","Verify bucket reachability in CI before running kops","Avoid latest/ci version URLs in production clusters"],"tags":["network","http","kubernetes-version","vfs"],"backgroundTag":"http-download-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"}