{"record":{"id":"587530d545003ba3","repo":"pentaho/pentaho-kettle","slug":"unknown-storage-type-storagetype-specified-587530","errorCode":null,"errorMessage":" : Unknown storage type \" + storageType + \" specified.","messagePattern":" : Unknown storage type \" \\+ storageType \\+ \" specified\\.","errorType":"exception","errorClass":"KettleValueException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/row/value/ValueMetaTimestamp.java","lineNumber":139,"sourceCode":"  public String getString( Object object ) throws KettleValueException {\n    return convertTimestampToString( getTimestamp( object ) );\n  }\n\n  public Timestamp getTimestamp( Object object ) throws KettleValueException {\n    if ( object == null ) {\n      return null;\n    }\n    switch ( type ) {\n      case TYPE_TIMESTAMP:\n        switch ( storageType ) {\n          case STORAGE_TYPE_NORMAL:\n            return (Timestamp) object;\n          case STORAGE_TYPE_BINARY_STRING:\n            return (Timestamp) convertBinaryStringToNativeType( (byte[]) object );\n          case STORAGE_TYPE_INDEXED:\n            return (Timestamp) index[ ( (Integer) object ).intValue() ];\n          default:\n            throw new KettleValueException( toString() + \" : Unknown storage type \" + storageType + \" specified.\" );\n        }\n      case TYPE_STRING:\n        switch ( storageType ) {\n          case STORAGE_TYPE_NORMAL:\n            return convertStringToTimestamp( (String) object );\n          case STORAGE_TYPE_BINARY_STRING:\n            return convertStringToTimestamp( (String) convertBinaryStringToNativeType( (byte[]) object ) );\n          case STORAGE_TYPE_INDEXED:\n            return convertStringToTimestamp( (String) index[ ( (Integer) object ).intValue() ] );\n          default:\n            throw new KettleValueException( toString() + \" : Unknown storage type \" + storageType + \" specified.\" );\n        }\n      case TYPE_NUMBER:\n        switch ( storageType ) {\n          case STORAGE_TYPE_NORMAL:\n            return convertNumberToTimestamp( (Double) object );\n          case STORAGE_TYPE_BINARY_STRING:\n            return convertNumberToTimestamp( (Double) convertBinaryStringToNativeType( (byte[]) object ) );","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/row/value/ValueMetaTimestamp.java#L121-L157","documentation":"Inside ValueMetaTimestamp.getTimestamp(), when the field's declared data type is TYPE_STRING the code switches on storageType (NORMAL, BINARY_STRING, INDEXED). If storageType holds any other value, the default branch throws this KettleValueException. It signals a corrupted/unknown storage-type constant on the value metadata rather than a data conversion failure.","triggerScenarios":"Calling getTimestamp(object) on a ValueMetaTimestamp whose type is TYPE_STRING and whose storageType field has been set to an unrecognized value (negative, 0 when undefined, or any constant outside STORAGE_TYPE_NORMAL/BINARY_STRING/INDEXED).","commonSituations":"Metadata deserialized from an old or newer KTR/KJB version where storage type codes differ; manually constructing ValueMeta and setting storage type via setStorageType with a wrong literal; uninitialized storageType (0) combined with TYPE_STRING data.","solutions":["Check the value meta's storage type before the call: System.out.println(valueMeta.getStorageType()) and set it explicitly with valueMeta.setStorageType( ValueMetaInterface.STORAGE_TYPE_NORMAL ).","If the metadata came from a serialized transformation, re-open and re-save it with the current PDI version to normalize storage type codes.","Call valueMeta.setStorageType(STORAGE_TYPE_NORMAL) after construction if you built the ValueMeta manually and never assigned a storage type.","Verify you are not accidentally passing a different ValueMetaInterface implementation whose storage-type constants diverge from the ones this switch expects."],"exampleFix":"// before\nValueMetaInterface meta = new ValueMeta( \"ts\", ValueMetaInterface.TYPE_STRING ); // storageType defaults to 0\nTimestamp t = meta.getTimestamp( object ); // throws Unknown storage type\n// after\nValueMetaInterface meta = new ValueMeta( \"ts\", ValueMetaInterface.TYPE_STRING );\nmeta.setStorageType( ValueMetaInterface.STORAGE_TYPE_NORMAL );\nTimestamp t = meta.getTimestamp( object );","handlingStrategy":"validation","validationCode":"int st = meta.getStorageType();\nif ( st != ValueMetaInterface.STORAGE_TYPE_NORMAL\n  && st != ValueMetaInterface.STORAGE_TYPE_BINARY_STRING\n  && st != ValueMetaInterface.STORAGE_TYPE_INDEXED ) {\n  meta.setStorageType( ValueMetaInterface.STORAGE_TYPE_NORMAL );\n}","typeGuard":"boolean hasKnownStorageType( ValueMetaInterface meta ) {\n  int st = meta.getStorageType();\n  return st == ValueMetaInterface.STORAGE_TYPE_NORMAL\n    || st == ValueMetaInterface.STORAGE_TYPE_BINARY_STRING\n    || st == ValueMetaInterface.STORAGE_TYPE_INDEXED;\n}","tryCatchPattern":"try {\n  t = meta.getTimestamp( value );\n} catch ( KettleValueException e ) {\n  if ( e.getMessage().contains( \"Unknown storage type\" ) ) {\n    meta.setStorageType( ValueMetaInterface.STORAGE_TYPE_NORMAL );\n    t = meta.getTimestamp( value );\n  } else { throw e; }\n}","preventionTips":["Always call setStorageType() with a ValueMetaInterface.STORAGE_TYPE_* constant after constructing ValueMeta manually.","Avoid hand-writing storage-type integers; use the named constants.","Re-save old transformations with the current PDI version to normalize serialized metadata.","Log meta.toString() (included in the exception prefix) to quickly find the offending field."],"tags":["kettle","pdi","storage-type","timestamp","invalid-enum"],"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"}