kubernetes/kops · error

error parsing ConfigStore.Base %q: %v

Error message

error parsing ConfigStore.Base %q: %v

What it means

ConfigBase in pkg/apis/kops/registry/registry.go resolves the cluster's spec.configStore.base string into a vfs.Path via vfsContext.BuildVfsPath. The cluster was created without a ConfigStore.Base (which also yields a separate Required-field error) or the base string is not a parseable VFS path (e.g. malformed s3:// gs:// or memfs:// URL), producing "error parsing ConfigStore.Base %q".

Source

Thrown at pkg/apis/kops/registry/registry.go:42

	"k8s.io/kops/util/pkg/vfs"
)

const (
	// Path for the user-specified cluster spec
	PathCluster = "config"
	// PathClusterCompleted is the path for completed cluster spec in the state store.
	PathClusterCompleted = "cluster-completed.spec"
	// PathKopsVersionUpdated is the path for the version of kops last used to apply the cluster.
	PathKopsVersionUpdated = "kops-version.txt"
)

func ConfigBase(vfsContext *vfs.VFSContext, c *api.Cluster) (vfs.Path, error) {
	if c.Spec.ConfigStore.Base == "" {
		return nil, field.Required(field.NewPath("spec", "configStore", "base"), "")
	}
	configBase, err := vfsContext.BuildVfsPath(c.Spec.ConfigStore.Base)
	if err != nil {
		return nil, fmt.Errorf("error parsing ConfigStore.Base %q: %v", c.Spec.ConfigStore.Base, err)
	}
	return configBase, nil
}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Print/inspect the quoted %q value in the error and fix spec.configStore.base to a valid VFS path, e.g. s3://<bucket>/<prefix> (double slashes).
  2. Use the --state flag / KOPS_STATE_STORE env var and let kops set ConfigStore.Base instead of editing manifests by hand.
  3. Confirm the scheme is supported by this build (s3, gs, azure, do, hetzner, openstack, memfs, file).
  4. If loading from YAML/JSON, re-export the cluster spec with `kops get -o yaml` to normalize the field.

Example fix

// before (cluster.yaml)
spec:
  configStore:
    base: s3:/my-state-bucket/clusters
// after
spec:
  configStore:
    base: s3://my-state-bucket/clusters
Defensive patterns

Strategy: validation

Validate before calling

func validateConfigBase(c *api.Cluster) error {
	base := c.Spec.ConfigStore.Base
	if base == "" {
		return field.Required(field.NewPath("spec", "configStore", "base"), "")
	}
	if _, err := vfs.Context.BuildVfsPath(base); err != nil {
		return fmt.Errorf("invalid ConfigStore.Base %q: %v", base, err)
	}
	return nil
}

Try / catch

configBase, err := ConfigBase(vfs.Context, cluster)
if err != nil {
	return fmt.Errorf("cannot resolve state store for %s: %w (check spec.configStore.base / --state)", cluster.Name, err)
}

Prevention

When it happens

Trigger: Calling ConfigBase (directly or via SecretStore, pkiPath, fullClusterSpecs, DeleteCluster) with an api.Cluster whose Spec.ConfigStore.Base contains an unparseable scheme/path — for example "s3:/bucket" (single slash), "httpx://...", or a path with invalid characters that the VFS context cannot map.

Common situations: Hand-edited cluster manifest with a typo in the state store URL; migrating clusters between kOps versions where ConfigStore.Base was serialized incorrectly; using a state store scheme not compiled into the binary; constructing Cluster structs programmatically with an empty or relative base.

Related errors


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/10d8f2f74fd09b06. Report an issue: GitHub.