{"record":{"id":"61d84730c47e8a81","repo":"pentaho/pentaho-kettle","slug":"unable-to-create-value-type","errorCode":null,"errorMessage":"Unable to create value type","messagePattern":"Unable to create value type","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"plugins/avro-format/core/src/main/java/org/pentaho/di/trans/steps/avro/input/AvroInputMetaBase.java","lineNumber":430,"sourceCode":"        if ( info != null ) {\n          boolean found = false;\n          for ( int i = 0; i < info.length && !found; i++ ) {\n            if ( info[i] != null ) {\n              rowMeta.mergeRowMeta( info[i], origin );\n              found = true;\n            }\n          }\n        }\n      }\n      for ( int i = 0; i < inputFields.length; i++ ) {\n        AvroInputField field = inputFields[ i ];\n        String value = space.environmentSubstitute( field.getPentahoFieldName() );\n        ValueMetaInterface v = ValueMetaFactory.createValueMeta( value, field.getPentahoType() );\n        v.setOrigin( origin );\n        rowMeta.addValueMeta( v );\n      }\n    } catch ( KettlePluginException e ) {\n      throw new KettleStepException( \"Unable to create value type\", e );\n    }\n  }\n\n  @Injection( name = \"AVRO_FILENAME\"  )\n  @Deprecated\n  public void setDataFileName( String fileName ) {\n    setDataLocation( fileName, LocationDescriptor.FILE_NAME );\n    setFormat( SourceFormat.AVRO_USE_SCHEMA.ordinal() );\n  }\n\n  @Injection( name = \"DATABASE_STREAM_NAME\"  )\n  @Deprecated\n  public void setDataFieldName( String fieldName ) {\n    setDataLocation( fieldName, LocationDescriptor.FIELD_NAME );\n    setFormat( SourceFormat.AVRO_USE_SCHEMA.ordinal() );\n  }\n\n  @Injection( name = \"SCHEMA_FILENAME\"  )","sourceCodeStart":412,"sourceCodeEnd":448,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/avro-format/core/src/main/java/org/pentaho/di/trans/steps/avro/input/AvroInputMetaBase.java#L412-L448","documentation":"In getFields the step builds each output ValueMeta via ValueMetaFactory.createValueMeta(name, pentahoType). If the configured pentahoType is not a valid/registered value type, KettlePluginException is thrown and re-wrapped as KettleStepException 'Unable to create value type'.","triggerScenarios":"A field mapping whose Pentaho type id is invalid (e.g. loaded from corrupted metadata or set programmatically to an out-of-range type constant).","commonSituations":"Mappings edited in the step dialog with an unsupported type; metadata migrated across PDI versions where type ids changed; repository/XML content corrupted.","solutions":["Open the Avro Input mappings and re-select a valid Pentaho type for the offending field","Fix the field's pentahoType in the stored step metadata/XML","Check the wrapped KettlePluginException message to identify the bad type value"],"exampleFix":"// before\nfield.setPentahoType(-1); // invalid type id\n// after\nfield.setPentahoType(ValueMetaInterface.TYPE_STRING);","handlingStrategy":"try-catch","validationCode":"for (AvroInputField f : fields) {\n  int t = f.getPentahoType();\n  if (t < ValueMetaInterface.TYPE_STRING || t > ValueMetaInterface.TYPE_TIMESTAMP) {\n    throw new KettleStepException(\"Invalid Pentaho type \" + t + \" for field \" + f.getPentahoFieldName());\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  meta.getFields(bowl, rowMeta, origin, info, nextStep, space, repository, metaStore);\n} catch (KettleStepException e) {\n  logError(\"Bad value type in Avro field mapping: \" + e.getCause(), e);\n  setErrors(1);\n}","preventionTips":["Select value types only from the step dialog dropdowns","Re-validate mappings after PDI/plugin upgrades","Review the cause KettlePluginException to identify the offending type id"],"tags":["pdi","avro","value-meta"],"backgroundTag":"invalid-enum-value","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"}