{"record":{"id":"11827f57566f4dbb","repo":"apache/beam","slug":"could-not-find-input-with-name-s-for-s-transform","errorCode":null,"errorMessage":"Could not find input with name %s for %s transform","messagePattern":"Could not find input with name (.+?) for (.+?) transform","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/util/construction/WriteFilesTranslation.java","lineNumber":257,"sourceCode":"    @Override\n    public FunctionSpec migrate(SdkComponents components) throws IOException {\n      return FunctionSpec.newBuilder()\n          .setUrn(PTransformTranslation.WRITE_FILES_TRANSFORM_URN)\n          .setPayload(payloadForWriteFilesLike(this, components).toByteString())\n          .build();\n    }\n\n    @Override\n    public Map<TupleTag<?>, PValue> getAdditionalInputs() {\n      Map<TupleTag<?>, PValue> additionalInputs = new HashMap<>();\n      for (Map.Entry<String, SideInput> sideInputEntry : payload.getSideInputsMap().entrySet()) {\n        try {\n          additionalInputs.put(\n              new TupleTag<>(sideInputEntry.getKey()),\n              rehydratedComponents.getPCollection(\n                  protoTransform.getInputsOrThrow(sideInputEntry.getKey())));\n        } catch (IOException exc) {\n          throw new IllegalStateException(\n              String.format(\n                  \"Could not find input with name %s for %s transform\",\n                  sideInputEntry.getKey(), WriteFiles.class.getSimpleName()));\n        }\n      }\n      return additionalInputs;\n    }\n\n    @Override\n    public FunctionSpec translateSink(SdkComponents newComponents) {\n      // TODO: re-register the environment with the new components\n      return payload.getSink();\n    }\n\n    @Override\n    public Map<String, SideInput> translateSideInputs(SdkComponents components) {\n      // TODO: re-register the PCollections and UDF environments\n      return MoreObjects.firstNonNull(","sourceCodeStart":239,"sourceCodeEnd":275,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/util/construction/WriteFilesTranslation.java#L239-L275","documentation":"Thrown as an IllegalStateException by WriteFilesTranslation.getAdditionalInputs when a side input named in the WriteFiles transform's sideInputs map is not present among the transform's declared inputs (getInputsOrThrow threw IOException/NoSuchElementException). The translation expected every side-input key to have a corresponding PCollection input id resolvable via the rehydrated components.","triggerScenarios":"Translating a RunnerApi.PTransform for WriteFiles whose side_inputs reference input keys absent from protoTransform.getInputsMap(), or whose input PCollection id does not exist in components (rehydratedComponents.getPCollection fails).","commonSituations":"Hand-assembled pipeline protos in tests; graph rewriting passes that rename or drop inputs without updating side-input mappings; corrupted pipeline graphs from custom runners.","solutions":["Ensure every side-input key in the WriteFiles transform also appears in the transform's inputs map with a valid PCollection id.","Verify the referenced PCollection id exists in the Components' pcollections map.","If you are rewriting the graph, update side_inputs whenever you rename/remove inputs.","Validate the pipeline with PipelineValidator before translation to catch dangling references."],"exampleFix":"// before: side_inputs key \"side\" missing from inputs map\n// after: when building the PTransform\nPTransform.newBuilder().putInputs(\"side\", sidePcollId).putSideInputs(\"side\", sideInputProto)...","handlingStrategy":"validation","validationCode":"for (String sideKey : protoTransform.getSideInputsMap().keySet()) {\n  if (!protoTransform.containsInputs(sideKey)) throw new IllegalStateException(\"Side input \" + sideKey + \" missing from WriteFiles transform inputs\");\n  if (!components.containsPcollections(protoTransform.getInputsOrThrow(sideKey))) throw new IllegalStateException(\"PCollection not in components: \" + protoTransform.getInputsOrThrow(sideKey));\n}","typeGuard":"boolean sideInputsResolvable(RunnerApi.PTransform t, RunnerApi.Components c) { return t.getSideInputsMap().keySet().stream().allMatch(k -> t.containsInputs(k) && c.containsPcollections(t.getInputsOrThrow(k))); }","tryCatchPattern":"try { inputs = WriteFilesTranslation.getAdditionalInputs(transformNode, components); } catch (IllegalStateException e) { log.error(\"Dangling side-input reference on WriteFiles transform\", e); throw e; }","preventionTips":["Keep side_inputs and inputs maps in sync when rewriting graphs","Run PipelineValidator.validateComponents before translation","Never remove PCollections from Components without removing references"],"tags":["java","beam","writefiles","translation","missing-input"],"backgroundTag":"resource-not-found","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"}