pentaho/pentaho-kettle · error · MetaStoreDependenciesExistsException
Namespace ' can not be deleted because it is not empty
Error message
Namespace '${namespace} can not be deleted because it is not empty What it means
Thrown by PurRepositoryMetaStore.deleteNamespace() when the namespace folder still contains children (element types or elements), so deleting it would orphan dependencies. It is a MetaStoreDependenciesExistsException carrying the ids of the blocking children.
Solutions
- Delete all element types and elements in the namespace first
- Inspect the child ids from MetaStoreDependenciesExistsException to find blockers
- Use the server UI to inspect and remove leftover folders under /etc/metastore/<ns>
Example fix
// before
metaStore.deleteNamespace( ns );
// after
for ( String typeId : metaStore.getElementTypeNames( ns ) ) {
metaStore.deleteElementType( ns, metaStore.getElementTypeByName( ns, typeId ) );
}
metaStore.deleteNamespace( ns ); Defensive patterns
Strategy: validation
Validate before calling
if ( metaStore.getElementTypeNames( namespace ).length > 0 ) {
throw new IllegalStateException( "Namespace not empty; delete types first" );
} Try / catch
try { metaStore.deleteNamespace( ns ); } catch ( MetaStoreDependenciesExistsException e ) { logError( "Blocked by child ids: " + e.getDependencies(), e ); } Prevention
- Empty the namespace before deleting it
- Use the exception's dependency ids to find blockers
- Inspect /etc/metastore on the server for hidden leftovers
When it happens
Trigger: Calling deleteNamespace(ns) while the namespace folder on the server still holds element-type folders or element files; hidden-file filtering doesn't empty the child list.
Common situations: Attempting a clean teardown of a namespace that still has element types; leftover server artifacts not visible in the PDI metastore explorer.
Understand the failure class
Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.
Related errors
- The namespace to delete, ''+namespace+'' is not empty
- The namespace to delete
- Can't delete element type with name
- Namespace ' ' can not be created, it already exists
- Namespace ' ' doesn't exist.
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/8f6954b07ef4399d.
Report an issue: GitHub.
Appendix: source
Thrown at plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/metastore/PurRepositoryMetaStore.java:125
@Override
public void deleteNamespace( String namespace ) throws MetaStoreException {
RepositoryFile namespaceFile = getNamespaceRepositoryFile( namespace );
if ( namespaceFile == null ) {
return; // already gone.
}
List<RepositoryFile> children = getChildren( namespaceFile.getId() );
if ( children == null || children.isEmpty() ) {
// Delete the file, there are no children.
//
pur.deleteFile( namespaceFile.getId(), true, "Delete namespace" );
} else {
// Dependencies exists, throw an exception.
//
List<String> elementTypeIds = new ArrayList<String>();
for ( RepositoryFile child : children ) {
elementTypeIds.add( child.getId().toString() );
}
throw new MetaStoreDependenciesExistsException( elementTypeIds, "Namespace '" + namespace
+ " can not be deleted because it is not empty" );
}
}
@Override
public List<String> getNamespaces() throws MetaStoreException {
List<String> namespaces = new ArrayList<String>();
List<RepositoryFile> children = getChildren( namespacesFolder.getId() );
for ( RepositoryFile child : children ) {
namespaces.add( child.getName() );
}
return namespaces;
}
// The element types
@Override
public void createElementType( String namespace, IMetaStoreElementType elementType ) throws MetaStoreException {View on GitHub (pinned to f3058517a1)