kubernetes/kops · error
error parsing ManagedFile Base %q: %v
Error message
error parsing ManagedFile Base %q: %v
What it means
Thrown by getBasePath when a ManagedFile task has a non-empty Base path string that vfs.Context.BuildVfsPath cannot parse into a valid VFS path. The Base value uses an unsupported scheme or malformed location (e.g. missing bucket, bad component), so the final file path cannot be composed from base + location.
Source
Thrown at upup/pkg/fi/fitasks/managedfile.go:192
acl, err := e.getACL(c, p)
if err != nil {
return err
}
err = p.WriteFile(ctx, bytes.NewReader(data), acl)
if err != nil {
return fmt.Errorf("error creating ManagedFile %q: %v", location, err)
}
return nil
}
func getBasePath(c *fi.CloudupContext, e *ManagedFile) (vfs.Path, error) {
base := fi.ValueOf(e.Base)
if base != "" {
p, err := vfs.Context.BuildVfsPath(base)
if err != nil {
return nil, fmt.Errorf("error parsing ManagedFile Base %q: %v", base, err)
}
return p, nil
}
return c.T.ClusterConfigBase, nil
}
// RenderTerraform is responsible for rendering the terraform json.
func (f *ManagedFile) RenderTerraform(c *fi.CloudupContext, t *terraform.TerraformTarget, a, e, changes *ManagedFile) error {
if !featureflag.TerraformManagedFiles.Enabled() {
return f.Render(c, a, e, changes)
}
location := fi.ValueOf(e.Location)
if location == "" {
return fi.RequiredField("Location")
}
View on GitHub (pinned to 4c8573c808)
Solutions
- Correct the Base value to a well-formed VFS path with a supported scheme, e.g. s3://bucket/cluster.example.com.
- Omit Base entirely so the cluster's ClusterConfigBase is used.
- Run with -v=10 to see the underlying BuildVfsPath error for details.
Example fix
// before base: "s3:/my-bucket/cluster.example.com" // after base: "s3://my-bucket/cluster.example.com"
Defensive patterns
Strategy: validation
Validate before calling
u, err := url.Parse(base)
if err != nil || u.Scheme == "" { return fmt.Errorf("bad ManagedFile base %q", base) }
supported := map[string]bool{"s3": true, "gs": true, "memfs": true, "file": true}
if !supported[u.Scheme] { return fmt.Errorf("unsupported VFS scheme %q", u.Scheme) } Try / catch
if err != nil { return fmt.Errorf("error parsing ManagedFile Base %q: %w", base, err) } Prevention
- Always use scheme:// with double slashes for VFS paths
- Omit Base to inherit ClusterConfigBase
- Test the base with kops toolbox / vfs before applying
When it happens
Trigger: ManagedFile.Base is set to a string that BuildVfsPath cannot parse — malformed URI, unknown scheme (not s3://, gs://, memfs://, etc.), or invalid path syntax.
Common situations: Typos in the base URL in cluster config (e.g. "s3:/bucket" with a missing slash, or "http://" which has no VFS handler), or an old/removed VFS scheme.
Related errors
- error parsing configStore.base %q: %v
- cannot parse ConfigBase %q: %w
- parsing additional containerd config entry %q: %w
- error parsing path for etcd manifest %s: %v
- error parsing ConfigStore.Base %q: %v
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/92b5a9d1691f88e2.
Report an issue: GitHub.