{"record":{"id":"8a3e9add069d2c74","repo":"pentaho/pentaho-kettle","slug":"unknown-storage-type","errorCode":null,"errorMessage":" : Unknown storage type ","messagePattern":" : Unknown storage type ","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/row/value/ValueMetaBase.java","lineNumber":3394,"sourceCode":"\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            string = XMLHandler.addTagValue( \"binary-string\", (byte[]) object );\n            xml.append( XMLHandler.openTag( XML_DATA_TAG ) ).append( string ).append( XMLHandler.closeTag( XML_DATA_TAG ) );\n            return xml.toString();\n\n          case STORAGE_TYPE_INDEXED:\n            // Just an index\n            string = XMLHandler.addTagValue( \"index-value\", (Integer) object );\n            break;\n\n          default:\n            throw new IOException( toString() + \" : Unknown storage type \" + getStorageType() );\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() + \"]\", e );\n      } catch ( Exception e ) {\n        throw new RuntimeException( toString() + \" : there was a value XML encoding error\", e );\n      }\n    } else {\n      // If the object is null: give an empty string\n      //\n      string = \"\";\n    }\n    xml.append( XMLHandler.addTagValue( XML_DATA_TAG, string ) );\n\n    return xml.toString();\n  }\n","sourceCodeStart":3376,"sourceCodeEnd":3412,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/row/value/ValueMetaBase.java#L3376-L3412","documentation":"In ValueMetaBase.getXML, after mapping the data type, the storage type of the data object is mapped (NORMAL, BINARY_STRING, INDEXED). If getStorageType() returns an unrecognized value, an IOException with this message is thrown. It means the value meta carries a storage type that has no XML serialization rule.","triggerScenarios":"Calling getMetaXML()/getXML() on a value meta whose storageType int is outside {STORAGE_TYPE_NORMAL, STORAGE_TYPE_BINARY_STRING, STORAGE_TYPE_INDEXED} — e.g. corrupted metadata, hand-edited XML, or a custom storage type added by a plugin the core writer does not handle.","commonSituations":"Manually edited transformation .ktr XML with an out-of-range storage-type attribute; plugin-defined storage types; metadata read from a stream written by an incompatible Kettle version.","solutions":["Set the storage type explicitly to one of STORAGE_TYPE_NORMAL, STORAGE_TYPE_BINARY_STRING or STORAGE_TYPE_INDEXED before serializing.","Validate/repair the metadata source (XML or stream) that contains the out-of-range storage type value.","Remove or replace plugin-defined storage types with core storage types, or upgrade the plugin/engine to matching versions.","Recreate the field metadata in Spoon to guarantee a valid storage type."],"exampleFix":"// before: storageType left at an invalid value\nvm.setStorageType(99);\n// after\nvm.setStorageType(ValueMetaInterface.STORAGE_TYPE_NORMAL);","handlingStrategy":"validation","validationCode":"int st = vm.getStorageType();\nif (st != STORAGE_TYPE_NORMAL && st != STORAGE_TYPE_BINARY_STRING && st != STORAGE_TYPE_INDEXED) {\n  logError(\"Invalid storage type \" + st + \" on \" + vm.getName());\n  vm.setStorageType(STORAGE_TYPE_NORMAL);\n}","typeGuard":"boolean hasKnownStorageType(ValueMetaInterface vm) {\n  int st = vm.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  String xml = valueMeta.getXML();\n} catch (IOException e) {\n  if (e.getMessage().contains(\"Unknown storage type\")) {\n    valueMeta.setStorageType(ValueMetaInterface.STORAGE_TYPE_NORMAL);\n    // retry serialization\n  } else {\n    throw e;\n  }\n}","preventionTips":["Set storage types only via the STORAGE_TYPE_* constants, never raw ints.","Validate metadata XML after manual edits with an XSD/schema check.","Avoid plugins that introduce custom storage types without core support."],"tags":["xml","serialization","storage-type","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"}