{"record":{"id":"3ebb0113a690f7bb","repo":"apache/beam","slug":"invalid-bundle-processing-state-d","errorCode":null,"errorMessage":"invalid bundle processing state: %d","messagePattern":"invalid bundle processing state: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/metricsx/urns.go","lineNumber":185,"sourceCode":"\tif err := coder.EncodeVarInt(max, &buf); err != nil {\n\t\treturn nil, err\n\t}\n\treturn buf.Bytes(), nil\n}\n\n// ExecutionMsecUrn returns the Urn for the bundle state\nfunc ExecutionMsecUrn(i int) Urn {\n\tswitch i {\n\tcase 0:\n\t\treturn UrnStartBundle\n\tcase 1:\n\t\treturn UrnProcessBundle\n\tcase 2:\n\t\treturn UrnFinishBundle\n\tcase 3:\n\t\treturn UrnTransformTotalTime\n\tdefault:\n\t\tpanic(fmt.Errorf(\"invalid bundle processing state: %d\", i))\n\t}\n}\n","sourceCodeStart":167,"sourceCodeEnd":188,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/metricsx/urns.go#L167-L188","documentation":"ExecutionMsecUrn converts an integer bundle-processing state (0..3) to its MonitoringInfo URN. Any other value is outside the defined enum and panics with this error. It signals an unexpected processing state value from monitoring data.","triggerScenarios":"Calling ExecutionMsecUrn with an int outside {0,1,2,3} — e.g. decoded monitoring payloads with unknown/corrupt state values or new enum values from a newer runner not supported by this SDK version.","commonSituations":"Version skew between runner and Go SDK introducing new MsecUrn states, or corrupted/misdecoded monitoring-info payloads.","solutions":["Verify the state int passed comes from a valid MonitoringInfo MsecUrn enumeration (0-3).","Upgrade the Go SDK if the runner emits newer state values.","Check payload decoding — a decode bug can shift enum values by one.","Recover from the panic at the metrics-ingestion boundary and skip the malformed sample."],"exampleFix":"// before\nurn := metricsx.ExecutionMsecUrn(state) // state from unvalidated data\n// after\nif state < 0 || state > 3 { return nil, fmt.Errorf(\"unknown state %d\", state) }\nurn := metricsx.ExecutionMsecUrn(state)","handlingStrategy":"type-guard","validationCode":"if state < 0 || state > 3 {\n\treturn fmt.Errorf(\"unsupported bundle processing state %d\", state)\n}","typeGuard":"func validMsecState(i int) bool { return i >= 0 && i <= 3 }","tryCatchPattern":"func safeUrn(i int) (urn string) {\n\tdefer func() { if r := recover(); r != nil { urn = \"\" } }()\n\treturn metricsx.ExecutionMsecUrn(i)\n}","preventionTips":["Range-check state ints before calling ExecutionMsecUrn.","Upgrade SDK when runners introduce new MsecUrn states.","Verify monitoring payload decoding is byte-aligned."],"tags":["metrics","enum","panic","beam","go"],"backgroundTag":"invalid-enum-value","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}