{"record":{"id":"3a74c82c7e7de399","repo":"apache/beam","slug":"err","errorCode":null,"errorMessage":"err","messagePattern":"err","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/artifact/gcsproxy/retrieval.go","lineNumber":152,"sourceCode":"\t\t}\n\t\tif !fresh {\n\t\t\treturn errors.Errorf(\"multiple locations for %v:%v\", l.Name, l.Uri)\n\t\t}\n\t\tkeys[l.Name] = false\n\t}\n\n\tfor key, fresh := range keys {\n\t\tif fresh {\n\t\t\treturn errors.Errorf(\"no location for %v\", key)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc parseObject(blob string) (string, string) {\n\tbucket, object, err := gcsx.ParseObject(blob)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn bucket, object\n}\n","sourceCodeStart":134,"sourceCodeEnd":156,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/artifact/gcsproxy/retrieval.go#L134-L156","documentation":"The GCS artifact proxy's parseObject helper parses a GCS blob reference ('bucket/object') via gcsx.ParseObject and panics directly on any parse error, surfacing the underlying error object as the panic value (hence the reported message 'err').","triggerScenarios":"Calling GetArtifact with an artifact whose GCS reference string is malformed — missing the bucket or object portion, or otherwise not matching gcsx.ParseObject's expected 'gs://bucket/object' shape.","commonSituations":"Staging artifacts with hand-constructed GCS paths; environment/staging configuration pointing at a non-GCS or truncated artifact location.","solutions":["Validate the artifact's GCS blob string is a well-formed 'bucket/object' (or gs:// URL) before calling GetArtifact","Read the panic value's underlying error message to see exactly how the path failed to parse","Change parseObject to return the error instead of panicking if you control the caller path","Check how artifacts were staged — the staging service usually constructs these paths"],"exampleFix":"// before\nfunc parseObject(blob string) (string, string) {\n\tbucket, object, err := gcsx.ParseObject(blob)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n// after\nfunc parseObject(blob string) (string, string, error) {\n\tbucket, object, err := gcsx.ParseObject(blob)\n\tif err != nil {\n\t\treturn \"\", \"\", fmt.Errorf(\"invalid GCS artifact path %q: %w\", blob, err)\n\t}","handlingStrategy":"validation","validationCode":"if blob == \"\" || !strings.Contains(blob, \"/\") {\n\treturn errors.New(\"invalid GCS artifact path: expected bucket/object\")\n}","typeGuard":null,"tryCatchPattern":"func safeParseObject(blob string) (bucket, object string) {\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\tbucket, object = \"\", \"\"\n\t\t}\n\t}()\n\treturn parseObject(blob)\n}","preventionTips":["Validate artifact paths match gs://bucket/object before staging","Log the panic value's underlying ParseObject error for diagnosis","Avoid hand-constructing GCS paths; use the staging service outputs"],"tags":["go","apache-beam","gcs","panic","artifacts"],"backgroundTag":"invalid-url-format","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}