{"record":{"id":"d38e13f766dd5dcf","repo":"pentaho/pentaho-kettle","slug":"error-creating-value-meta-for-output-field-fieldname","errorCode":null,"errorMessage":"Error creating value meta for output field '{fieldName}'","messagePattern":"Error creating value meta for output field '(.+?)'","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"plugins/meta-inject/impl/src/main/java/org/pentaho/di/trans/steps/metainject/MetaInjectMeta.java","lineNumber":380,"sourceCode":"        rep.saveStepAttribute( id_transformation, id_step, i, MAPPING_SOURCE_STEP, source.getStepname() );\n        rep.saveStepAttribute( id_transformation, id_step, i, MAPPING_SOURCE_FIELD, source.getField() );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( \"Unable to save step information to the repository for id_step=\" + id_step, e );\n    }\n  }\n\n  @Override\n  public void getFields( Bowl bowl, RowMetaInterface rowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep,\n                         VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {\n\n    rowMeta.clear(); // No defined output is expected from this step.\n    if ( !Utils.isEmpty( sourceStepName ) ) {\n      for ( MetaInjectOutputField field : sourceOutputFields ) {\n        try {\n          rowMeta.addValueMeta( field.createValueMeta() );\n        } catch ( KettlePluginException e ) {\n          throw new KettleStepException( \"Error creating value meta for output field '\" + field.getName() + \"'\", e );\n        }\n      }\n    }\n  }\n\n  @Override\n  public StepInterface getStep( StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr, TransMeta tr,\n                                Trans trans ) {\n    return new MetaInject( stepMeta, stepDataInterface, cnr, tr, trans );\n  }\n\n  @Override\n  public StepDataInterface getStepData() {\n    return new MetaInjectData();\n  }\n\n  public Map<TargetStepAttribute, SourceStepField> getTargetSourceMapping() {\n    return targetSourceMapping;","sourceCodeStart":362,"sourceCodeEnd":398,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/meta-inject/impl/src/main/java/org/pentaho/di/trans/steps/metainject/MetaInjectMeta.java#L362-L398","documentation":"MetaInjectMeta.getFields() builds the step's output row metadata from the configured sourceOutputFields. field.createValueMeta() throws KettlePluginException when the field's data type or conversion metadata cannot be instantiated; this is wrapped in a KettleStepException naming the offending field.","triggerScenarios":"getFields() iterating sourceOutputFields where a MetaInjectOutputField has an invalid/unknown type, or a plugin providing the required value meta is missing, so field.createValueMeta() throws.","commonSituations":"A mapping references a source field whose type was changed or removed upstream; missing value-type plugin jars; transformation copied between environments with different plugin sets.","solutions":["Check the fieldName in the message and fix its declared data type in the Meta Inject mapping grid.","Ensure the source step still produces that field with a supported type.","Verify all required Kettle plugins (value type providers) are installed.","Re-select the source field in the step dialog so type metadata is regenerated."],"exampleFix":"// before: mapping with stale/invalid type\nfield.setType(-1);\n// after: explicit valid type\nfield.setType(ValueMetaInterface.TYPE_STRING);","handlingStrategy":"validation","validationCode":"// Validate each output field's type before calling getFields\nfor (MetaInjectOutputField f : sourceOutputFields) {\n  if (f.getType() < 0 || f.getType() >= ValueMetaInterface.typeCodes.length) {\n    throw new IllegalArgumentException(\"Invalid type for field \" + f.getName());\n  }\n}","typeGuard":"boolean hasValidTypes(List<MetaInjectOutputField> fields) {\n  return fields.stream().allMatch(f -> f.getType() != -1);\n}","tryCatchPattern":"try {\n  meta.getFields(bowl, rowMeta, origin, info, nextStep, space, repository, metaStore);\n} catch (KettleStepException e) {\n  logError(\"Bad output field metadata: \" + e.getMessage(), e);\n}","preventionTips":["Re-generate mappings when upstream step fields change","Install all value-type plugins on every environment","Review the named field in the error message first"],"tags":["metadata","kettle","meta-inject","value-meta"],"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"}