{"record":{"id":"a99c1d6d2a386bdb","repo":"pentaho/pentaho-kettle","slug":"mappingdialog-exception-onlyonemappingoutputstepallowed","errorCode":"MappingDialog.Exception.OnlyOneMappingOutputStepAllowed","errorMessage":"Without specifying specifif stepnames to write to, there can only be one 'mapping output' step in the mapping and we found {0}.","messagePattern":"Without specifying specifif stepnames to write to, there can only be one 'mapping output' 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":434,"sourceCode":"      // OK, what is the source (input) step in the mapping: it's the mapping\n      // output step...\n      // What step are we reading from here?\n      //\n      MappingOutput mappingOutputSource =\n          (MappingOutput) mappingData.getMappingTrans().findRunThread( outputDefinition.getInputStepname() );\n      if ( mappingOutputSource == null ) {\n        // No source step was specified: we're reading from a single Mapping\n        // Output step.\n        // We should verify this if this is really the case...\n        //\n        MappingOutput[] mappingOutputSteps = mappingData.getMappingTrans().findMappingOutput();\n\n        if ( mappingOutputSteps.length == 0 ) {\n          throw new KettleException( BaseMessages.getString( PKG,\n              \"MappingDialog.Exception.OneMappingOutputStepRequired\" ) );\n        }\n        if ( mappingOutputSteps.length > 1 ) {\n          throw new KettleException( BaseMessages.getString( PKG,\n              \"MappingDialog.Exception.OnlyOneMappingOutputStepAllowed\", \"\" + mappingOutputSteps.length ) );\n        }\n\n        mappingOutputSource = mappingOutputSteps[0];\n      }\n\n      // To what steps in this transformation are we writing to?\n      //\n      StepInterface[] targetSteps = pickupTargetStepsFor( outputDefinition );\n\n      // Now tell the mapping output step where to look...\n      // Also explain the mapping output steps how to rename the values back...\n      //\n      mappingOutputSource\n          .setConnectorSteps( targetSteps, getData().inputRenameList, outputDefinition.getValueRenames() );\n\n      // Is this mapping copying or distributing?\n      // Make sure the mapping output step mimics this behavior:","sourceCodeStart":416,"sourceCodeEnd":452,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/mapping/Mapping.java#L416-L452","documentation":"When no source step name is specified for a mapping output, the sub-transformation must contain exactly one 'Mapping Output' step. If findMappingOutput() finds more than one, the Mapping step cannot choose which one to read from and throws this error with the count found (message contains the typo 'specifif').","triggerScenarios":"prepareMappingExecution() with empty inputStepname on an output definition and mappingOutputSteps.length > 1 — two or more Mapping Output steps in the sub-transformation and no explicit source selected.","commonSituations":"Duplicating a Mapping Output step to fork results; merging flows that each had their own Mapping Output; legacy mappings restructured after a refactor.","solutions":["Keep exactly one 'Mapping Output' step in the sub-transformation (remove or convert extras).","Or explicitly pick the source Mapping Output step in the Mapping step dialog's Output tab.","Route multiple result branches into a single Mapping Output via a 'Stream lookup'/union style step or separate mappings.","Grep the .ktr for multiple MappingOutput entries to confirm the count."],"exampleFix":"null","handlingStrategy":"validation","validationCode":"if (Utils.isEmpty(outputDefinition.getInputStepname())) {\n  long n = mappingTransMeta.getSteps().stream()\n      .filter(s -> s.getStepMetaInterface() instanceof MappingOutput).count();\n  if (n != 1) throw new IllegalStateException(\"Expected 1 Mapping Output 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 output'\")) {\n    logError(\"Multiple Mapping Output steps found — keep one or pick a source explicitly\", e);\n  } else { throw e; }\n}","preventionTips":["Keep exactly one 'Mapping Output' step per mapping sub-transformation.","Fork outputs upstream or use separate mappings instead of duplicating Mapping Output.","Audit ktr XML for duplicate MappingOutput entries after merges.","Specify explicit source step names when multiple outputs are intentional."],"tags":["pdi","kettle","mapping-step","mapping-output","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"}