apache/beam · error

Unknown PaneInfo encoding: " + encodingNibble

Error message

Unknown PaneInfo encoding: " + encodingNibble

What it means

ExpansionService (JavaJarExpansionService) __init__ raises ValueError when both extra_args and append_args are supplied. extra_args replaces the service's default arguments while append_args adds to them; giving both is contradictory and rejected. Pick a single mechanism for customizing service JVM arguments.

Source

Thrown at sdks/typescript/src/apache_beam/coders/required_coders.ts:637

      (PaneInfoCoder.encodeTiming(value.timing) << 2);

    const encodingNibble: PaneInfoEncoding =
      PaneInfoCoder.chooseEncoding(value);
    writeRawByte(low4 | (encodingNibble << 4), writer);

    switch (encodingNibble) {
      case PaneInfoEncoding.NO_INDEX:
        // the header byte contains all the info
        return;
      case PaneInfoEncoding.ONE_INDEX:
        writer.int32(value.index);
        return;
      case PaneInfoEncoding.TWO_INDICES:
        writer.int32(value.index);
        writer.int32(value.onTimeIndex);
        return;
      default:
        throw new Error("Unknown PaneInfo encoding: " + encodingNibble);
    }
  }

  toProto(pipelineContext: ProtoContext): runnerApi.Coder {
    throw new Error(
      "No proto encoding for PaneInfoCoder, always part of WindowedValue codec",
    );
  }
}

requireForSerialization(`${packageName}/coders/required_coders`, exports);

View on GitHub (pinned to 12126d8942)

Solutions

  1. Keep only extra_args if you want to fully control the service arguments.
  2. Keep only append_args if you want to add to the default arguments.
  3. Merge the desired flags into a single list passed as one of the two parameters.

Example fix

// before
JavaJarExpansionService(jar, extra_args=['--a'], append_args=['--b'])
// after
JavaJarExpansionService(jar, append_args=['--b'])
Defensive patterns

Strategy: validation

Validate before calling

assert not (extra_args and append_args), 'use only one of extra_args/append_args'

Type guard

def service_args_ok(extra_args, append_args) -> bool:
    return not (extra_args and append_args)

Try / catch

try:
    svc = JavaJarExpansionService(jar, extra_args=ea, append_args=aa)
except ValueError as e:
    logger.error('Conflicting JVM args: %s', e)

Prevention

When it happens

Trigger: JavaJarExpansionService(path_to_jar, extra_args=['--x'], append_args=['--y']) — both non-None and non-empty in one constructor call.

Common situations: Merging config from two code paths; migrating code from extra_args to append_args while leaving the old argument in place.

Understand the failure class

Background: "mutually exclusive" flag errors: what "can't supply both nx and xx", "--raw is not compatible with -i" and "cannot be used with" mean, and how to fix them — this error's family across 29 libraries.

Related errors


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