{"record":{"id":"6cb28fa5a307b831","repo":"pentaho/pentaho-kettle","slug":"namespace-namespace-doesn-t-exist-in-the-repository","errorCode":null,"errorMessage":"Namespace '${namespace} doesn't exist in the repository","messagePattern":"Namespace '(.+?) doesn't exist in the repository","errorType":"exception","errorClass":"MetaStoreException","httpStatus":null,"severity":"error","filePath":"plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/metastore/PurRepositoryMetaStore.java","lineNumber":494,"sourceCode":"\n      // Backwards Compatibility\n      if ( dataProperty.getName().equals( dataNode.getName() ) ) {\n        attribute.setValue( value );\n      }\n      attribute.addChild( newAttribute( dataProperty.getName(), value ) );\n    }\n\n    for ( DataNode subNode : dataNode.getNodes() ) {\n      IMetaStoreAttribute subAttr = newAttribute( subNode.getName(), null );\n      dataNodeToAttribute( subNode, subAttr );\n      attribute.addChild( subAttr );\n    }\n  }\n\n  protected RepositoryFile validateNamespace( String namespace ) throws MetaStoreException {\n    RepositoryFile namespaceFile = getNamespaceRepositoryFile( namespace );\n    if ( namespaceFile == null ) {\n      throw new MetaStoreException( \"Namespace '\" + namespace + \" doesn't exist in the repository\" );\n    }\n    return namespaceFile;\n  }\n\n  protected RepositoryFile validateElementTypeRepositoryFolder( String namespace, IMetaStoreElementType elementType )\n    throws MetaStoreException {\n    // The element type needs to be known in this repository, we need to have a match by ID\n    //\n    RepositoryFile elementTypeFolder = pur.getFileById( elementType.getId() );\n    if ( elementTypeFolder == null ) {\n      StringBuilder builder = new StringBuilder();\n      builder.append( namespacesFolder.getPath() ).append( Const.CR );\n      String available = getMetaStoreFolders( builder, namespacesFolder, 0 );\n      throw new MetaStoreException( \"The element type with name '\" + elementType.getName()\n          + \" doesn't exist in namespace '\" + namespace + \"'.\" + Const.CR + \"Available nodes:\" + Const.CR + available );\n    }\n    return elementTypeFolder;\n  }","sourceCodeStart":476,"sourceCodeEnd":512,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/metastore/PurRepositoryMetaStore.java#L476-L512","documentation":"validateNamespace resolves the folder file representing the given namespace in the PUR repository. When getNamespaceRepositoryFile(namespace) returns null, the namespace does not exist as a folder in the repository, and a MetaStoreException is thrown. It is used by namespaceFile/namespaceRepositoryFile to fail fast on operations targeting an unknown namespace.","triggerScenarios":"Calling operations like validateNamespace (via namespaceFile / namespaceRepositoryFile) with a namespace string whose folder does not exist under /etc/metastore in the repository — e.g., a typo, an un-created namespace, or a namespace from a different repository.","commonSituations":"Typo or case mismatch in the namespace name; assuming namespaces are auto-created when they must be created explicitly via createNamespace; pointing code at a fresh/empty repository that never had the namespace created.","solutions":["Call metaStore.createNamespace(namespace) before performing operations on a namespace that may not exist.","Verify the name with metaStore.getNamespaces() / namespaceExists(namespace) before use.","Check spelling and case of the namespace string.","Confirm you are connected to the repository that actually contains the namespace."],"exampleFix":"// before\nmetaStore.validateNamespace(namespace); // throws if missing\n// after\nif (!metaStore.getNamespaces().stream().anyMatch(n -> n.getName().equals(namespace))) {\n  metaStore.createNamespace(namespace);\n}","handlingStrategy":"validation","validationCode":"boolean exists = metaStore.getNamespaces().stream()\n  .anyMatch(n -> n.getName().equals(namespace));\nif (!exists) metaStore.createNamespace(namespace);","typeGuard":null,"tryCatchPattern":"try { validateNamespace(namespace); }\ncatch (MetaStoreException e) { metaStore.createNamespace(namespace); }","preventionTips":["Create namespaces explicitly before use","Validate namespace spelling/case against getNamespaces()"],"tags":["metastore","namespace","pentaho","repository"],"backgroundTag":"entity-not-found","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"}