apache/beam · error · Error

Unexpected tag ' ' for not in

Error message

Unexpected tag '${tag}' for ${wvalue.value} not in ${this.options.knownTags}

What it means

SplittingDoFnOperator encountered an output tag on an element that is not in options.knownTags, and unknownTagBehavior is neither 'rename' nor 'ignore'. The tag and the element's own keys are the faulty inputs: the DoFn emitted to an output the operator was not configured to recognize.

Solutions

  1. Add the tag shown in the message to the operator's knownTags list.
  2. Set unknownTagBehavior to 'rename' (routes to unknownTagName) or 'ignore' so stray tags don't crash the bundle.
  3. Fix the splitting DoFn to emit only to declared output tags.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at sdks/typescript/src/apache_beam/worker/operators.ts:837 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at sdks/typescript/src/apache_beam/worker/operators.ts:837

  async startBundle() {}

  process(wvalue: WindowedValue<unknown>) {
    const result = new ProcessResultBuilder();
    const keys = Object.keys(wvalue.value as object);
    if (this.options.exclusive && keys.length !== 1) {
      throw new Error(
        "Multiple keys for exclusively split element: " + wvalue.value,
      );
    }
    for (let tag of keys) {
      if (!this.options.knownTags!.includes(tag)) {
        if (this.options.unknownTagBehavior === "rename") {
          tag = this.options.unknownTagName!;
        } else if (this.options.unknownTagBehavior === "ignore") {
          continue;
        } else {
          throw new Error(
            "Unexpected tag '" +
              tag +
              "' for " +
              wvalue.value +
              " not in " +
              this.options.knownTags,
          );
        }
      }
      const receiver = this.receivers[tag];
      if (receiver) {
        result.add(
          receiver.receive({
            value: (wvalue.value as object)[tag],
            windows: wvalue.windows,
            timestamp: wvalue.timestamp,
            pane: wvalue.pane,
          }),

View on GitHub (pinned to 12126d8942)