{"record":{"id":"8a583cb38dfae832","repo":"kubernetes/kops","slug":"invalid-bucket-path-q","errorCode":null,"errorMessage":"invalid bucket path: %q","messagePattern":"invalid bucket path: %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"util/pkg/vfs/context.go","lineNumber":630,"sourceCode":"\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif c.azureClients == nil {\n\t\tc.azureClients = make(map[string]*azblob.Client)\n\t}\n\tc.azureClients[account] = client\n\treturn client, nil\n}\n\nfunc (c *VFSContext) buildSCWPath(p string) (*S3Path, error) {\n\tendpoint := os.Getenv(\"S3_ENDPOINT\")\n\tif endpoint == \"\" {\n\t\treturn nil, fmt.Errorf(\"required S3_ENDPOINT env var for path: %q\", p)\n\t}\n\n\tu, err := url.Parse(p)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid bucket path: %q\", p)\n\t}\n\tif u.Scheme != \"scw\" {\n\t\treturn nil, fmt.Errorf(\"invalid bucket path: %q\", p)\n\t}\n\n\tbucket := strings.TrimSuffix(u.Host, \"/\")\n\tif bucket == \"\" {\n\t\treturn nil, fmt.Errorf(\"invalid bucket path: %q\", p)\n\t}\n\n\ts3path := newS3Path(c.s3Context, u.Scheme, bucket, u.Path, false, func(o *s3.Options) {\n\t\to.BaseEndpoint = aws.String(endpoint)\n\t\to.UsePathStyle = true\n\t\to.DisableLogOutputChecksumValidationSkipped = true\n\t})\n\treturn s3path, nil\n}\n","sourceCodeStart":612,"sourceCodeEnd":648,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/util/pkg/vfs/context.go#L612-L648","documentation":"buildSCWPath validates that the given path parses as a URL and carries the scw scheme. This error is thrown when url.Parse fails on the string, meaning the path is malformed and cannot be interpreted as a bucket URL.","triggerScenarios":"Calling BuildVfsPath with a string registered for the scw handler that url.Parse rejects — e.g. contains control characters, invalid percent-escapes like \"%zz\", or is otherwise not a valid URL.","commonSituations":"Copy-pasted state store values with stray whitespace/control characters, shell-expanded variables containing invalid escape sequences, or typos that corrupt the URL.","solutions":["Correct the scw:// URL so it is a valid URL (no invalid % escapes or control characters).","Echo the state store value and re-enter it manually to eliminate invisible characters from copy-paste.","Quote the value in the shell to prevent glob/escape expansion (e.g. export KOPS_STATE_STORE='scw://bucket')."],"exampleFix":"// before\nBuildVfsPath(\"scw://my%zzbucket/state\") // invalid percent-escape\n// after\nBuildVfsPath(\"scw://my-bucket/state\")","handlingStrategy":"validation","validationCode":"if _, err := url.Parse(stateStore); err != nil {\n    return fmt.Errorf(\"state store %q is not a valid URL: %w\", stateStore, err)\n}","typeGuard":"func isParseableURL(p string) bool {\n    _, err := url.Parse(p)\n    return err == nil\n}","tryCatchPattern":"if _, err := ctx.BuildVfsPath(p); err != nil && strings.Contains(err.Error(), \"invalid bucket path\") {\n    return fmt.Errorf(\"check the state store URL for typos/invalid escapes: %w\", err)\n}","preventionTips":["Quote state store values in shell to avoid escape/glob expansion.","Re-type the URL manually if it was copy-pasted with unknown characters.","Keep bucket names URL-safe (lowercase letters, digits, hyphens)."],"tags":["scaleway","vfs","url-parsing","configuration"],"backgroundTag":"invalid-url","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"}