{"record":{"id":"8d70698fcd8bbfce","repo":"apache/beam","slug":"unknown-urn-s","errorCode":null,"errorMessage":"Unknown URN %s","messagePattern":"Unknown URN (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/harness/src/main/java/org/apache/beam/fn/harness/data/PTransformFunctionRegistry.java","lineNumber":81,"sourceCode":"\n  /**\n   * Construct the registry to run for either start or finish bundle functions.\n   *\n   * @param shortIds - Provides short ids for {@link MonitoringInfo}.\n   * @param stateTracker - The tracker to enter states in order to calculate execution time metrics.\n   * @param executionStateUrn - The URN for the execution state .\n   */\n  public PTransformFunctionRegistry(\n      ShortIdMap shortIds, ExecutionStateTracker stateTracker, String executionStateUrn) {\n    switch (executionStateUrn) {\n      case Urns.START_BUNDLE_MSECS:\n        stateName = org.apache.beam.runners.core.metrics.ExecutionStateTracker.START_STATE_NAME;\n        break;\n      case Urns.FINISH_BUNDLE_MSECS:\n        stateName = org.apache.beam.runners.core.metrics.ExecutionStateTracker.FINISH_STATE_NAME;\n        break;\n      default:\n        throw new IllegalArgumentException(String.format(\"Unknown URN %s\", executionStateUrn));\n    }\n    this.shortIds = shortIds;\n    this.executionStateUrn = executionStateUrn;\n    this.stateTracker = stateTracker;\n  }\n\n  /**\n   * Register the runnable to process the specific pTransformId and track its execution time.\n   *\n   * @param pTransformId\n   * @param pTransformUniqueName\n   * @param runnable\n   */\n  public void register(\n      String pTransformId, String pTransformUniqueName, ThrowingRunnable runnable) {\n    SimpleMonitoringInfoBuilder miBuilder = new SimpleMonitoringInfoBuilder();\n    miBuilder.setUrn(executionStateUrn);\n    miBuilder.setType(MonitoringInfoConstants.TypeUrns.SUM_INT64_TYPE);","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/harness/src/main/java/org/apache/beam/fn/harness/data/PTransformFunctionRegistry.java#L63-L99","documentation":"PTransformFunctionRegistry translates an execution-state URN (e.g. process-start/finish msecs monitoring URNs) into an ExecutionStateTracker state name in its constructor. If the URN is not one of the known execution-state URNs, the constructor throws IllegalArgumentException('Unknown URN %s'), since a metrics counter cannot be built for an unrecognized state.","triggerScenarios":"Constructing PTransformFunctionRegistry with an executionStateUrn that is not PROCESS_BUNDLE_MSECS or FINISH_BUNDLE_MSECS (per the switch) — e.g. registering a user counter URN or a mistyped/renamed URN through this registry.","commonSituations":"Custom runners or tests registering execution-state metrics with an incorrect URN constant; SDK changes renaming/moving Urns constants so custom code passes an outdated value.","solutions":["Pass only Urns constants intended for execution state (e.g. Urns.PROCESS_BUNDLE_MSECS, Urns.FINISH_BUNDLE_MSECS) to this registry.","Use the correct registry (PTransformMetrics/counter registration path) for non-execution-state monitoring info URNs.","Check the Urns class in your Beam version for the exact constant names; update custom code after upgrades."],"exampleFix":"// before\nnew PTransformFunctionRegistry(..., \"process_user_counter\", ...);\n// after\nnew PTransformFunctionRegistry(..., org.apache.beam.model.jobmanagement.v1.MonitoringInfoUrns.Urns.PROCESS_BUNDLE_MSECS, ...);","handlingStrategy":"validation","validationCode":"if (!Urns.PROCESS_BUNDLE_MSECS.equals(urn) && !Urns.FINISH_BUNDLE_MSECS.equals(urn)) { throw new IllegalArgumentException(\"Unsupported execution-state URN: \" + urn); }","typeGuard":null,"tryCatchPattern":"try { new PTransformFunctionRegistry(..., urn, ...); } catch (IllegalArgumentException e) { LOG.error(\"Bad execution-state URN: {}\", urn, e); throw e; }","preventionTips":["Only pass official Urns constants for execution state","Use the counter/metrics registration path for other URNs","Re-check URN constants after SDK upgrades"],"tags":["apache-beam","java-harness","metrics","urn"],"backgroundTag":"invalid-enum-value","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"}