pentaho/pentaho-kettle · error · KettleException
Unknown data type : type
Error message
Unknown data type : type
What it means
parseAttributeValue found a type prefix letter it does not support (expected S=String, D=Double, I=Long, B=Boolean) and throws KettleException "Unknown data type". The encoded attribute value was written with an unknown or corrupt type letter.
Solutions
- Fix or delete the offending R_ELEMENT_ATTRIBUTE row so the value starts with a supported type letter (S:/D:/I:/B:)
- Re-save the element via the metastore API to re-encode values
- Ensure all PDI nodes sharing the repository run compatible versions
- Pre-validate encoded values (empty or missing prefix) before parsing
Example fix
// before: trusting value
Object v = delegate.parseAttributeValue("42");
// after: guard the prefix
String value = "I:42";
if (value == null || value.isEmpty() || !"SDIB".contains(value.substring(0, 1))) {
throw new IllegalArgumentException("Attribute value lacks valid type prefix: " + value);
}
Object v = delegate.parseAttributeValue(value); Defensive patterns
Strategy: validation
Validate before calling
boolean hasKnownTypePrefix(String encoded) { return encoded != null && !encoded.isEmpty() && "SDIB".indexOf(encoded.charAt(0)) >= 0; } Type guard
boolean isDecodableValue(String v) { return v != null && v.length() >= 2 && "SDIB".contains(v.substring(0,1)); } Try / catch
try { Object v = delegate.parseAttributeValue(value); } catch (KettleException e) { v = defaultValue; logWarn("Unknown metastore value type: " + value, e); } Prevention
- Always write attribute values through the metastore API
- Ensure all PDI nodes sharing the repository use the same version
- Reject values without a valid S/D/I/B prefix at ingest
When it happens
Trigger: Reading a metastore attribute whose value string's first char is not one of S/D/I/B — e.g. empty value, manually edited row, or value written by a newer/older metastore encoder.
Common situations: Manual SQL edits to R_ELEMENT_ATTRIBUTE; empty value string missing its type prefix; version drift between PDI instances sharing one repository.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- Can't encode object of class : className
- Unable to parse attribute from attribute row: attributeRow
- Can not create element type with id…
- Can not create element type with id
- Can't delete element type with name
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/983d53dd4b4c747b.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryMetaStoreDelegate.java:393
return null;
}
String valueString = value.substring( 2 );
char type = value.charAt( 0 );
switch ( type ) {
case 'S':
return valueString;
case 'T':
return new SimpleTimestampFormat( ValueMetaBase.DEFAULT_TIMESTAMP_FORMAT_MASK ).parse( valueString );
case 'D':
return new SimpleDateFormat( ValueMetaBase.DEFAULT_DATE_FORMAT_MASK ).parse( valueString );
case 'N':
return Double.valueOf( valueString );
case 'I':
return Long.valueOf( valueString );
case 'B':
return "true".equalsIgnoreCase( valueString ) || "y".equalsIgnoreCase( valueString );
default:
throw new KettleException( "Unknown data type : " + type );
}
}
public String encodeAttributeValue( Object object ) throws Exception {
if ( object == null ) {
return "";
}
if ( object instanceof String ) {
return "S:" + object.toString();
}
if ( object instanceof Timestamp ) {
return "T:" + new SimpleTimestampFormat(
ValueMetaBase.DEFAULT_TIMESTAMP_FORMAT_MASK ).format( (Timestamp) object );
}
if ( object instanceof Date ) {
return "D:" + new SimpleDateFormat( ValueMetaBase.DEFAULT_DATE_FORMAT_MASK ).format( (Date) object );
}
if ( object instanceof Double ) {View on GitHub (pinned to f3058517a1)