pentaho/pentaho-kettle · error · MetaStoreException
Unable to find metastore '
Error message
Unable to find metastore '
What it means
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.
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.
Example fix
// before
IMetaStore metaStore = findMetaStore( metaStoreName );
if ( metaStore == null ) { throw new MetaStoreException( "Unable to find metastore '" + metaStoreName + "'" ); }
// after
IMetaStore metaStore = findMetaStore( metaStoreName );
if ( metaStore == null ) {
refreshView(); // re-sync the tree and abort quietly
return;
} Defensive patterns
Strategy: validation
Validate before calling
// before calling removeElement, confirm the store is discoverable:
IMetaStore found = findMetaStore(metaStoreName);
if (found == null) {
// refresh explorer or re-register the metastore before attempting removal
} Type guard
static boolean metastoreExists(String name, List<IMetaStore> stores) {
return stores != null && stores.stream().anyMatch(s -> name.equals(s.getName()));
} Try / catch
try {
removeElement(metaStoreName, namespace, typeName, elementName);
} catch (MetaStoreException e) {
if (e.getMessage().startsWith("Unable to find metastore")) {
refreshView(); // stale UI state
}
} Prevention
- Refresh the explorer after changing metastore configuration.
- Ensure metastore plugins are registered at Spoon startup.
- Do not keep explorer dialogs open across metastore reconfigurations.
When it happens
Trigger: 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.
Common situations: Metastore plugin not registered or failing to load at Spoon startup; metastore name changed between sessions; stale explorer dialog left open across metastore reconfigurations.
Understand the failure class
Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.
Related errors
- Unable to find element type
- AccessInputMeta.Exception.FileDoesNotExist
- AccessOutputMeta.Exception.FileDoesNotExist
- Storing elements with element type name
- The shared objects meta store already contains an element…
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/6294bbd75281a863.
Report an issue: GitHub.
Appendix: source
Thrown at ui/src/main/java/org/pentaho/di/ui/spoon/dialog/MetaStoreExplorerDialog.java:215
}
} );
BaseStepDialog.setSize( shell );
shell.open();
while ( !shell.isDisposed() ) {
if ( !display.readAndDispatch() ) {
display.sleep();
}
}
}
private void removeElement( String metaStoreName, String namespace, String elementTypeName, String elementName ) {
try {
IMetaStore metaStore = findMetaStore( metaStoreName );
if ( metaStore == null ) {
throw new MetaStoreException( "Unable to find metastore '" + metaStoreName + "'" );
}
IMetaStoreElementType elementType = metaStore.getElementTypeByName( namespace, elementTypeName );
if ( elementType == null ) {
throw new MetaStoreException( "Unable to find element type '"
+ elementTypeName + "' from metastore '" + metaStoreName + "' in namespace '" + namespace + "'" );
}
IMetaStoreElement element = metaStore.getElementByName( namespace, elementType, elementName );
if ( element == null ) {
throw new MetaStoreException( "Unable to find element '"
+ elementName + "' of type '" + elementTypeName + "' from metastore '" + metaStoreName
+ "' in namespace '" + namespace + "'" );
}
metaStore.deleteElement( namespace, elementType, element.getId() );
refreshTree();
} catch ( MetaStoreException e ) {
new ErrorDialog( shell, "Error removing element", "There was an error removing the element '"View on GitHub (pinned to f3058517a1)