{"record":{"id":"6677980f0541401c","repo":"pentaho/pentaho-kettle","slug":"the-shared-objects-metadata-store-doesn-t-support-updating","errorCode":null,"errorMessage":"The shared objects metadata store doesn't support updating element types","messagePattern":"The shared objects metadata store doesn't support updating element types","errorType":"exception","errorClass":"MetaStoreException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/shared/SharedObjectsMetaStore.java","lineNumber":106,"sourceCode":"  @Override\n  public IMetaStoreElementType getElementTypeByName( String namespace, String elementTypeName ) throws MetaStoreException {\n    for ( IMetaStoreElementType elementType : getElementTypes( namespace ) ) {\n      if ( elementType.getName() != null && elementType.getName().equalsIgnoreCase( elementTypeName ) ) {\n        return elementType;\n      }\n    }\n    return null;\n  }\n\n  @Override\n  public void createElementType( String namespace, IMetaStoreElementType elementType ) throws MetaStoreException,\n    MetaStoreElementTypeExistsException {\n    throw new MetaStoreException( \"The shared objects metadata store doesn't support creating new element types\" );\n  }\n\n  @Override\n  public void updateElementType( String namespace, IMetaStoreElementType elementType ) throws MetaStoreException {\n    throw new MetaStoreException( \"The shared objects metadata store doesn't support updating element types\" );\n  }\n\n  @Override\n  public void deleteElementType( String namespace, IMetaStoreElementType elementType ) throws MetaStoreException,\n    MetaStoreDependenciesExistsException {\n    throw new MetaStoreException( \"The shared objects metadata store doesn't support deleting element types\" );\n  }\n\n  @Override\n  public List<IMetaStoreElement> getElements( String namespace, IMetaStoreElementType elementType ) throws MetaStoreException {\n    List<IMetaStoreElement> list = new ArrayList<IMetaStoreElement>();\n    for ( SharedObjectInterface sharedObject : sharedObjects.getObjectsMap().values() ) {\n      // The databases...\n      //\n      if ( sharedObject instanceof DatabaseMeta && databaseElementType.getName().equals( elementType.getName() ) ) {\n        list.add( DatabaseMetaStoreUtil.populateDatabaseElement( this, (DatabaseMeta) sharedObject ) );\n      }\n    }","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/shared/SharedObjectsMetaStore.java#L88-L124","documentation":"Unsupported-operation sentinel in SharedObjectsMetaStore.updateElementType(): this read-only metadata store backs shared objects (database connections, clusters, slaves) loaded from XML files and explicitly rejects element-type mutation. Any attempt to update an element type hits this guard.","triggerScenarios":"Any call to SharedObjectsMetaStore.updateElementType(namespace, elementType), e.g. renaming or editing description of the built-in element type.","commonSituations":"Generic metastore editors or UI code that allow editing type metadata, applied to the shared-objects metastore.","solutions":["Treat element types from this metastore as immutable; do not call updateElementType","If a type's description must change, it must change in the underlying code/default, not at runtime","Use a different metastore implementation when mutable types are needed"],"exampleFix":"// before\nmetaStore.updateElementType( ns, type );\n// after\nif ( !( metaStore instanceof SharedObjectsMetaStore ) ) {\n  metaStore.updateElementType( ns, type );\n}","handlingStrategy":"validation","validationCode":"if ( metaStore instanceof SharedObjectsMetaStore ) {\n  throw new UnsupportedOperationException( \"Element types are immutable here\" );\n}","typeGuard":"boolean supportsTypeUpdate = !( metaStore instanceof SharedObjectsMetaStore );","tryCatchPattern":"try {\n  metaStore.updateElementType( ns, type );\n} catch ( MetaStoreException e ) {\n  logger.warn( \"Element type update unsupported in shared-objects metastore\" );\n}","preventionTips":["Never expose type-edit UI/actions for SharedObjectsMetaStore-backed stores","Copy type metadata changes to a writable metastore if edits are required","Check instanceof IMetaStore capabilities before edit operations"],"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"}