{"record":{"id":"86b84cda2cca51f2","repo":"apache/beam","slug":"s-with-no-s-or-s","errorCode":null,"errorMessage":"%s with no %s or %s","messagePattern":"(.+?) with no (.+?) or (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/util/construction/graph/OutputDeduplicator.java","lineNumber":121,"sourceCode":"      } else if (deduplicationTargets.getKey().getTransform() != null) {\n        PTransformDeduplication deduplication =\n            deduplicatePCollections(\n                deduplicationTargets.getKey().getTransform(),\n                deduplicationTargets.getValue(),\n                unzippedComponents::containsPcollections);\n        for (Entry<String, PipelineNode.PCollectionNode> originalToPartialReplacement :\n            deduplication.getOriginalToPartialPCollections().entrySet()) {\n          originalToPartial.put(\n              originalToPartialReplacement.getKey(), originalToPartialReplacement.getValue());\n          unzippedComponents.putPcollections(\n              originalToPartialReplacement.getValue().getId(),\n              originalToPartialReplacement.getValue().getPCollection());\n        }\n        updatedTransforms.put(\n            deduplicationTargets.getKey().getTransform().getId(),\n            deduplication.getUpdatedTransform());\n      } else {\n        throw new IllegalStateException(\n            String.format(\n                \"%s with no %s or %s\",\n                StageOrTransform.class.getSimpleName(),\n                ExecutableStage.class.getSimpleName(),\n                PipelineNode.PTransformNode.class.getSimpleName()));\n      }\n    }\n\n    Set<PipelineNode.PTransformNode> introducedFlattens = new LinkedHashSet<>();\n    for (Map.Entry<String, Collection<PipelineNode.PCollectionNode>> partialFlattenTargets :\n        originalToPartial.asMap().entrySet()) {\n      String flattenId =\n          SyntheticComponents.uniqueId(\"unzipped_flatten\", unzippedComponents::containsTransforms);\n      PTransform flattenPartialPCollections =\n          createFlattenOfPartials(\n              flattenId, partialFlattenTargets.getKey(), partialFlattenTargets.getValue());\n      unzippedComponents.putTransforms(flattenId, flattenPartialPCollections);\n      introducedFlattens.add(PipelineNode.pTransform(flattenId, flattenPartialPCollections));","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/util/construction/graph/OutputDeduplicator.java#L103-L139","documentation":"Thrown by OutputDeduplicator.ensureSingleProducer when a StageOrTransform entry in the deduplication targets is neither an ExecutableStage nor a PTransformNode. The deduplicator only knows how to process those two payload types; anything else indicates an internal invariant violation in how the dedup targets were collected.","triggerScenarios":"Running output deduplication (ensureSingleProducer) on a deduplicationTargets map whose StageOrTransform wraps a node type other than ExecutableStage or PTransformNode — a bug in graph construction or an unhandled node kind.","commonSituations":"Custom runner integrations building ExecutableStages by hand; new pipeline node types added without updating OutputDeduplicator; corrupted fusion results passed into deduplication.","solutions":["Ensure the ExecutableStage/PTransform graph fed to OutputDeduplicator was produced by the standard fusion pipeline (GreedyStageFuser).","If a new node type exists, add a branch in ensureSingleProducer to handle it.","Audit any custom graph-rewriting code that constructs StageOrTransform values.","Capture the offending entry (getKey()) in a debugger to see the unexpected node type."],"exampleFix":"// before: passing ad-hoc StageOrTransform.of(unknownNode)\n// after: only feed fused output\nDeduplicatedFlattenToPCollections out =\n    OutputDeduplicator.ensureSingleProducer(executable, fusedStages, dedupTargets);","handlingStrategy":"validation","validationCode":"for (Map.Entry<StageOrTransform, ?> e : deduplicationTargets.entrySet()) {\n  if (!(e.getKey().getStage() instanceof ExecutableStage) && !(e.getKey().getTransform() instanceof PipelineNode.PTransformNode)) throw new IllegalStateException(\"Unexpected StageOrTransform payload\");\n}","typeGuard":"boolean isKnownStageOrTransform(StageOrTransform s) { return s.getStage() instanceof ExecutableStage || s.getTransform() instanceof PipelineNode.PTransformNode; }","tryCatchPattern":"try { result = OutputDeduplicator.ensureSingleProducer(executable, fusedStages, targets); } catch (IllegalStateException e) { log.error(\"Dedup target is neither ExecutableStage nor PTransformNode\", e); throw e; }","preventionTips":["Feed OutputDeduplicator only with stages produced by the standard fusion pipeline","Update OutputDeduplicator when new pipeline node kinds are introduced","Unit-test custom graph rewrites against ensureSingleProducer"],"tags":["java","beam","fusion","deduplication","invariant"],"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"}