kubernetes/kops · critical

cannot parse ConfigBase %q: %w

Error message

cannot parse ConfigBase %q: %w

What it means

NewServer parses the --config-base option into a VFS path via vfsContext.BuildVfsPath. This error wraps the parse failure, meaning the ConfigBase value is not a valid VFS path/URL (bad scheme, malformed path).

Source

Thrown at cmd/kops-controller/pkg/server/server.go:95

func NewServer(vfsContext *vfs.VFSContext, opt *config.Options, verifier bootstrap.Verifier, uncachedClient client.Client) (*Server, error) {
	server := &http.Server{
		Addr: opt.Server.Listen,
		TLSConfig: &tls.Config{
			MinVersion: tls.VersionTLS12,
		},
	}

	s := &Server{
		opt:            opt,
		certNames:      sets.New(opt.Server.CertNames...),
		server:         server,
		verifier:       verifier,
		uncachedClient: uncachedClient,
	}

	configBase, err := vfsContext.BuildVfsPath(opt.ConfigBase)
	if err != nil {
		return nil, fmt.Errorf("cannot parse ConfigBase %q: %w", opt.ConfigBase, err)
	}
	s.configBase = configBase

	s.keystore, s.keypairIDs, err = newKeystore(opt.Server.CABasePath, opt.Server.SigningCAs)
	if err != nil {
		return nil, err
	}

	p, err := vfsContext.BuildVfsPath(opt.SecretStore)
	if err != nil {
		return nil, fmt.Errorf("cannot parse SecretStore %q: %w", opt.SecretStore, err)
	}
	s.secretStore = secrets.NewVFSSecretStore(nil, p)

	clientset, err := controllerclientset.New(vfsContext, configBase, opt.ClusterName, s.keystore, s.secretStore)
	if err != nil {
		return nil, fmt.Errorf("building controller clientset: %w", err)
	}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Check the wrapped error for the specific parse complaint
  2. Use a full valid VFS path, e.g. s3://bucket/cluster or gs://bucket/cluster
  3. Ensure the storage backend for the scheme is supported in this binary
  4. Re-run kops export/inspect to confirm the canonical ConfigBase value

Example fix

// before
--config-base=s3:/bucket/cluster
// after
--config-base=s3://bucket/cluster
Defensive patterns

Strategy: validation

Validate before calling

if !strings.Contains(opt.ConfigBase, "://") {
    return fmt.Errorf("--config-base must be a VFS path, got %q", opt.ConfigBase)
}

Try / catch

if _, err := vfsContext.BuildVfsPath(opt.ConfigBase); err != nil {
    return nil, fmt.Errorf("cannot parse ConfigBase %q: %w", opt.ConfigBase, err)
}

Prevention

When it happens

Trigger: kops-controller started with an opt.ConfigBase string like a typo'd URL, unsupported scheme, or empty/invalid path.

Common situations: Typo in --config-base flag; using a scheme not compiled into this build; flag unset or containing stray whitespace/quotes; copy-paste error between s3://, gs://, or file:// forms.

Related errors


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