pentaho/pentaho-kettle · error · KettleFileException

: Unknown storage type " + getStorageType()

Error message

 : Unknown storage type " + getStorageType()

What it means

KettleFileException thrown by ValueMetaBase.writeData when the ValueMeta's storage type is neither STORAGE_TYPE_NORMAL, STORAGE_TYPE_BINARY_STRING, nor STORAGE_TYPE_INDEXED. The storage-type switch's default branch fires, meaning getStorageType() holds an unrecognized constant.

Solutions

  1. Set storage type explicitly to ValueMetaInterface.STORAGE_TYPE_NORMAL (or the intended valid constant) before writing
  2. Inspect getStorageType() in a debugger/log to find where the invalid constant is assigned
  3. Ensure the Kettle version writing the data matches the version that created the metadata

Example fix

// before
valueMeta.writeData(outputStream, object); // storageType accidentally 99
// after
if (valueMeta.getStorageType() < ValueMetaInterface.STORAGE_TYPE_NORMAL
    || valueMeta.getStorageType() > ValueMetaInterface.STORAGE_TYPE_INDEXED) {
  valueMeta.setStorageType(ValueMetaInterface.STORAGE_TYPE_NORMAL);
}
valueMeta.writeData(outputStream, object);
Defensive patterns

Strategy: validation

Validate before calling

static void assertValidStorageType(ValueMetaInterface vmi) throws KettleFileException {
  int st = vmi.getStorageType();
  if (st != ValueMetaInterface.STORAGE_TYPE_NORMAL
      && st != ValueMetaInterface.STORAGE_TYPE_BINARY_STRING
      && st != ValueMetaInterface.STORAGE_TYPE_INDEXED) {
    throw new KettleFileException("Invalid storage type " + st + " on field '" + vmi.getName() + "'");
  }
}

Try / catch

try {
  valueMeta.writeData(out, object);
} catch (KettleFileException e) {
  if (String.valueOf(e.getMessage()).contains("Unknown storage type")) {
    valueMeta.setStorageType(ValueMetaInterface.STORAGE_TYPE_NORMAL); // repair and retry
  } else { throw e; }
}

Prevention

When it happens

Trigger: Calling writeData() on a ValueMeta with a storage type set programmatically to an invalid value, or a storage type introduced in a newer Kettle version while running an older writer.

Common situations: Custom plugins mutating storage type constants; metadata deserialized from a file created by a different Kettle version; copy/paste of ValueMeta code with an incorrect storage type assignment.

Related errors


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

Appendix: source

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

            }
            break;

          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.
            //
            writeBinaryString( outputStream, (byte[]) object );
            break;

          case STORAGE_TYPE_INDEXED:
            writeInteger( outputStream, (Integer) object ); // just an index
            break;

          default:
            throw new KettleFileException( toString() + " : Unknown storage type " + getStorageType() );
        }
      }
    } catch ( ClassCastException e ) {
      throw new RuntimeException( toString() + " : There was a data type error: the data type of "
          + object.getClass().getName() + " object [" + object + "] does not correspond to value meta ["
          + toStringMeta() + "]" );
    } catch ( IOException e ) {
      throw new KettleFileException( toString() + " : Unable to write value data to output stream", e );
    }

  }

  @Override
  public Object readData( DataInputStream inputStream ) throws KettleFileException, KettleEOFException,
    SocketTimeoutException {
    try {
      // Is the value NULL?
      if ( inputStream.readBoolean() ) {

View on GitHub (pinned to f3058517a1)