{"record":{"id":"a5ef74023fb7b11b","repo":"kubernetes/kops","slug":"error-loading-cluster-addon-s-v","errorCode":null,"errorMessage":"error loading cluster addon %s: %v","messagePattern":"error loading cluster addon (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops/create_cluster.go","lineNumber":757,"sourceCode":"\tfullCluster, err := cloudup.PopulateClusterSpec(ctx, clientset, cluster, instanceGroups, cloud, assetBuilder)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tkubernetesVersion, err := kopsutil.ParseKubernetesVersion(clusterResult.Cluster.Spec.KubernetesVersion)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"cannot parse KubernetesVersion %q in cluster: %w\", clusterResult.Cluster.Spec.KubernetesVersion, err)\n\t}\n\n\taddons, err := wellknownoperators.CreateAddons(clusterResult.Channel, kubernetesVersion, fullCluster)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor _, p := range c.AddonPaths {\n\t\taddon, err := clusteraddons.LoadClusterAddon(clientset.VFSContext(), p)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error loading cluster addon %s: %v\", p, err)\n\t\t}\n\t\taddons = append(addons, addon.Objects...)\n\t}\n\n\t{\n\t\t// Build full IG spec to ensure we end up with a valid IG\n\t\tfullInstanceGroups := []*api.InstanceGroup{}\n\t\tfor _, group := range instanceGroups {\n\t\t\tfullGroup, err := cloudup.PopulateInstanceGroupSpec(cluster, group, cloud, clusterResult.Channel)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfullInstanceGroups = append(fullInstanceGroups, fullGroup)\n\t\t}\n\n\t\terr = validation.DeepValidate(fullCluster, fullInstanceGroups, true, clientset.VFSContext(), nil)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"validation of the full cluster and instance group specs failed: %w\", err)","sourceCodeStart":739,"sourceCodeEnd":775,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops/create_cluster.go#L739-L775","documentation":"RunCreateCluster wraps any failure from clusteraddons.LoadClusterAddon when iterating over the user-supplied --addon paths. It means kops could not read or parse one of the addon manifests given on the command line, so cluster creation aborts before any state is written. The wrapped %v carries the underlying cause (unreadable path, invalid YAML, or bad addon schema).","triggerScenarios":"`kops create cluster --addon <path>` where the path does not exist, is unreadable, or the file is not a valid cluster addon YAML/JSON manifest (clusteraddons.LoadClusterAddon returns err for that path).","commonSituations":"Typo in the addon file path; addon manifest copied from docs with wrong schema/version; file exists locally but not in the working directory of the CI job; passing a raw Kubernetes manifest that is not kops addon format.","solutions":["Check the path passed to --addon exists and is readable (ls/cat the file).","Validate the addon manifest is a valid kops addon (correct apiVersion/kind and addon spec fields).","Re-download or re-export the addon manifest from a trusted source.","Run with -v=2 to see which path failed and the underlying parse error."],"exampleFix":"// before\nkops create cluster --name mycluster.k8s.local --addons=./adons/csi.yaml\n// after\nkops create cluster --name mycluster.k8s.local --addons=./addons/csi.yaml","handlingStrategy":"validation","validationCode":"for _, p := range addonPaths {\n\tif st, err := os.Stat(p); err != nil || st.IsDir() {\n\t\treturn fmt.Errorf(\"addon path %s is not a readable file\", p)\n\t}\n}","typeGuard":null,"tryCatchPattern":"if err := runCreateCluster(...); err != nil {\n\tif strings.Contains(err.Error(), \"error loading cluster addon\") {\n\t\t// parse the failing path from the message and fix/replace the manifest\n\t}\n\treturn err\n}","preventionTips":["Pre-check every --addon path with os.Stat before invoking kops.","Keep addon manifests in a versioned repo directory.","Validate addon YAML schema before use.","Quote paths in scripts to avoid word-splitting."],"tags":["cli","addons","file-parsing"],"backgroundTag":"invalid-addon-manifest","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"}