{"record":{"id":"7a1c922a84b681ad","repo":"pentaho/pentaho-kettle","slug":"kettlestepexception-cause-wrapping-field-conversion-error-in","errorCode":null,"errorMessage":"KettleStepException(cause) wrapping field conversion error in getFields","messagePattern":"KettleStepException\\(cause\\) wrapping field conversion error in getFields","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/fileinput/text/TextFileInputMeta.java","lineNumber":586,"sourceCode":"        type = ValueMetaInterface.TYPE_STRING;\n      }\n\n      try {\n        ValueMetaInterface v = ValueMetaFactory.createValueMeta( field.getName(), type );\n        v.setLength( field.getLength() );\n        v.setPrecision( field.getPrecision() );\n        v.setOrigin( name );\n        v.setConversionMask( field.getFormat() );\n        v.setDecimalSymbol( field.getDecimalSymbol() );\n        v.setGroupingSymbol( field.getGroupSymbol() );\n        v.setCurrencySymbol( field.getCurrencySymbol() );\n        v.setDateFormatLenient( content.dateFormatLenient );\n        v.setDateFormatLocale( content.dateFormatLocale );\n        v.setTrimType( field.getTrimType() );\n\n        row.addValueMeta( v );\n      } catch ( Exception e ) {\n        throw new KettleStepException( e );\n      }\n    }\n    if ( errorHandling.errorIgnored ) {\n      if ( errorCountField != null && errorCountField.length() > 0 ) {\n        ValueMetaInterface v = new ValueMetaInteger( errorCountField );\n        v.setLength( ValueMetaInterface.DEFAULT_INTEGER_LENGTH, 0 );\n        v.setOrigin( name );\n        row.addValueMeta( v );\n      }\n      if ( errorFieldsField != null && errorFieldsField.length() > 0 ) {\n        ValueMetaInterface v = new ValueMetaString( errorFieldsField );\n        v.setOrigin( name );\n        row.addValueMeta( v );\n      }\n      if ( errorTextField != null && errorTextField.length() > 0 ) {\n        ValueMetaInterface v = new ValueMetaString( errorTextField );\n        v.setOrigin( name );\n        row.addValueMeta( v );","sourceCodeStart":568,"sourceCodeEnd":604,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/fileinput/text/TextFileInputMeta.java#L568-L604","documentation":"In TextFileInputMeta.getFields(), while building the output row metadata (ValueMeta) for each configured field, any exception (e.g. invalid format masks, bad conversion settings) is rethrown as KettleStepException with the original exception as cause. The step cannot describe its output row layout without valid per-field conversion settings.","triggerScenarios":"Calling getFields(...) (e.g. during row metadata resolution in the transformation) when a field's conversion mask, currency/decimal/grouping symbols, or format string makes constructing/validating the ValueMetaInterface throw.","commonSituations":"Typo'd date format masks (e.g. 'yyyy-MM-dd HH:mm' vs bad pattern chars); invalid number format patterns; locale issues after copying metadata between environments; null field names from incomplete dialog configuration.","solutions":["Inspect the cause exception to see which field's conversion setup failed.","Correct the Format/Conversion mask for the failing field in the Fields tab (use valid SimpleDateFormat / DecimalFormat patterns).","Verify each field has a non-empty name and a compatible type for the given mask.","Remove exotic currency/grouping symbol settings or fix them to valid single characters.","Test the metadata via the step's 'Preview' before running the full transformation."],"exampleFix":"// before: invalid mask for a Date field\nfield.setFormat(\"YYYY-mm-DD\");\n// after: valid SimpleDateFormat pattern\nfield.setFormat(\"yyyy-MM-dd\");","handlingStrategy":"validation","validationCode":"for (TextFileInputField f : meta.inputFields) {\n  if (f.getName() == null || f.getName().isEmpty())\n    throw new KettleStepException(\"Field name missing\");\n  if (f.getFormatMask() != null && f.getType() == ValueMetaInterface.TYPE_DATE)\n    new SimpleDateFormat(f.getFormatMask()); // throws early on bad mask\n}","typeGuard":"if (rowMeta == null || rowMeta.size() == 0) return false; // no usable output fields","tryCatchPattern":"try {\n  meta.getFields(row, \"stepName\", info, transMeta, stepMeta, metaStore);\n} catch (KettleStepException e) {\n  log.logError(\"Field metadata error: \" + e.getCause(), e);\n  // fix masks/types or fall back to all-String fields\n}","preventionTips":["Verify every field has a name and valid type/mask pair before saving the step.","Use Spoon's field preview to test conversion masks against real data.","Keep masks as SimpleDateFormat/DecimalFormat-valid patterns.","Avoid copying masks between locales without adjusting locale settings."],"tags":["kettle","etl","row-metadata","field-conversion"],"backgroundTag":"type-mismatch","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"}