apache/beam · error

Unknown request type " + msg.request.oneofKind

Error message

Unknown request type " + msg.request.oneofKind

What it means

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.

Solutions

  1. Regenerate/upgrade the protobuf types (@beam-internal/protos equivalent) so oneofKind includes the new variant, and handle it.
  2. Ensure the job service and SDK use compatible Beam versions.
  3. Inspect msg.request.oneofKind in logs to identify which request kind is unhandled, then add a case for it.
Defensive patterns

Strategy: try-catch

Try / catch

try {
  await offerArtifacts(stagingClient, token, artifacts);
} catch (e) {
  if ((e as Error).message.startsWith('Unknown request type')) {
    // check oneofKind in logs; upgrade protos/SDK to match the job service
  } else throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/d60f3234c7fb3dba. Report an issue: GitHub.

Appendix: source

Thrown at sdks/typescript/src/apache_beam/runners/artifacts.ts:182

              stagingToken: stagingToken,
              isLast: true,
              response: {
                oneofKind: "getArtifactResponse",
                getArtifactResponse: { data: new Uint8Array() },
              },
            });
            break;

          default:
            throw new Error(
              "Unknown artifact type " +
                msg.request.getArtifact.artifact!.typeUrn,
            );
        }
        break;

      default:
        throw new Error("Unknown request type " + msg.request.oneofKind);
    }
  });

  call.requests.send({
    stagingToken: stagingToken,
    isLast: false,
    response: {
      oneofKind: undefined,
    },
  });
  await call;
}

function tempFile(dir) {
  return path.join(
    dir,
    "temp" +
      crypto

View on GitHub (pinned to 12126d8942)