{"record":{"id":"92b5a9d1691f88e2","repo":"kubernetes/kops","slug":"error-parsing-managedfile-base-q-v","errorCode":null,"errorMessage":"error parsing ManagedFile Base %q: %v","messagePattern":"error parsing ManagedFile Base %q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/fitasks/managedfile.go","lineNumber":192,"sourceCode":"\tacl, err := e.getACL(c, p)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = p.WriteFile(ctx, bytes.NewReader(data), acl)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error creating ManagedFile %q: %v\", location, err)\n\t}\n\n\treturn nil\n}\n\nfunc getBasePath(c *fi.CloudupContext, e *ManagedFile) (vfs.Path, error) {\n\tbase := fi.ValueOf(e.Base)\n\tif base != \"\" {\n\t\tp, err := vfs.Context.BuildVfsPath(base)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error parsing ManagedFile Base %q: %v\", base, err)\n\t\t}\n\t\treturn p, nil\n\t}\n\n\treturn c.T.ClusterConfigBase, nil\n}\n\n// RenderTerraform is responsible for rendering the terraform json.\nfunc (f *ManagedFile) RenderTerraform(c *fi.CloudupContext, t *terraform.TerraformTarget, a, e, changes *ManagedFile) error {\n\tif !featureflag.TerraformManagedFiles.Enabled() {\n\t\treturn f.Render(c, a, e, changes)\n\t}\n\n\tlocation := fi.ValueOf(e.Location)\n\tif location == \"\" {\n\t\treturn fi.RequiredField(\"Location\")\n\t}\n","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/fitasks/managedfile.go#L174-L210","documentation":"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.","triggerScenarios":"ManagedFile.Base is set to a string that BuildVfsPath cannot parse — malformed URI, unknown scheme (not s3://, gs://, memfs://, etc.), or invalid path syntax.","commonSituations":"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.","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."],"exampleFix":"// before\nbase: \"s3:/my-bucket/cluster.example.com\"\n// after\nbase: \"s3://my-bucket/cluster.example.com\"","handlingStrategy":"validation","validationCode":"u, err := url.Parse(base)\nif err != nil || u.Scheme == \"\" { return fmt.Errorf(\"bad ManagedFile base %q\", base) }\nsupported := map[string]bool{\"s3\": true, \"gs\": true, \"memfs\": true, \"file\": true}\nif !supported[u.Scheme] { return fmt.Errorf(\"unsupported VFS scheme %q\", u.Scheme) }","typeGuard":null,"tryCatchPattern":"if err != nil { return fmt.Errorf(\"error parsing ManagedFile Base %q: %w\", base, err) }","preventionTips":["Always use scheme:// with double slashes for VFS paths","Omit Base to inherit ClusterConfigBase","Test the base with kops toolbox / vfs before applying"],"tags":["vfs","parsing","config"],"backgroundTag":"invalid-vfs-path","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"}