pentaho/pentaho-kettle · error · KettleValueException

<toStringMeta()> : Unknown storage type

Error message

<toStringMeta()> : Unknown storage type [<storageType>] while converting to normal storage type

What it means

Thrown by ValueMetaBase.convertToNormalStorageType when a value object's storage type is none of STORAGE_TYPE_NORMAL, STORAGE_TYPE_BINARY_STRING, or STORAGE_TYPE_INDEXED. This signals an internal inconsistency: the ValueMeta carries an unrecognized storage-type code, so Kettle cannot convert the object to normal storage.

Solutions

  1. Check getStorageType() on the ValueMeta; set it to a valid constant (STORAGE_TYPE_NORMAL=0, _INLINE=1, _INDEXED=2, _BINARY_STRING=3).
  2. Ensure all PDI plugins and the Kettle core are the same version when exchanging serialized transformations/job metadata.
  3. Rebuild the RowMetaInterface programmatically with default storage types instead of reusing deserialized metadata.
  4. If a custom ValueMeta subclass is in play, fix its storage-type handling to only return documented constants.

Example fix

// before
ValueMetaBase vm = new ValueMetaBase("f", ValueMetaInterface.TYPE_STRING);
vm.setStorageType(7); // invalid -> convertToNormalStorageType throws
// after
vm.setStorageType(ValueMetaInterface.STORAGE_TYPE_NORMAL);
Defensive patterns

Strategy: type-guard

Validate before calling

int st = valueMeta.getStorageType();
if (st < 0 || st > ValueMetaInterface.STORAGE_TYPE_BINARY_STRING) {
    throw new IllegalStateException("Unknown storage type: " + st);
}

Type guard

static boolean hasKnownStorageType(ValueMetaInterface vm) {
    int st = vm.getStorageType();
    return st == ValueMetaInterface.STORAGE_TYPE_NORMAL
        || st == ValueMetaInterface.STORAGE_TYPE_INDEXED
        || st == ValueMetaInterface.STORAGE_TYPE_BINARY_STRING
        || st == ValueMetaInterface.STORAGE_TYPE_INLINE;
}

Try / catch

try {
    Object o = valueMeta.convertToNormalStorageType(raw);
} catch (KettleValueException e) {
    throw new IllegalStateException("Corrupted ValueMeta storage type for " + valueMeta.getName(), e);
}

Prevention

When it happens

Trigger: convertToNormalStorageType(Object) (used during cloneToType/storage conversion, e.g. in RowMeta clone or getValue) with getStorageType() returning an unknown int — typically a corrupted/deserialized ValueMeta from an incompatible Kettle version, or a custom ValueMeta setting an out-of-range storage type.

Common situations: Serializing row metadata between different PDI/plugin versions; custom plugin ValueMeta implementations that set an invalid storage type constant; manually constructing ValueMeta objects with wrong setStorageType values.

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


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

Appendix: source

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

   * @return the data in a normal storage type
   * @throws KettleValueException
   *           In case there is a data conversion error.
   */
  @Override
  public Object convertToNormalStorageType( Object object ) throws KettleValueException {
    if ( object == null ) {
      return null;
    }

    switch ( storageType ) {
      case STORAGE_TYPE_NORMAL:
        return object;
      case STORAGE_TYPE_BINARY_STRING:
        return convertBinaryStringToNativeType( (byte[]) object );
      case STORAGE_TYPE_INDEXED:
        return index[(Integer) object];
      default:
        throw new KettleValueException( toStringMeta() + " : Unknown storage type [" + storageType
            + "] while converting to normal storage type" );
    }
  }

  /**
   * Converts the specified data object to the binary string storage type.
   *
   * @param object
   *          the data object to convert
   * @return the data in a binary string storage type
   * @throws KettleValueException
   *           In case there is a data conversion error.
   */
  @Override
  public Object convertToBinaryStringStorageType( Object object ) throws KettleValueException {
    if ( object == null ) {
      return null;
    }

View on GitHub (pinned to f3058517a1)