{"record":{"id":"1a5e3221dd0f4a04","repo":"pentaho/pentaho-kettle","slug":"the-shared-objects-metadata-store-doesn-t-support-creating","errorCode":null,"errorMessage":"The shared objects metadata store doesn't support creating namespaces","messagePattern":"The shared objects metadata store doesn't support creating namespaces","errorType":"exception","errorClass":"MetaStoreException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/shared/SharedObjectsMetaStore.java","lineNumber":57,"sourceCode":"\n  protected IMetaStoreElementType databaseElementType;\n\n  protected SharedObjects sharedObjects;\n\n  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","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/shared/SharedObjectsMetaStore.java#L39-L75","documentation":"SharedObjectsMetaStore is a read-mostly MetadataStore backed by a fixed shared-objects namespace (PentahoDefaults.NAMESPACE). It intentionally does not allow creating additional namespaces, so createNamespace() always throws MetaStoreException. The store exposes exactly one namespace, no matter what the caller requests.","triggerScenarios":"Any call to SharedObjectsMetaStore.createNamespace(\"any-name\"), e.g. when generic metastore tooling tries to provision a namespace before writing elements.","commonSituations":"Code written against a generic IMetaStore interface that works with MemoryMetaStore or default PentahoMetaStore, then pointed at the shared-objects metastore; test harnesses that create namespaces upfront.","solutions":["Do not call createNamespace; use the existing PentahoDefaults.NAMESPACE directly","Check namespaceExists() before writing and skip creation if using the shared-objects metastore","Switch to a writable metastore (e.g. MemoryMetaStore for tests or a database-backed metastore) if multiple namespaces are required"],"exampleFix":"// before\nif ( !metaStore.namespaceExists( ns ) ) metaStore.createNamespace( ns );\n// after\nif ( metaStore instanceof SharedObjectsMetaStore ) {\n  ns = PentahoDefaults.NAMESPACE; // creation unsupported\n} else if ( !metaStore.namespaceExists( ns ) ) {\n  metaStore.createNamespace( ns );\n}","handlingStrategy":"validation","validationCode":"if ( metaStore instanceof SharedObjectsMetaStore ) {\n  namespace = PentahoDefaults.NAMESPACE; // skip createNamespace\n}\nif ( !metaStore.namespaceExists( namespace ) ) {\n  metaStore.createNamespace( namespace );\n}","typeGuard":"boolean supportsNamespaceCreation = !( metaStore instanceof SharedObjectsMetaStore );","tryCatchPattern":"try {\n  metaStore.createNamespace( ns );\n} catch ( MetaStoreException e ) {\n  logger.debug( \"Namespace creation unsupported; using existing namespace {}\", ns );\n}","preventionTips":["Use namespaceExists() before createNamespace","Check the metastore implementation type before namespace operations","Reserve SharedObjectsMetaStore for the default Pentaho namespace only"],"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"}