pentaho/pentaho-kettle · error · KettleException

: Unable to de-serialize '' from XML for data type

Error message

 : Unable to de-serialize '' from XML for data type 

What it means

In ValueMetaBase.getValue(node) — XML de-serialization of a value — the stored string is converted back to the declared data type. If the data type is not among the supported types (default branch of the switch), a KettleException is thrown stating the value could not be de-serialized from XML for that data type. It means the XML contains a value of a type the reader cannot reconstruct.

Solutions

  1. Use matching Pentaho/Kettle versions on both writer and reader so all types have XML de-serialization support.
  2. Change the field to a supported type (Date instead of Timestamp, String instead of Inet/JSON) and re-export the transformation.
  3. Validate/repair the type attribute in the metadata XML if it was hand-edited or corrupted.
  4. Patch/upgrade the plugin responsible for the custom type to support XML round-tripping.

Example fix

// before
ValueMetaBase vm = new ValueMetaBase("host", ValueMetaInterface.TYPE_INET); // default branch -> KettleException on getValue
// after
ValueMetaBase vm = new ValueMetaBase("host", ValueMetaInterface.TYPE_STRING);
Defensive patterns

Strategy: validation

Validate before calling

int[] ok = { TYPE_STRING, TYPE_NUMBER, TYPE_INTEGER, TYPE_DATE, TYPE_BIGNUMBER, TYPE_BOOLEAN, TYPE_BINARY };
int type = Integer.parseInt(XMLHandler.getTagValue(node, "type"));
if (Arrays.stream(ok).noneMatch(t -> t == type)) {
  throw new KettleException("XML contains unsupported value type " + type + "; re-export with matching engine version");
}

Type guard

boolean isXmlDeserializableType(int type) {
  return type == ValueMetaInterface.TYPE_STRING
      || type == ValueMetaInterface.TYPE_NUMBER
      || type == ValueMetaInterface.TYPE_INTEGER
      || type == ValueMetaInterface.TYPE_DATE
      || type == ValueMetaInterface.TYPE_BIGNUMBER
      || type == ValueMetaInterface.TYPE_BOOLEAN
      || type == ValueMetaInterface.TYPE_BINARY;
}

Try / catch

try {
  Object value = valueMeta.getValue(node);
} catch (KettleException e) {
  if (e.getMessage() != null && e.getMessage().contains("Unable to de-serialize")) {
    throw new KettleException("Value type in XML not supported by this engine; upgrade Kettle or convert the field", e);
  }
  throw e;
}

Prevention

When it happens

Trigger: Calling getXML-reading counterparts (getValue/ValueMetaUtil-created metas) on XML produced for a value whose data type falls in the default branch — TYPE_TIMESTAMP, TYPE_INET, TYPE_JSON, TYPE_AVRO or an out-of-range type int read from the node.

Common situations: Transformation XML written by a newer Pentaho version (Timestamp/Inet fields) loaded by an older engine; hand-edited XML with an invalid type attribute; plugins with custom types lacking de-serialization support.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/e3e187394e751ed4. Report an issue: GitHub.

Appendix: source

Thrown at core/src/main/java/org/pentaho/di/core/row/value/ValueMetaBase.java:3453

        switch ( getType() ) {
          case TYPE_STRING:
            return valueString;
          case TYPE_NUMBER:
            return Double.parseDouble( valueString );
          case TYPE_INTEGER:
            return Long.parseLong( valueString );
          case TYPE_DATE:
            return XMLHandler.stringToDate( valueString );
          case TYPE_TIMESTAMP:
            return XMLHandler.stringToTimestamp( valueString );
          case TYPE_BIGNUMBER:
            return new BigDecimal( valueString );
          case TYPE_BOOLEAN:
            return "Y".equalsIgnoreCase( valueString );
          case TYPE_BINARY:
            return XMLHandler.stringToBinary( XMLHandler.getTagValue( node, "binary-value" ) );
          default:
            throw new KettleException( toString() + " : Unable to de-serialize '" + valueString
                + "' from XML for data type " + getType() );
        }

      case STORAGE_TYPE_BINARY_STRING:
        // Handle binary string content -- only when not NULL
        // In this case, we opt not to convert anything at all for speed.
        // That way, we can save on CPU power.
        // Since the streams can be compressed, volume shouldn't be an issue at
        // all.
        //
        String binaryString = XMLHandler.getTagValue( node, "binary-string" );
        if ( Utils.isEmpty( binaryString ) ) {
          return null;
        }

        return XMLHandler.stringToBinary( binaryString );

      case STORAGE_TYPE_INDEXED:

View on GitHub (pinned to f3058517a1)