{"record":{"id":"376fe6f67f0dbbaa","repo":"pentaho/pentaho-kettle","slug":"unknown-storage-type-getstoragetype","errorCode":null,"errorMessage":" : Unknown storage type \" + getStorageType()","messagePattern":" : Unknown storage type \" \\+ getStorageType\\(\\)","errorType":"exception","errorClass":"KettleFileException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/row/value/ValueMetaBase.java","lineNumber":2780,"sourceCode":"            }\n            break;\n\n          case STORAGE_TYPE_BINARY_STRING:\n            // Handle binary string content -- only when not NULL\n            // In this case, we opt not to convert anything at all for speed.\n            // That way, we can save on CPU power.\n            // Since the streams can be compressed, volume shouldn't be an issue\n            // at all.\n            //\n            writeBinaryString( outputStream, (byte[]) object );\n            break;\n\n          case STORAGE_TYPE_INDEXED:\n            writeInteger( outputStream, (Integer) object ); // just an index\n            break;\n\n          default:\n            throw new KettleFileException( toString() + \" : Unknown storage type \" + getStorageType() );\n        }\n      }\n    } catch ( ClassCastException e ) {\n      throw new RuntimeException( toString() + \" : There was a data type error: the data type of \"\n          + object.getClass().getName() + \" object [\" + object + \"] does not correspond to value meta [\"\n          + toStringMeta() + \"]\" );\n    } catch ( IOException e ) {\n      throw new KettleFileException( toString() + \" : Unable to write value data to output stream\", e );\n    }\n\n  }\n\n  @Override\n  public Object readData( DataInputStream inputStream ) throws KettleFileException, KettleEOFException,\n    SocketTimeoutException {\n    try {\n      // Is the value NULL?\n      if ( inputStream.readBoolean() ) {","sourceCodeStart":2762,"sourceCodeEnd":2798,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/row/value/ValueMetaBase.java#L2762-L2798","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Set storage type explicitly to ValueMetaInterface.STORAGE_TYPE_NORMAL (or the intended valid constant) before writing","Inspect getStorageType() in a debugger/log to find where the invalid constant is assigned","Ensure the Kettle version writing the data matches the version that created the metadata"],"exampleFix":"// before\nvalueMeta.writeData(outputStream, object); // storageType accidentally 99\n// after\nif (valueMeta.getStorageType() < ValueMetaInterface.STORAGE_TYPE_NORMAL\n    || valueMeta.getStorageType() > ValueMetaInterface.STORAGE_TYPE_INDEXED) {\n  valueMeta.setStorageType(ValueMetaInterface.STORAGE_TYPE_NORMAL);\n}\nvalueMeta.writeData(outputStream, object);","handlingStrategy":"validation","validationCode":"static void assertValidStorageType(ValueMetaInterface vmi) throws KettleFileException {\n  int st = vmi.getStorageType();\n  if (st != ValueMetaInterface.STORAGE_TYPE_NORMAL\n      && st != ValueMetaInterface.STORAGE_TYPE_BINARY_STRING\n      && st != ValueMetaInterface.STORAGE_TYPE_INDEXED) {\n    throw new KettleFileException(\"Invalid storage type \" + st + \" on field '\" + vmi.getName() + \"'\");\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  valueMeta.writeData(out, object);\n} catch (KettleFileException e) {\n  if (String.valueOf(e.getMessage()).contains(\"Unknown storage type\")) {\n    valueMeta.setStorageType(ValueMetaInterface.STORAGE_TYPE_NORMAL); // repair and retry\n  } else { throw e; }\n}","preventionTips":["Never assign raw integer constants to storage type; use ValueMetaInterface.STORAGE_TYPE_* constants","Validate metadata read from files/DB before using it for serialization","Keep writer and reader Kettle versions aligned across the pipeline"],"tags":["kettle","pdi","serialization","storage-type","binary-protocol"],"backgroundTag":"unsupported-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"}