{"record":{"id":"d60f3234c7fb3dba","repo":"apache/beam","slug":"unknown-request-type-msg-request-oneofkind","errorCode":null,"errorMessage":"Unknown request type \" + msg.request.oneofKind","messagePattern":"Unknown request type \" \\+ msg\\.request\\.oneofKind","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/typescript/src/apache_beam/runners/artifacts.ts","lineNumber":182,"sourceCode":"              stagingToken: stagingToken,\n              isLast: true,\n              response: {\n                oneofKind: \"getArtifactResponse\",\n                getArtifactResponse: { data: new Uint8Array() },\n              },\n            });\n            break;\n\n          default:\n            throw new Error(\n              \"Unknown artifact type \" +\n                msg.request.getArtifact.artifact!.typeUrn,\n            );\n        }\n        break;\n\n      default:\n        throw new Error(\"Unknown request type \" + msg.request.oneofKind);\n    }\n  });\n\n  call.requests.send({\n    stagingToken: stagingToken,\n    isLast: false,\n    response: {\n      oneofKind: undefined,\n    },\n  });\n  await call;\n}\n\nfunction tempFile(dir) {\n  return path.join(\n    dir,\n    \"temp\" +\n      crypto","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/typescript/src/apache_beam/runners/artifacts.ts#L164-L200","documentation":"offerArtifacts iterates over messages from the artifact staging RPC and switches on msg.request.oneofKind (the protobuf oneof discriminator of ArtifactRequest). Any request kind the handler does not implement (undefined or a future oneof member) hits the default case and throws.","triggerScenarios":"The job service sends an ArtifactRequest variant this handler doesn't recognize — typically a newer protobuf schema field, or a malformed message with oneofKind === undefined.","commonSituations":"Protobuf version mismatch between the generated runner code and the job service; a job service extension issuing new request kinds; corrupted/incomplete messages on the staging channel.","solutions":["Regenerate/upgrade the protobuf types (@beam-internal/protos equivalent) so oneofKind includes the new variant, and handle it.","Ensure the job service and SDK use compatible Beam versions.","Inspect msg.request.oneofKind in logs to identify which request kind is unhandled, then add a case for it."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await offerArtifacts(stagingClient, token, artifacts);\n} catch (e) {\n  if ((e as Error).message.startsWith('Unknown request type')) {\n    // check oneofKind in logs; upgrade protos/SDK to match the job service\n  } else throw e;\n}","preventionTips":["Regenerate protobuf bindings whenever the Beam protos are upgraded.","Keep job service and SDK versions aligned.","Test artifact staging against your job service version before production runs."],"tags":["artifacts","protobuf","version-skew","runner"],"backgroundTag":"unexpected-response-shape","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"}