kubernetes/kops · error

parsing configStore.base %q: %w

Error message

parsing configStore.base %q: %w

What it means

When the channels manifest comes from s3, GetBootstrapData needs a vfs handle to the cluster's ConfigStore.Base to locate the addons/bootstrap-channel.yaml object. This error wraps a failure of vfs.Context.BuildVfsPath on cluster.Spec.ConfigStore.Base, i.e. the configured base string could not be parsed/validated as a VFS path.

Source

Thrown at pkg/commands/toolbox_enroll.go:940

			*pSrc = dest
			return nil
		}

		for i := range nodeupConfig.EtcdManifests {
			if err := remapFile(&nodeupConfig.EtcdManifests[i], path.Join(targetDir)); err != nil {
				return nil, err
			}
		}

		// The kops-channels static pod is built at cloudup with the remote bootstrap URL baked
		// into its args. To run on an enrolled node without state-store credentials, copy the
		// addons tree onto the host, pull the manifest down, then rewrite the bootstrap URL in
		// the manifest to file://<local addons>/bootstrap-channel.yaml (+ matching hostPath mount).
		if strings.HasPrefix(nodeupConfig.ChannelsManifest, remapPrefix) {
			configBase, err := vfs.Context.BuildVfsPath(cluster.Spec.ConfigStore.Base)
			if err != nil {
				return nil, fmt.Errorf("parsing configStore.base %q: %w", cluster.Spec.ConfigStore.Base, err)
			}
			bootstrapChannelURL := configBase.Join("addons", "bootstrap-channel.yaml").Path()

			addonsPath := configBase.Join("addons").Path()
			if err := remapTree(&addonsPath, path.Join(targetDir, "addons")); err != nil {
				return nil, err
			}
			localAddons := addonsPath // remapTree mutated it in place to the on-host destination
			if err := remapFile(&nodeupConfig.ChannelsManifest, targetDir); err != nil {
				return nil, err
			}
			rewritten, err := rewriteChannelsManifestForEnroll(
				bootstrapData.NodeupScriptAdditionalFiles[nodeupConfig.ChannelsManifest],
				bootstrapChannelURL,
				localAddons,
			)
			if err != nil {
				return nil, fmt.Errorf("rewriting channels manifest: %w", err)

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Inspect cluster.Spec.ConfigStore.Base (kops get cluster -o yaml) and fix it to a valid state-store URI, e.g. s3://<bucket>/<cluster>.
  2. Ensure the backend context is complete: set the AWS region/credentials or GCS env so vfs can resolve the bucket.
  3. If the field is empty, run `kops set cluster cluster.spec.configStore.base=s3://...` or update the cluster spec from a good export.
  4. Validate the URI characters (no spaces/unescaped specials) and re-run toolbox enroll.

Example fix

// before (malformed base in cluster spec)
configStore:
  base: "s3://my bucket//cluster/"
// after
configStore:
  base: "s3://my-bucket/cluster.example.com"
Defensive patterns

Strategy: validation

Validate before calling

// Before enroll: sanity-check the cluster's configStore.base
spec=$(kops get cluster -o yaml | yq '.spec.configStore.base')
case "$spec" in
  s3://*|gs://*) echo "base OK: $spec" ;;
  *) echo "INVALID base: $spec"; exit 1 ;;
esac

Type guard

func isValidStateStoreBase(base string) bool {
    u, err := url.Parse(base)
    return err == nil && (u.Scheme == "s3" || u.Scheme == "gs") && u.Host != ""
}

Try / catch

if err := runToolboxEnroll(ctx, ...); err != nil {
    if strings.Contains(err.Error(), "parsing configStore.base") {
        // fix the spec then retry once
        exec.Command("kops", "set", "cluster", "cluster.spec.configStore.base=s3://bucket/cluster").Run()
        return runToolboxEnroll(ctx, ...)
    }
    return err
}

Prevention

When it happens

Trigger: GetBootstrapData (called by getNodeConfig, RunToolboxEnroll, buildBootstrapData) on a control-plane group with an s3:// ChannelsManifest, where cluster.Spec.ConfigStore.Base is empty, malformed (bad scheme, unescaped characters, double slashes), or names a backend whose driver failed to initialize (missing region/bucket config).

Common situations: Cluster spec edited by hand or by tooling with an invalid configStore.base; migrating between state-store backends and leaving a stale URI; missing AWS region/env config so the s3 vfs context cannot resolve the bucket; typo'd scheme like s3a:// or file path used where a state-store URI is required.

Related errors


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