{"record":{"id":"b31a2d07319c7fb2","repo":"apache/beam","slug":"internal-error-initializing-beamfndatareadrunner-invalid","errorCode":null,"errorMessage":"Internal error initializing BeamFnDataReadRunner: invalid monitoring info: %s","messagePattern":"Internal error initializing BeamFnDataReadRunner: invalid monitoring info: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/harness/src/main/java/org/apache/beam/fn/harness/BeamFnDataReadRunner.java","lineNumber":182,"sourceCode":"                  public BeamFnStateClient getStateClient() {\n                    return beamFnStateClient;\n                  }\n\n                  @Override\n                  public Supplier<String> getCurrentInstructionId() {\n                    return processBundleInstructionIdSupplier;\n                  }\n                });\n\n    SimpleMonitoringInfoBuilder monitoringInfoBuilder =\n        new SimpleMonitoringInfoBuilder()\n            .setUrn(Urns.DATA_CHANNEL_READ_INDEX)\n            .setType(MonitoringInfoConstants.TypeUrns.SUM_INT64_TYPE)\n            .setLabel(MonitoringInfoConstants.Labels.PTRANSFORM, pTransformId);\n\n    MetricsApi.MonitoringInfo monitoringInfo = monitoringInfoBuilder.build();\n    if (monitoringInfo == null) {\n      throw new IllegalArgumentException(\n          String.format(\n              \"Internal error initializing BeamFnDataReadRunner: invalid monitoring info: %s\",\n              monitoringInfoBuilder.validate()));\n    }\n\n    dataChannelReadIndexShortId = shortIdMap.getOrCreateShortId(monitoringInfo);\n    addBundleProgressReporter.accept(\n        new BundleProgressReporter() {\n          @Override\n          public void updateIntermediateMonitoringData(Map<String, ByteString> monitoringData) {\n            synchronized (splittingLock) {\n              monitoringData.put(\n                  dataChannelReadIndexShortId, MonitoringInfoEncodings.encodeInt64Counter(index));\n            }\n          }\n\n          @Override\n          public void updateFinalMonitoringData(Map<String, ByteString> monitoringData) {","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/harness/src/main/java/org/apache/beam/fn/harness/BeamFnDataReadRunner.java#L164-L200","documentation":"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.","triggerScenarios":"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.","commonSituations":"Mixing Beam SDK/harness versions where monitoring info constants changed; custom forks altering Urns or type definitions; genuine Beam bug.","solutions":["Upgrade/align org.apache.beam SDK and fn-harness artifacts to the same version.","Check the message's validate() output to identify which field of the MonitoringInfo is invalid.","File a Beam issue if it reproduces on a clean, version-aligned build.","Rebuild without local patches to MonitoringInfoConstants/Urn tables."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  new BeamFnDataReadRunner(...);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().contains(\"invalid monitoring info\")) {\n    log.error(\"Monitoring info validation failed: {}\", e.getMessage()); // check SDK version alignment\n  }\n  throw e;\n}","preventionTips":["Keep all org.apache.beam artifacts on one version","Avoid forking MonitoringInfoConstants/Urn tables","Report reproducible failures upstream as Beam bugs"],"tags":["apache-beam","java","fn-harness","metrics","internal-error"],"backgroundTag":"internal-invariant-violation","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}