{"record":{"id":"177e52fb5e61e4a1","repo":"pentaho/pentaho-kettle","slug":"tostringmeta-unknown-storage-type-storagetype-while","errorCode":null,"errorMessage":"<toStringMeta()> : Unknown storage type [<storageType>] while converting to normal storage type","messagePattern":"<toStringMeta\\(\\)> : Unknown storage type \\[<storageType>\\] while converting to normal storage type","errorType":"exception","errorClass":"KettleValueException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/row/value/ValueMetaBase.java","lineNumber":1565,"sourceCode":"   * @return the data in a normal storage type\n   * @throws KettleValueException\n   *           In case there is a data conversion error.\n   */\n  @Override\n  public Object convertToNormalStorageType( Object object ) throws KettleValueException {\n    if ( object == null ) {\n      return null;\n    }\n\n    switch ( storageType ) {\n      case STORAGE_TYPE_NORMAL:\n        return object;\n      case STORAGE_TYPE_BINARY_STRING:\n        return convertBinaryStringToNativeType( (byte[]) object );\n      case STORAGE_TYPE_INDEXED:\n        return index[(Integer) object];\n      default:\n        throw new KettleValueException( toStringMeta() + \" : Unknown storage type [\" + storageType\n            + \"] while converting to normal storage type\" );\n    }\n  }\n\n  /**\n   * Converts the specified data object to the binary string storage type.\n   *\n   * @param object\n   *          the data object to convert\n   * @return the data in a binary string storage type\n   * @throws KettleValueException\n   *           In case there is a data conversion error.\n   */\n  @Override\n  public Object convertToBinaryStringStorageType( Object object ) throws KettleValueException {\n    if ( object == null ) {\n      return null;\n    }","sourceCodeStart":1547,"sourceCodeEnd":1583,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/row/value/ValueMetaBase.java#L1547-L1583","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check getStorageType() on the ValueMeta; set it to a valid constant (STORAGE_TYPE_NORMAL=0, _INLINE=1, _INDEXED=2, _BINARY_STRING=3).","Ensure all PDI plugins and the Kettle core are the same version when exchanging serialized transformations/job metadata.","Rebuild the RowMetaInterface programmatically with default storage types instead of reusing deserialized metadata.","If a custom ValueMeta subclass is in play, fix its storage-type handling to only return documented constants."],"exampleFix":"// before\nValueMetaBase vm = new ValueMetaBase(\"f\", ValueMetaInterface.TYPE_STRING);\nvm.setStorageType(7); // invalid -> convertToNormalStorageType throws\n// after\nvm.setStorageType(ValueMetaInterface.STORAGE_TYPE_NORMAL);","handlingStrategy":"type-guard","validationCode":"int st = valueMeta.getStorageType();\nif (st < 0 || st > ValueMetaInterface.STORAGE_TYPE_BINARY_STRING) {\n    throw new IllegalStateException(\"Unknown storage type: \" + st);\n}","typeGuard":"static boolean hasKnownStorageType(ValueMetaInterface vm) {\n    int st = vm.getStorageType();\n    return st == ValueMetaInterface.STORAGE_TYPE_NORMAL\n        || st == ValueMetaInterface.STORAGE_TYPE_INDEXED\n        || st == ValueMetaInterface.STORAGE_TYPE_BINARY_STRING\n        || st == ValueMetaInterface.STORAGE_TYPE_INLINE;\n}","tryCatchPattern":"try {\n    Object o = valueMeta.convertToNormalStorageType(raw);\n} catch (KettleValueException e) {\n    throw new IllegalStateException(\"Corrupted ValueMeta storage type for \" + valueMeta.getName(), e);\n}","preventionTips":["Keep Kettle core and all plugins on the same version when sharing serialized metadata","Only set storage types via documented STORAGE_TYPE_* constants","Validate deserialized repository metadata before executing transformations"],"tags":["pdi","storage-type","internal-state","kettle"],"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"}