{"record":{"id":"9ff6b2eaf29048e5","repo":"pentaho/pentaho-kettle","slug":"the-shared-objects-metadata-store-doesn-t-support-deleting","errorCode":null,"errorMessage":"The shared objects metadata store doesn't support deleting namespaces","messagePattern":"The shared objects metadata store doesn't support deleting namespaces","errorType":"exception","errorClass":"MetaStoreException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/shared/SharedObjectsMetaStore.java","lineNumber":62,"sourceCode":"  public SharedObjectsMetaStore( SharedObjects sharedObjects ) throws MetaStoreException {\n    this.sharedObjects = sharedObjects;\n\n    this.databaseElementType = DatabaseMetaStoreUtil.populateDatabaseElementType( this );\n  }\n\n  @Override\n  public List<String> getNamespaces() throws MetaStoreException {\n    return Arrays.asList( PentahoDefaults.NAMESPACE );\n  }\n\n  @Override\n  public void createNamespace( String namespace ) throws MetaStoreException, MetaStoreNamespaceExistsException {\n    throw new MetaStoreException( \"The shared objects metadata store doesn't support creating namespaces\" );\n  }\n\n  @Override\n  public void deleteNamespace( String namespace ) throws MetaStoreException, MetaStoreDependenciesExistsException {\n    throw new MetaStoreException( \"The shared objects metadata store doesn't support deleting namespaces\" );\n  }\n\n  @Override\n  public boolean namespaceExists( String namespace ) throws MetaStoreException {\n    return getNamespaces().indexOf( namespace ) >= 0;\n  }\n\n  @Override\n  public List<IMetaStoreElementType> getElementTypes( String namespace ) throws MetaStoreException {\n    return Arrays.asList( databaseElementType );\n  }\n\n  @Override\n  public List<String> getElementTypeIds( String namespace ) throws MetaStoreException {\n    return Arrays.asList( databaseElementType.getId() );\n  }\n\n  @Override","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/shared/SharedObjectsMetaStore.java#L44-L80","documentation":"SharedObjectsMetaStore.deleteNamespace() always throws MetaStoreException because the single shared-objects namespace cannot be removed. Deleting it would destroy the store's only namespace, so the operation is deliberately unsupported.","triggerScenarios":"Any call to SharedObjectsMetaStore.deleteNamespace(namespace), regardless of the namespace argument.","commonSituations":"Cleanup code that iterates all namespaces and deletes them; generic metastore teardown in tests or migration scripts applied to the shared-objects metastore.","solutions":["Do not call deleteNamespace on SharedObjectsMetaStore","Guard with namespaceExists/instanceof checks and skip deletion for this metastore type","To remove shared objects, delete them individually via deleteElement or edit the shared objects file directly","Use a different IMetaStore implementation if namespace lifecycle management is required"],"exampleFix":"// before\nmetaStore.deleteNamespace( ns );\n// after\nif ( !( metaStore instanceof SharedObjectsMetaStore ) ) {\n  metaStore.deleteNamespace( ns );\n}","handlingStrategy":"validation","validationCode":"if ( metaStore instanceof SharedObjectsMetaStore ) {\n  throw new UnsupportedOperationException( \"deleteNamespace is not supported here\" );\n}","typeGuard":"boolean supportsNamespaceDeletion = !( metaStore instanceof SharedObjectsMetaStore );","tryCatchPattern":"try {\n  metaStore.deleteNamespace( ns );\n} catch ( MetaStoreException e ) {\n  logger.warn( \"Namespace {} could not be deleted (read-only metastore)\", ns );\n}","preventionTips":["Never iterate-and-delete namespaces generically without checking metastore capabilities","Treat SharedObjectsMetaStore as read-only at the namespace level","Perform metastore teardown only for metastores you created"],"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"}