{"record":{"id":"ac7747c89f3331b7","repo":"kubernetes/kops","slug":"kops-upgrade-is-required","errorCode":null,"errorMessage":"kops upgrade is required","messagePattern":"kops upgrade is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/apply_cluster.go","lineNumber":966,"sourceCode":"\t\tfmt.Printf(\"\\n\")\n\t\tfmt.Printf(\"%s\\n\", starline)\n\t\tfmt.Printf(\"\\n\")\n\t\tif recommended != nil {\n\t\t\tfmt.Printf(\"a new kops version is available: %s\\n\", recommended)\n\t\t}\n\t\tfmt.Println(\"\")\n\t\tfmt.Printf(\"This version of kops (%s) is no longer supported; upgrading is required\\n\", kopsbase.Version)\n\t\tfmt.Printf(\"(you can bypass this check by exporting KOPS_RUN_OBSOLETE_VERSION)\\n\")\n\t\tfmt.Println(\"\")\n\t\tfmt.Printf(\"More information: %s\\n\", buildPermalink(\"upgrade_kops\", recommended.String()))\n\t\tfmt.Printf(\"\\n\")\n\t\tfmt.Printf(\"%s\\n\", starline)\n\t\tfmt.Printf(\"\\n\")\n\t}\n\n\tif required {\n\t\tif os.Getenv(\"KOPS_RUN_OBSOLETE_VERSION\") == \"\" {\n\t\t\treturn fmt.Errorf(\"kops upgrade is required\")\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// validateKubernetesVersion ensures that kubernetes meet the version requirements / recommendations in the channel\nfunc (c *ApplyClusterCmd) validateKubernetesVersion() error {\n\tparsed, err := util.ParseKubernetesVersion(c.Cluster.Spec.KubernetesVersion)\n\tif err != nil {\n\t\tklog.Warningf(\"unable to parse kubernetes version %q\", c.Cluster.Spec.KubernetesVersion)\n\t\t// Not a hard-error\n\t\treturn nil\n\t}\n\n\tkopsVersion, err := semver.Parse(kopsbase.Version)\n\tif err != nil {\n\t\tklog.Warningf(\"unable to parse kops version %q\", kopsVersion)","sourceCodeStart":948,"sourceCodeEnd":984,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/apply_cluster.go#L948-L984","documentation":"validateKopsVersion checks the kops binary's own version against the requirements in the cluster's channel file. If the channel marks the running kops version as requiring an upgrade (too old / no longer supported), apply is refused with 'kops upgrade is required' — unless the KOPS_RUN_OBSOLETE_VERSION env var is set.","triggerScenarios":"Running `kops update cluster` (or apply/GetAssetBuilder paths) with a kops binary version that the channel's kopsVersions spec marks as required-to-upgrade, with KOPS_RUN_OBSOLETE_VERSION unset.","commonSituations":"Using an EOL kops release months/years old; channel file updated to retire old kops versions while users still run stale binaries; CI pipelines pinning an outdated kops version; air-gapped clusters that never upgraded.","solutions":["Upgrade the kops binary to the latest release (https://github.com/kubernetes/kops/releases), then re-run","Temporarily bypass with: export KOPS_RUN_OBSOLETE_VERSION=1 (not recommended for production)","Pin to a supported kops version in CI matching your cluster channel","Follow the permalink printed above the error (upgrade_kops) for version guidance"],"exampleFix":"// before\nkops update cluster mycluster.example.com   # kops 1.24 (retired by channel)\n// after\ncurl -LO https://github.com/kubernetes/kops/releases/download/v1.31.0/kops-linux-amd64\nsudo install kops-linux-amd64 /usr/local/bin/kops\nkops update cluster mycluster.example.com","handlingStrategy":"validation","validationCode":"// pin and verify the kops binary version before applying\nv, err := exec.Command(\"kops\", \"version\").Output()\nif err != nil || !supportedKopsVersion(string(v)) {\n\treturn fmt.Errorf(\"upgrade kops binary before applying\")\n}","typeGuard":null,"tryCatchPattern":"if err := cmd.Run(ctx); err != nil && strings.Contains(err.Error(), \"kops upgrade is required\") {\n\t// upgrade the kops binary; only set KOPS_RUN_OBSOLETE_VERSION=1 for testing\n}","preventionTips":["Keep the kops binary current with the latest release","Pin a supported kops version in CI images and update it regularly","Re-check kops version after channel/stable updates","Never rely on KOPS_RUN_OBSOLETE_VERSION in production pipelines"],"tags":["version-check","upgrade","channel"],"backgroundTag":"kops-version-eol","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"}