{"record":{"id":"fe29d5a8b4f81344","repo":"pentaho/pentaho-kettle","slug":"kettlestepexception-e","errorCode":null,"errorMessage":"KettleStepException(e)","messagePattern":"KettleStepException\\(e\\)","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"plugins/json/core/src/main/java/org/pentaho/di/trans/steps/jsoninput/JsonInputMeta.java","lineNumber":838,"sourceCode":"\n  }\n\n  @Override\n  public void getFields( Bowl bowl, RowMetaInterface rowMeta, String name, RowMetaInterface[] info, StepMeta nextStep,\n      VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {\n\n    if ( inFields && removeSourceField && !Utils.isEmpty( valueField ) ) {\n      int index = rowMeta.indexOfValue( valueField );\n      if ( index != -1 ) {\n        rowMeta.removeValueMeta( index );\n      }\n    }\n\n    for ( JsonInputField field : getInputFields() ) {\n      try {\n        rowMeta.addValueMeta( field.toValueMeta( name, space ) );\n      } catch ( Exception e ) {\n        throw new KettleStepException( e );\n      }\n    }\n\n    if ( includeFilename ) {\n      ValueMetaInterface v = new ValueMetaString( space.environmentSubstitute( filenameField ) );\n      v.setLength( 250 );\n      v.setPrecision( -1 );\n      v.setOrigin( name );\n      rowMeta.addValueMeta( v );\n    }\n\n    if ( includeRowNumber ) {\n      ValueMetaInterface v = new ValueMetaInteger( space.environmentSubstitute( rowNumberField ) );\n      v.setLength( ValueMetaInterface.DEFAULT_INTEGER_LENGTH, 0 );\n      v.setOrigin( name );\n      rowMeta.addValueMeta( v );\n    }\n    // Add additional fields","sourceCodeStart":820,"sourceCodeEnd":856,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/json/core/src/main/java/org/pentaho/di/trans/steps/jsoninput/JsonInputMeta.java#L820-L856","documentation":"KettleStepException wrapping an Exception thrown by JsonInputMeta.getFields() while converting each configured JsonInputField to a ValueMetaInterface via field.toValueMeta(name, space). It surfaces when a field definition is invalid (bad conversion format/type) so the output row metadata cannot be built.","triggerScenarios":"getFields -> field.toValueMeta: exception while applying conversion metadata, e.g. an invalid conversion mask/date format for a Date/Timestamp/Number field type, or unsupported type string resolved with the variable space.","commonSituations":"A JSON Input field configured with type=Date but an invalid or locale-mismatched format mask; field definitions copied from another step with incompatible types; environment variables in the format string unresolvable.","solutions":["Open the JSON Input step's Fields tab and fix the Format column for the failing field (use a valid SimpleDateFormat mask for Date, e.g. yyyy-MM-dd'T'HH:mm:ss).","Change the field Type to String if no conversion format is needed.","Resolve any ${VARIABLE} used in the format/length settings — ensure it's defined at runtime.","Recreate the field definition from scratch to reset stale metadata."],"exampleFix":"// before: field config\npath=$.ts, type=Date, format=not-a-date-pattern\n// after\npath=$.ts, type=Date, format=yyyy-MM-dd'T'HH:mm:ss'Z'","handlingStrategy":"validation","validationCode":"// validate field definitions before building metadata\nfor (JsonInputField f : meta.getInputFields()) {\n  if (f.getType() == ValueMetaInterface.TYPE_DATE && (f.getFormat() == null || f.getFormat().isEmpty()))\n    throw new IllegalArgumentException(\"Date field \" + f.getName() + \" needs a format mask\");\n}","typeGuard":null,"tryCatchPattern":"try { meta.getFields(row, name, info, space, null); }\ncatch (KettleStepException e) { throw new IllegalStateException(\"Invalid field config: \" + e.getCause(), e); }","preventionTips":["Give every Date/Timestamp/Number field an explicit, valid conversion mask.","Use String type when no format conversion is needed.","Ensure variables used in field settings are defined in kettle.properties or at runtime.","Validate row metadata in a test harness before deploying transformations."],"tags":["metadata","row-structure","type-conversion","kettle"],"backgroundTag":"invalid-argument-format","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"}