{"record":{"id":"ab9b4609fbfc31ca","repo":"apache/beam","slug":"resp-error","errorCode":null,"errorMessage":"resp.Error","messagePattern":"resp\\.Error","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/harness/statemgr.go","lineNumber":802,"sourceCode":"\tif c.closedErr != nil {\n\t\tdefer c.mu.Unlock()\n\t\treturn nil, errors.Wrapf(c.closedErr, \"StateChannel[%v].Send(%v): channel closed due to: %v\", c.id, id, c.closedErr)\n\t}\n\tc.responses[id] = ch\n\tc.mu.Unlock()\n\n\tc.requests <- req\n\n\tvar resp *fnpb.StateResponse\n\tselect {\n\tcase resp = <-ch:\n\tcase <-c.DoneCh:\n\t\tc.mu.Lock()\n\t\tdefer c.mu.Unlock()\n\t\treturn nil, errors.Wrapf(c.closedErr, \"StateChannel[%v].Send(%v): context canceled\", c.id, id)\n\t}\n\tif resp.Error != \"\" {\n\t\treturn nil, errors.New(resp.Error)\n\t}\n\treturn resp, nil\n}\n","sourceCodeStart":784,"sourceCodeEnd":806,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/harness/statemgr.go#L784-L806","documentation":"The Beam Go harness state manager returns this error when a state response from the runner contains a non-empty Error field, meaning the runner rejected the state request (Get/Set/Append/Clear on a state channel). The raw runner-side error message is surfaced verbatim via errors.New(resp.Error).","triggerScenarios":"Calling state APIs (cache Get/Set/Append/Clear via c.Send) over a StateChannel where the runner side responds with an ErrorResponse instead of a payload.","commonSituations":"Runner-side state backend failures during side-input/materialized-bundle processing on Flink/Spark/Dataflow runners; multiharness cross-language jobs where state backing store is unavailable or the bag/iterable was evicted.","solutions":["Read the embedded resp.Error message for the runner-side root cause and fix that on the runner/backend side","Retry the pipeline; transient runner/backend state failures often resolve on re-run","Check runner-specific state backend configuration (e.g. Flink state backend, Dataflow worker state) for capacity/connectivity issues","Upgrade Beam to a version with your runner's latest state-service fixes"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// check state channel health before sending\nif c == nil || c.closedErr != nil { return fmt.Errorf(\"state channel closed\") }\nselect {\ncase <-c.DoneCh:\n    return fmt.Errorf(\"state channel already canceled\")\ndefault:\n}","typeGuard":null,"tryCatchPattern":"resp, err := sm.Get(ctx, req)\nif err != nil {\n    if strings.Contains(err.Error(), \"StateChannel\") { /* channel-level failure: retry or recreate */ }\n    return fmt.Errorf(\"state request failed: %w\", err)\n}","preventionTips":["Check DoneCh/closedErr before issuing state requests","Add retries with backoff around state operations for transient runner failures","Monitor runner-side state backend health in cross-language jobs","Pin matching SDK/runner versions to reduce state protocol mismatches"],"tags":["go","apache-beam","state-management","runner"],"backgroundTag":"api-error-response","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"}