{"record":{"id":"5842e5f2798dfda0","repo":"pentaho/pentaho-kettle","slug":"unable-to-get-id-of-namespace-namespace","errorCode":null,"errorMessage":"Unable to get id of namespace 'namespace'","messagePattern":"Unable to get id of namespace 'namespace'","errorType":"exception","errorClass":"MetaStoreException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryMetaStoreDelegate.java","lineNumber":72,"sourceCode":"   * @return the ID of the namespace\n   * @throws KettleException\n   */\n  public synchronized LongObjectId getNamespaceId( String namespace ) throws KettleException {\n    return repository.connectionDelegate.getIDWithValue(\n      quoteTable( KettleDatabaseRepository.TABLE_R_NAMESPACE ),\n      quote( KettleDatabaseRepository.FIELD_NAMESPACE_ID_NAMESPACE ),\n      quote( KettleDatabaseRepository.FIELD_NAMESPACE_NAME ), namespace );\n  }\n\n  public ObjectId verifyNamespace( String namespace ) throws MetaStoreException {\n    try {\n      ObjectId namespaceId = getNamespaceId( namespace );\n      if ( namespaceId == null ) {\n        throw new MetaStoreException( \"Unable to find namespace with name '\" + namespace + \"'\" );\n      }\n      return namespaceId;\n    } catch ( KettleException e ) {\n      throw new MetaStoreException( \"Unable to get id of namespace '\" + namespace + \"'\", e );\n    }\n  }\n\n  public synchronized LongObjectId getElementTypeId( LongObjectId namespaceId, String elementTypeName ) throws KettleException {\n    return repository.connectionDelegate.getIDWithValue(\n      quoteTable( KettleDatabaseRepository.TABLE_R_ELEMENT_TYPE ),\n      quote( KettleDatabaseRepository.FIELD_ELEMENT_TYPE_ID_ELEMENT_TYPE ),\n      quote( KettleDatabaseRepository.FIELD_ELEMENT_TYPE_NAME ), elementTypeName,\n      new String[] { quote( KettleDatabaseRepository.FIELD_ELEMENT_TYPE_ID_NAMESPACE ), },\n      new ObjectId[] { namespaceId, } );\n  }\n\n  public synchronized LongObjectId getElementId( LongObjectId elementTypeId, String elementName ) throws KettleException {\n    return repository.connectionDelegate.getIDWithValue(\n      quoteTable( KettleDatabaseRepository.TABLE_R_ELEMENT ),\n      quote( KettleDatabaseRepository.FIELD_ELEMENT_ID_ELEMENT ),\n      quote( KettleDatabaseRepository.FIELD_ELEMENT_NAME ), elementName,\n      new String[] { quote( KettleDatabaseRepository.FIELD_ELEMENT_ID_ELEMENT_TYPE ), },","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryMetaStoreDelegate.java#L54-L90","documentation":"While resolving the namespace id inside verifyNamespace, an underlying KettleException occurred (database access via getNamespaceId); it is wrapped in a MetaStoreException \"Unable to get id of namespace '...'\" with the cause attached.","triggerScenarios":"getNamespaceId throws due to SQL failure on R_ELEMENT_NAMESPACE: connection error, missing table, schema mismatch.","commonSituations":"Metastore tables not installed in the repository database; DB connectivity failure; repository schema upgraded without the metastore extensions.","solutions":["Inspect the wrapped cause for the SQL error and fix connectivity/schema","Ensure the metastore tables (R_ELEMENT_NAMESPACE etc.) exist — run the repository install/upgrade scripts","Confirm the repository connection is healthy before metastore operations","Retry after transient DB failures"],"exampleFix":"try {\n  ObjectId nsId = delegate.verifyNamespace(\"myNamespace\");\n} catch (MetaStoreException e) {\n  logError(\"DB failure resolving namespace\", e.getCause());\n}","handlingStrategy":"try-catch","validationCode":"null","typeGuard":"null","tryCatchPattern":"try { delegate.verifyNamespace(ns); } catch (MetaStoreException e) { logError(\"Metastore DB failure\", e.getCause()); }","preventionTips":["Install metastore tables as part of repository provisioning","Check DB connectivity before metastore batch operations","Keep repository and metastore schemas in version lockstep"],"tags":["metastore","namespace","database","sql"],"backgroundTag":"database-query-failed","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"}