{"record":{"id":"506c07646b5d107d","repo":"kubernetes/kops","slug":"error-building-configstore-base-for-cluster-v","errorCode":null,"errorMessage":"error building ConfigStore.Base for cluster: %v","messagePattern":"error building ConfigStore\\.Base for cluster: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"pkg/client/simple/vfsclientset/cluster.go","lineNumber":210,"sourceCode":"\t\t\treturn nil, nil\n\t\t}\n\t\treturn nil, fmt.Errorf(\"error reading cluster configuration %q: %v\", clusterName, err)\n\t}\n\n\tc := o.(*api.Cluster)\n\n\tif c.ObjectMeta.Name == \"\" {\n\t\tc.ObjectMeta.Name = clusterName\n\t}\n\tif c.ObjectMeta.Name != clusterName {\n\t\tklog.Warningf(\"Name of cluster does not match: actual name was %q, but cluster name was %q (using registry path %v).\", c.ObjectMeta.Name, clusterName, registry.PathCluster)\n\t}\n\n\t// TODO: Split this out into real version updates / schema changes\n\tif c.Spec.ConfigStore.Base == \"\" {\n\t\tconfigBase, err := r.configBase(clusterName)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error building ConfigStore.Base for cluster: %v\", err)\n\t\t}\n\t\tc.Spec.ConfigStore.Base = configBase.Path()\n\t}\n\n\treturn c, nil\n}\n\nfunc (r *ClusterVFS) Delete(name string, options *metav1.DeleteOptions) error {\n\treturn fmt.Errorf(\"cluster Delete not implemented for vfs store\")\n}\n\nfunc (r *ClusterVFS) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {\n\treturn fmt.Errorf(\"cluster DeleteCollection not implemented for vfs store\")\n}\n\nfunc (r *ClusterVFS) Watch(opts metav1.ListOptions) (watch.Interface, error) {\n\treturn nil, fmt.Errorf(\"cluster Watch not implemented for vfs store\")\n}","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/client/simple/vfsclientset/cluster.go#L192-L228","documentation":"When a loaded Cluster has an empty Spec.ConfigStore.Base, find derives it from the state-store path via the deprecated configBase helper. If that helper returns an error (empty cluster name), the failure is re-wrapped as 'error building ConfigStore.Base for cluster'.","triggerScenarios":"find(ctx, \"\") reaching the ConfigStore.Base defaulting branch — but note find normally rejects empty names earlier; also configBase failing for any wrapped reason while defaulting ConfigStore.Base for a legacy cluster config that predates the field.","commonSituations":"Old cluster configs created before ConfigStore.Base was always persisted; programmatic callers constructing ClusterVFS with an unset basePath and empty name.","solutions":["Ensure the cluster name passed to Get/find is non-empty so configBase can build the path","Set Spec.ConfigStore.Base explicitly in the cluster config (kops edit cluster) to skip defaulting","Re-save the cluster config with a current kops so ConfigStore.Base is persisted"],"exampleFix":"// before (cluster config yaml)\nspec:\n  configStore: {}\n// after\nspec:\n  configStore:\n    base: s3://kops-clusters/prod.example.com","handlingStrategy":"validation","validationCode":"if cluster.Spec.ConfigStore.Base == \"\" && cluster.ObjectMeta.Name == \"\" {\n\treturn fmt.Errorf(\"cannot default ConfigStore.Base: both base and cluster name are empty\")\n}","typeGuard":null,"tryCatchPattern":"cluster, err := clusterVFS.Get(ctx, name, metav1.GetOptions{})\nif err != nil && strings.Contains(err.Error(), \"error building ConfigStore.Base\") {\n\t// fall back to computing base from a known state store URL\n\tcluster.Spec.ConfigStore.Base = stateStoreURL + \"/\" + name\n}","preventionTips":["Persist Spec.ConfigStore.Base in cluster configs (re-save with modern kops)","Pass the state store URL explicitly rather than relying on defaulting","Keep cluster names non-empty through the whole load path"],"tags":["go","vfs","state-store","migration"],"backgroundTag":"config-store-base-missing","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"}