{"record":{"id":"2133428d0aaf1788","repo":"kubernetes/kops","slug":"unable-to-parse-google-cloud-storage-url-q","errorCode":null,"errorMessage":"Unable to parse Google Cloud Storage URL: %q","messagePattern":"Unable to parse Google Cloud Storage URL: %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/assets/assetcopy/copyfile.go","lineNumber":200,"sourceCode":"\tif !strings.Contains(target, \"://\") || strings.HasPrefix(target, \"memfs://\") || strings.HasPrefix(target, \"file://\") ||\n\t\tstrings.HasPrefix(target, \"gs://\") || strings.HasPrefix(target, \"s3://\") || strings.HasPrefix(target, \"azureblob://\") {\n\t\treturn target, nil\n\t}\n\n\tvar vfsPath string\n\n\t// Matches all S3 regional naming conventions:\n\t// https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region\n\t// and converts to a s3://<bucket>/<path> vfsPath\n\ts3VfsPath, err := vfs.VFSPath(target)\n\tif err == nil {\n\t\tvfsPath = s3VfsPath\n\t} else {\n\t\t// Convert a GCS URL in the https://storage.googleapis.com/<bucket>/<path> form to the\n\t\t// equivalent gs:// vfsPath. The gs:// form itself was already passed through above.\n\t\tu, err := url.Parse(target)\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"Unable to parse Google Cloud Storage URL: %q\", target)\n\t\t}\n\t\tif u.Host == \"storage.googleapis.com\" {\n\t\t\tvfsPath = \"gs:/\" + u.Path\n\t\t}\n\t}\n\n\tif vfsPath == \"\" {\n\t\tklog.Errorf(\"Unable to determine VFS path from supplied URL: %s\", target)\n\t\tklog.Errorf(\"S3, Google Cloud Storage, and File Paths are supported.\")\n\t\tklog.Errorf(\"For S3, please make sure that the supplied file repository URL starts with s3:// or adheres to S3 naming conventions.\")\n\t\tklog.Errorf(\"For GCS, please make sure that the supplied file repository URL starts with gs:// or https://storage.googleapis.com/\")\n\t\tif err != nil { // print the S3 error for more details\n\t\t\treturn \"\", fmt.Errorf(\"Error Details: %v\", err)\n\t\t}\n\t\treturn \"\", fmt.Errorf(\"unable to determine vfs type for %q\", target)\n\t}\n\n\treturn vfsPath, nil","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/assets/assetcopy/copyfile.go#L182-L218","documentation":"buildVFSPath converts HTTPS URLs of copied assets into s3:// or gs:// VFS paths; this error fires when an https://storage.googleapis.com URL has an unexpected shape that cannot be split into bucket/object. Local and scheme-native targets are returned unchanged before this parse, so only malformed GCS HTTPS URLs hit this guard.","triggerScenarios":"Thrown at pkg/assets/assetcopy/copyfile.go:200 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use s3:// or gs:// URLs directly","Fix malformed URL characters in the file repository URL","Use a plain file path for local assets"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}