{"record":{"id":"818e6cc2bf1e5599","repo":"kubernetes/kops","slug":"invalid-google-cloud-url-unexpected-end-q","errorCode":null,"errorMessage":"invalid google cloud URL (unexpected end): %q","messagePattern":"invalid google cloud URL \\(unexpected end\\): %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/gce/gce_url.go","lineNumber":80,"sourceCode":"\tif tokens[0] != \"https:\" || tokens[1] != \"\" || tokens[2] != \"www.googleapis.com\" {\n\t\treturn nil, fmt.Errorf(\"invalid google cloud URL (schema / host): %q\", u)\n\t}\n\n\tif len(tokens) < 5 || tokens[3] != \"compute\" {\n\t\treturn nil, fmt.Errorf(\"invalid google cloud URL (not compute): %q\", u)\n\t}\n\n\tif tokens[4] != \"v1\" && tokens[4] != \"beta\" {\n\t\treturn nil, fmt.Errorf(\"invalid google cloud URL (not compute/v1 or compute/beta): %q\", u)\n\t}\n\n\tparsed := &GoogleCloudURL{\n\t\tVersion: tokens[4],\n\t}\n\tpos := 5\n\tfor {\n\t\tif pos >= len(tokens) {\n\t\t\treturn nil, fmt.Errorf(\"invalid google cloud URL (unexpected end): %q\", u)\n\t\t}\n\t\tt := tokens[pos]\n\t\tswitch {\n\t\tcase t == \"projects\":\n\t\t\tpos++\n\t\t\tif pos >= len(tokens) {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid google cloud URL (unexpected projects): %q\", u)\n\t\t\t}\n\t\t\tparsed.Project = tokens[pos]\n\t\tcase t == \"zones\":\n\t\t\tpos++\n\t\t\tif pos >= len(tokens) {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid google cloud URL (unexpected zones): %q\", u)\n\t\t\t}\n\t\t\tparsed.Zone = tokens[pos]\n\t\tcase t == \"regions\" && ((pos + 2) < len(tokens)):\n\t\t\tpos++\n\t\t\tif pos >= len(tokens) {","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/gce/gce_url.go#L62-L98","documentation":"Loop-stage parse guard in ParseGoogleCloudURL: while walking path segments (projects/zones/regions/global/type/name), the tokens ran out before a complete resource could be parsed — e.g. the URL ends right after a keyword or the resource type without a name.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/gce/gce_url.go:80 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide the complete self-link including resource type and name","Check for truncated URLs","Fix the source value"],"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"}