{"record":{"id":"238b0938266a2fcc","repo":"pentaho/pentaho-kettle","slug":"mappingdialog-exception-onlyonemappinginputstepallowed","errorCode":"MappingDialog.Exception.OnlyOneMappingInputStepAllowed","errorMessage":"Without specifying specific stepnames to read from, there can only be one 'mapping input' step in the mapping and we found {0}.","messagePattern":"Without specifying specific stepnames to read from, there can only be one 'mapping input' step in the mapping and we found (.+?)\\.","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/mapping/Mapping.java","lineNumber":377,"sourceCode":"        sourceSteps = new StepInterface[prevSteps.size()];\n        for ( int s = 0; s < sourceSteps.length; s++ ) {\n          sourceSteps[s] = getTrans().findRunThread( prevSteps.get( s ).getName() );\n        }\n      }\n\n      // What step are we writing to?\n      MappingInput mappingInputTarget = null;\n      MappingInput[] mappingInputSteps = mappingData.getMappingTrans().findMappingInput();\n      if ( Utils.isEmpty( inputDefinition.getOutputStepname() ) ) {\n        // No target was specifically specified.\n        // That means we only expect one \"mapping input\" step in the mapping...\n\n        if ( mappingInputSteps.length == 0 ) {\n          throw new KettleException( BaseMessages\n              .getString( PKG, \"MappingDialog.Exception.OneMappingInputStepRequired\" ) );\n        }\n        if ( mappingInputSteps.length > 1 ) {\n          throw new KettleException( BaseMessages.getString( PKG,\n              \"MappingDialog.Exception.OnlyOneMappingInputStepAllowed\", \"\" + mappingInputSteps.length ) );\n        }\n\n        mappingInputTarget = mappingInputSteps[0];\n      } else {\n        // A target step was specified. See if we can find it...\n        for ( int s = 0; s < mappingInputSteps.length && mappingInputTarget == null; s++ ) {\n          if ( mappingInputSteps[s].getStepname().equals( inputDefinition.getOutputStepname() ) ) {\n            mappingInputTarget = mappingInputSteps[s];\n          }\n        }\n        // If we still didn't find it it's a drag.\n        if ( mappingInputTarget == null ) {\n          throw new KettleException( BaseMessages.getString( PKG, \"MappingDialog.Exception.StepNameNotFound\",\n              inputDefinition.getOutputStepname() ) );\n        }\n      }\n","sourceCodeStart":359,"sourceCodeEnd":395,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/mapping/Mapping.java#L359-L395","documentation":"When no target step name is specified for a mapping input, the sub-transformation must contain exactly one 'Mapping Input' step. If findMappingInput() finds more than one, the step cannot decide which to wire up, so it throws this error reporting the number found (message contains typo 'specifif' in this codebase).","triggerScenarios":"prepareMappingExecution() with inputDefinition.getOutputStepname() empty and mappingInputSteps.length > 1 — i.e. sub-transformation has two or more Mapping Input steps while the Mapping dialog has no target step chosen.","commonSituations":"Copying an existing Mapping Input step inside the sub-transformation; merging transformations that each had their own Mapping Input; ambiguous legacy mappings after refactor.","solutions":["Remove the extra 'Mapping Input' steps so the sub-transformation has exactly one.","Or explicitly select which Mapping Input step to use in the Mapping step dialog (Input tab, target step column).","Rename and restructure the sub-transformation to route all inputs through a single Mapping Input step.","Audit the .ktr for duplicate MappingInput step types if the UI count disagrees with expectations."],"exampleFix":"null","handlingStrategy":"validation","validationCode":"if (Utils.isEmpty(inputDefinition.getOutputStepname())) {\n  long n = mappingTransMeta.getSteps().stream()\n      .filter(s -> s.getStepMetaInterface() instanceof MappingInput).count();\n  if (n != 1) throw new IllegalStateException(\"Expected 1 Mapping Input step, found \" + n);\n}","typeGuard":null,"tryCatchPattern":"try {\n  mapping.init();\n} catch (KettleException e) {\n  if (String.valueOf(e.getMessage()).contains(\"only be one 'mapping input'\")) {\n    logError(\"Multiple Mapping Input steps found — remove extras or pick a target explicitly\", e);\n  } else { throw e; }\n}","preventionTips":["Never duplicate the 'Mapping Input' step when copying flows.","If multiple inputs are needed, wire them through one Mapping Input or specify targets explicitly.","Review sub-transformations after merges/refactors for duplicate input steps.","Count MappingInput occurrences in the ktr XML during CI checks."],"tags":["pdi","kettle","mapping-step","mapping-input","ambiguity"],"backgroundTag":"conflicting-config-options","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}