{"record":{"id":"42a5dafdeadae22e","repo":"pentaho/pentaho-kettle","slug":"no-mapping-sub-transformation-was-specified-or-it-was-not-a","errorCode":null,"errorMessage":"No mapping (sub-transformation) was specified or it was not a valid one.","messagePattern":"No mapping \\(sub-transformation\\) was specified or it was not a valid one\\.","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/simplemapping/SimpleMappingHelper.java","lineNumber":178,"sourceCode":"    }\n\n    return response;\n  }\n\n  TransMeta loadSimpleMappingMeta( TransMeta transMeta, SimpleMappingMeta simpleMappingMeta ) throws KettleException {\n    return StepWithMappingMeta.loadMappingMeta( transMeta.getBowl(), simpleMappingMeta,\n        transMeta.getRepository(),\n        transMeta.getMetaStore(), transMeta,\n        true );\n  }\n\n  public RowMetaInterface getFieldsFromStep( TransMeta transMeta, TransMeta mappingTransMeta, StepMeta stepMeta, boolean parent, boolean input ) throws KettleException {\n    if ( input ) {\n      if ( parent ) {\n        return transMeta.getPrevStepFields( stepMeta );\n      } else {\n        if ( mappingTransMeta == null ) {\n          throw new KettleException( BaseMessages.getString(\n              PKG, \"SimpleMappingDialog.Exception.NoMappingSpecified\" ) );\n        }\n        StepMeta mappingInputStepMeta = mappingTransMeta.findMappingInputStep( null );\n        return mappingTransMeta.getStepFields( mappingInputStepMeta );\n      }\n    } else {\n      StepMeta mappingOutputStepMeta = mappingTransMeta.findMappingOutputStep( null );\n      return mappingTransMeta.getStepFields( mappingOutputStepMeta );\n    }\n  }\n\n  private JSONArray generateFieldsJSON( RowMetaInterface fields ) {\n    JSONArray rowsArray = new JSONArray();\n\n    for ( int i = 0; i < fields.getValueMetaList().size(); i++ ) {\n      JSONObject rowObject = new JSONObject();\n      rowObject.put( \"type\", fields.getValueMeta( i ).getTypeDesc() );\n      rowObject.put( \"name\", fields.getValueMeta( i ).getName() );","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/simplemapping/SimpleMappingHelper.java#L160-L196","documentation":"SimpleMappingHelper.getFieldsFromStep resolves field layout for a mapping step. When asked for the sub-transformation (non-parent) side with input=true, it must locate the Mapping Input step in the mapping's TransMeta; if mappingTransMeta is null (no mapping was specified or it failed to load) a KettleException with the localized 'No mapping specified' message is thrown.","triggerScenarios":"Called via sourceRowMeta()/targetRowMeta() with parent=false and input=true while the mappingTransMeta parameter is null - i.e. the Simple Mapping step's mapping transformation reference is empty or could not be resolved before this call.","commonSituations":"Mapping reference never configured on the step; the referenced transformation file/repository path is blank after an import/export or version-control merge; the mapping field is populated only via a variable that was not set at metadata-inspection time (e.g. during transformation checking in Spoon).","solutions":["Set a valid mapping transformation on the Simple Mapping step (specify file or repository entry) before running or checking the transformation.","Confirm the mapping path/expression resolves at runtime - check that any variables used in the mapping reference are defined (kettle.properties, parameter injection).","Re-open and re-save the step dialog to rebuild the mapping reference if it was lost during an XML merge or import.","Verify the referenced transformation file still exists and is readable from the environment running the transformation."],"exampleFix":"// before: Simple Mapping step has no mapping specified\n//   Mapping transformation: (empty)\n// after: point at an existing sub-transformation\n//   Mapping transformation: ${Internal.Transformation.Filename.Directory}/sub_mapping.ktr","handlingStrategy":"validation","validationCode":"// Ensure a mapping reference is set before resolving fields\nif (simpleMappingMeta.getMappingTransformationName() == null\n    && simpleMappingMeta.getFileName() == null) {\n  throw new IllegalStateException(\"Simple Mapping step '\" + stepname + \"' has no mapping transformation specified\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  RowMetaInterface fields = helper.getFieldsFromStep(transMeta, mappingTransMeta, stepMeta, false, true);\n} catch (KettleException e) {\n  logError(\"No valid mapping specified for Simple Mapping step: \" + e.getMessage());\n}","preventionTips":["Configure the mapping reference (file or repository entry) immediately after adding the step","Prefer variables with defaults defined in kettle.properties so references resolve in all environments","Run 'Verify transformations' before production deployments to catch empty mapping references"],"tags":["kettle","pdi","mapping-step","configuration","metadata"],"backgroundTag":"missing-required-argument","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"}