apache/beam · error · IllegalArgumentException

Internal error initializing BeamFnDataReadRunner: invalid mo

Error message

Internal error initializing BeamFnDataReadRunner: invalid monitoring info: %s

What it means

During construction, BeamFnDataReadRunner builds a MonitoringInfo for the DATA_CHANNEL_READ_INDEX metric and validates it. If validation reports the monitoring info invalid, the constructor throws an IllegalArgumentException labeled as an internal error, since this object is assembled entirely from constants and should always validate.

Source

Thrown at sdks/java/harness/src/main/java/org/apache/beam/fn/harness/BeamFnDataReadRunner.java:182

                  public BeamFnStateClient getStateClient() {
                    return beamFnStateClient;
                  }

                  @Override
                  public Supplier<String> getCurrentInstructionId() {
                    return processBundleInstructionIdSupplier;
                  }
                });

    SimpleMonitoringInfoBuilder monitoringInfoBuilder =
        new SimpleMonitoringInfoBuilder()
            .setUrn(Urns.DATA_CHANNEL_READ_INDEX)
            .setType(MonitoringInfoConstants.TypeUrns.SUM_INT64_TYPE)
            .setLabel(MonitoringInfoConstants.Labels.PTRANSFORM, pTransformId);

    MetricsApi.MonitoringInfo monitoringInfo = monitoringInfoBuilder.build();
    if (monitoringInfo == null) {
      throw new IllegalArgumentException(
          String.format(
              "Internal error initializing BeamFnDataReadRunner: invalid monitoring info: %s",
              monitoringInfoBuilder.validate()));
    }

    dataChannelReadIndexShortId = shortIdMap.getOrCreateShortId(monitoringInfo);
    addBundleProgressReporter.accept(
        new BundleProgressReporter() {
          @Override
          public void updateIntermediateMonitoringData(Map<String, ByteString> monitoringData) {
            synchronized (splittingLock) {
              monitoringData.put(
                  dataChannelReadIndexShortId, MonitoringInfoEncodings.encodeInt64Counter(index));
            }
          }

          @Override
          public void updateFinalMonitoringData(Map<String, ByteString> monitoringData) {

View on GitHub (pinned to 12126d8942)

Solutions

  1. Upgrade/align org.apache.beam SDK and fn-harness artifacts to the same version.
  2. Check the message's validate() output to identify which field of the MonitoringInfo is invalid.
  3. File a Beam issue if it reproduces on a clean, version-aligned build.
  4. Rebuild without local patches to MonitoringInfoConstants/Urn tables.
Defensive patterns

Strategy: try-catch

Try / catch

try {
  new BeamFnDataReadRunner(...);
} catch (IllegalArgumentException e) {
  if (e.getMessage().contains("invalid monitoring info")) {
    log.error("Monitoring info validation failed: {}", e.getMessage()); // check SDK version alignment
  }
  throw e;
}

Prevention

When it happens

Trigger: Constructing BeamFnDataReadRunner for a Fn Harness data channel where the built MonitoringInfo fails validate() — effectively only from inconsistent MonitoringInfoConstants URN/type/label tables or a corrupted build.

Common situations: Mixing Beam SDK/harness versions where monitoring info constants changed; custom forks altering Urns or type definitions; genuine Beam bug.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


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