{"record":{"id":"8f26375cf972caef","repo":"pentaho/pentaho-kettle","slug":"storing-elements-with-element-type-name-is-not-supported-in","errorCode":null,"errorMessage":"Storing elements with element type name '{}' is not supported in the shared objects meta store","messagePattern":"Storing elements with element type name '(.+?)' is not supported in the shared objects meta store","errorType":"exception","errorClass":"MetaStoreException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/shared/SharedObjectsMetaStore.java","lineNumber":173,"sourceCode":"  }\n\n  @Override\n  public void createElement( String namespace, IMetaStoreElementType elementType, IMetaStoreElement element ) throws MetaStoreException, MetaStoreElementExistException {\n    try {\n      IMetaStoreElement exists = getElementByName( namespace, elementType, element.getId() );\n      if ( exists != null ) {\n        throw new MetaStoreException( \"The shared objects meta store already contains an element with type name '\"\n          + elementType.getName() + \"' and element name '\" + element.getName() );\n      }\n\n      if ( elementType.getName().equals( databaseElementType.getName() ) ) {\n        // convert the element to DatabaseMeta and store it in the shared objects file, then save the file\n        //\n        sharedObjects.storeObject( DatabaseMetaStoreUtil.loadDatabaseMetaFromDatabaseElement( this, element ) );\n        sharedObjects.saveToFile();\n        return;\n      }\n      throw new MetaStoreException( \"Storing elements with element type name '\"\n        + elementType.getName() + \"' is not supported in the shared objects meta store\" );\n    } catch ( Exception e ) {\n      throw new MetaStoreException( \"Unexpected error creating an element in the shared objects meta store\", e );\n    }\n  }\n\n  @Override\n  public void deleteElement( String namespace, IMetaStoreElementType elementType, String elementId ) throws MetaStoreException {\n    try {\n      if ( elementType.getName().equals( databaseElementType.getName() ) ) {\n        sharedObjects.removeObject( DatabaseMetaStoreUtil.loadDatabaseMetaFromDatabaseElement( this, getElement(\n          namespace, elementType, elementId ) ) );\n        sharedObjects.saveToFile();\n        return;\n      }\n    } catch ( Exception e ) {\n      throw new MetaStoreException( \"Unexpected error deleting an element in the shared objects meta store\", e );\n    }","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/shared/SharedObjectsMetaStore.java#L155-L191","documentation":"The shared-objects metastore can only persist elements whose element type maps to a known shared object type (currently DatabaseMeta). createElement() throws MetaStoreException for any other element type name because there is no backing storage for it.","triggerScenarios":"Calling createElement with an elementType whose name is not the built-in database type, e.g. custom or governance element types.","commonSituations":"Storing PartitionSchemas, ClusterSchemas, or custom plugin metadata via the shared-objects metastore; porting code from a full metastore that supported arbitrary types.","solutions":["Only store DatabaseMeta-type elements in this metastore","Use MemoryMetaStore or a database-backed metastore for other element types","Extend the metastore by adding another element-type branch (like databaseElementType) if you own the code"],"exampleFix":"// before\nmetaStore.createElement( ns, customType, element ); // throws\n// after\nif ( metaStore instanceof SharedObjectsMetaStore && !\"Database\".equals( customType.getName() ) ) {\n  throw new IllegalArgumentException( \"Use a writable metastore for type \" + customType.getName() );\n}","handlingStrategy":"validation","validationCode":"boolean isDatabaseType = \"Database\".equals( elementType.getName() );\nif ( metaStore instanceof SharedObjectsMetaStore && !isDatabaseType ) {\n  throw new IllegalArgumentException( \"SharedObjectsMetaStore only stores Database-type elements\" );\n}","typeGuard":"boolean canStoreInSharedObjects = metaStore instanceof SharedObjectsMetaStore\n  && \"Database\".equals( elementType.getName() );","tryCatchPattern":"try {\n  metaStore.createElement( ns, type, element );\n} catch ( MetaStoreException e ) {\n  if ( e.getMessage() != null && e.getMessage().contains( \"not supported\" ) ) {\n    fallbackMetaStore.createElement( ns, type, element );\n  } else { throw e; }\n}","preventionTips":["Restrict shared-objects metastore usage to database connection metadata","Keep a MemoryMetaStore or DB metastore as the target for other element types","Check elementType.getName() before choosing the metastore"],"tags":["metastore","unsupported-operation","pdi"],"backgroundTag":"unsupported-operation","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"}