{"record":{"id":"6294bbd75281a863","repo":"pentaho/pentaho-kettle","slug":"unable-to-find-metastore","errorCode":null,"errorMessage":"Unable to find metastore '","messagePattern":"Unable to find metastore '","errorType":"exception","errorClass":"MetaStoreException","httpStatus":null,"severity":"error","filePath":"ui/src/main/java/org/pentaho/di/ui/spoon/dialog/MetaStoreExplorerDialog.java","lineNumber":215,"sourceCode":"      }\n    } );\n\n    BaseStepDialog.setSize( shell );\n\n    shell.open();\n    while ( !shell.isDisposed() ) {\n      if ( !display.readAndDispatch() ) {\n        display.sleep();\n      }\n    }\n  }\n\n  private void removeElement( String metaStoreName, String namespace, String elementTypeName, String elementName ) {\n\n    try {\n      IMetaStore metaStore = findMetaStore( metaStoreName );\n      if ( metaStore == null ) {\n        throw new MetaStoreException( \"Unable to find metastore '\" + metaStoreName + \"'\" );\n      }\n      IMetaStoreElementType elementType = metaStore.getElementTypeByName( namespace, elementTypeName );\n      if ( elementType == null ) {\n        throw new MetaStoreException( \"Unable to find element type '\"\n          + elementTypeName + \"' from metastore '\" + metaStoreName + \"' in namespace '\" + namespace + \"'\" );\n      }\n      IMetaStoreElement element = metaStore.getElementByName( namespace, elementType, elementName );\n      if ( element == null ) {\n        throw new MetaStoreException( \"Unable to find element '\"\n          + elementName + \"' of type '\" + elementTypeName + \"' from metastore '\" + metaStoreName\n          + \"' in namespace '\" + namespace + \"'\" );\n      }\n      metaStore.deleteElement( namespace, elementType, element.getId() );\n\n      refreshTree();\n\n    } catch ( MetaStoreException e ) {\n      new ErrorDialog( shell, \"Error removing element\", \"There was an error removing the element '\"","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/ui/src/main/java/org/pentaho/di/ui/spoon/dialog/MetaStoreExplorerDialog.java#L197-L233","documentation":"MetaStoreExplorerDialog.removeElement looks up the metastore by name via findMetaStore() before deleting an element; if no metastore with that name exists it throws MetaStoreException \"Unable to find metastore '<name>'\". This guards removal operations against acting on a nonexistent store.","triggerScenarios":"Right-click > Delete on an element in the Metastore Explorer after the underlying metastore was removed, renamed, or failed to initialize, so findMetaStore() returns null.","commonSituations":"Metastore plugin not registered or failing to load at Spoon startup; metastore name changed between sessions; stale explorer dialog left open across metastore reconfigurations.","solutions":["Refresh the Metastore Explorer so the tree reflects currently registered metastores.","Verify the metastore is registered at startup (kettle.properties / metastore bootstrap configuration).","Restart Spoon so metastore plugins re-initialize, then retry removal.","If the store truly no longer exists, refresh instead of deleting; the element is already gone."],"exampleFix":"// before\nIMetaStore metaStore = findMetaStore( metaStoreName );\nif ( metaStore == null ) { throw new MetaStoreException( \"Unable to find metastore '\" + metaStoreName + \"'\" ); }\n// after\nIMetaStore metaStore = findMetaStore( metaStoreName );\nif ( metaStore == null ) {\n  refreshView(); // re-sync the tree and abort quietly\n  return;\n}","handlingStrategy":"validation","validationCode":"// before calling removeElement, confirm the store is discoverable:\nIMetaStore found = findMetaStore(metaStoreName);\nif (found == null) {\n  // refresh explorer or re-register the metastore before attempting removal\n}","typeGuard":"static boolean metastoreExists(String name, List<IMetaStore> stores) {\n  return stores != null && stores.stream().anyMatch(s -> name.equals(s.getName()));\n}","tryCatchPattern":"try {\n  removeElement(metaStoreName, namespace, typeName, elementName);\n} catch (MetaStoreException e) {\n  if (e.getMessage().startsWith(\"Unable to find metastore\")) {\n    refreshView(); // stale UI state\n  }\n}","preventionTips":["Refresh the explorer after changing metastore configuration.","Ensure metastore plugins are registered at Spoon startup.","Do not keep explorer dialogs open across metastore reconfigurations."],"tags":["metastore","pdi","resource-not-found","ui"],"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"}