{"record":{"id":"4a1730ff24a3c3fe","repo":"apache/beam","slug":"pipeline-update-will-not-be-possible-because-the-following","errorCode":null,"errorMessage":"Pipeline update will not be possible because the following transforms do not have stable unique names: %s.\n\nConflicting instances:\n%s\n\nYou can fix it adding a name when you call apply(): pipeline.apply(<name>, <transform>).","messagePattern":"Pipeline update will not be possible because the following transforms do not have stable unique names: (.+?)\\.\n\nConflicting instances:\n(.+?)\n\nYou can fix it adding a name when you call apply\\(\\): pipeline\\.apply\\(<name>, <transform>\\)\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/Pipeline.java","lineNumber":623,"sourceCode":"    }\n  }\n\n  @VisibleForTesting\n  void validate(PipelineOptions options) {\n    this.traverseTopologically(new ValidateVisitor(options));\n    final Collection<Map.Entry<String, Collection<PTransform<?, ?>>>> errors =\n        Collections2.filter(instancePerName.asMap().entrySet(), Predicates.not(new IsUnique<>()));\n    if (!errors.isEmpty()) {\n      switch (options.getStableUniqueNames()) {\n        case OFF:\n          break;\n        case WARNING:\n          LOG.warn(\n              \"The following transforms do not have stable unique names: {}\",\n              Joiner.on(\", \").join(transform(errors, new KeysExtractor())));\n          break;\n        case ERROR: // be very verbose here since it will just fail the execution\n          throw new IllegalStateException(\n              String.format(\n                      \"Pipeline update will not be possible because the following transforms do\"\n                          + \" not have stable unique names: %s.\",\n                      Joiner.on(\", \").join(transform(errors, new KeysExtractor())))\n                  + \"\\n\\n\"\n                  + \"Conflicting instances:\\n\"\n                  + Joiner.on(\"\\n\")\n                      .join(transform(errors, new UnstableNameToMessage(instancePerName)))\n                  + \"\\n\\nYou can fix it adding a name when you call apply(): \"\n                  + \"pipeline.apply(<name>, <transform>).\");\n        default:\n          throw new IllegalArgumentException(\n              \"Unrecognized value for stable unique names: \" + options.getStableUniqueNames());\n      }\n    }\n  }\n\n  /**","sourceCodeStart":605,"sourceCodeEnd":641,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/Pipeline.java#L605-L641","documentation":"Pipeline.validate() checks that all transforms have stable unique names (controlled by options.getStableUniqueNames(), default CHECK_WARNING). In ERROR mode, when multiple transforms share the same generated name, it throws this verbose IllegalStateException listing conflicts, because pipeline update (job replacement) requires deterministic transform names.","triggerScenarios":"Running with --stableUniqueNames=ERROR while two or more transforms produce identical names — typically repeated identical PTransforms applied in a loop without explicit names, so Beam appends nondeterministic suffixes or collides.","commonSituations":"Teams enabling stable unique names to use pipeline update / stateful reruns; generated pipelines built programmatically where transforms are applied inside loops; anonymous lambdas combined into same-named transforms.","solutions":["Give each transform an explicit name: pipeline.apply(\"UniqueName\", transform) or setLabel().","Generate deterministic names programmatically (e.g. include loop index) when transforms are created in loops.","Relax to --stableUniqueNames=CHECK_WARNING or WARNING if you don't need pipeline update (less safe).","Review the 'Conflicting instances' list in the message to find exactly which transforms collide and rename them."],"exampleFix":"// before\n// pipeline.apply(MapElements.via(...)); // in a loop -> duplicate name 'MapElements'\n// after\n// pipeline.apply(\"MapStep-\" + i, MapElements.via(...));","handlingStrategy":"validation","validationCode":"// Java: pre-validate transform names before run\nMap<String, Integer> counts = new HashMap<>();\npipeline.traverseTopologically(new PipelineVisitor.Defaults() {\n  @Override public void visitPrimitiveTransform(Node n) { counts.merge(n.getName(), 1, Integer::sum); }\n});\nList<String> dupes = counts.entrySet().stream().filter(e -> e.getValue() > 1).map(Map.Entry::getKey).collect(toList());\nif (!dupes.isEmpty()) throw new IllegalArgumentException(\"Duplicate transform names: \" + dupes);","typeGuard":null,"tryCatchPattern":"try {\n  pipeline.run();\n} catch (IllegalStateException e) {\n  if (e.getMessage().contains(\"stable unique names\")) {\n    throw new IllegalArgumentException(\"Add explicit apply(name, transform) labels: \" + e.getMessage());\n  }\n  throw e;\n}","preventionTips":["Always name transforms created in loops or generated code","Enable stableUniqueNames=ERROR in CI to catch collisions early","Review the conflicting-instances list and add unique labels before enabling pipeline update"],"tags":["java","beam","pipeline","naming","validation"],"backgroundTag":"unstable-transform-names","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"}