pentaho/pentaho-kettle · error · KettleException

Unable to delete database with name [name]

Error message

Unable to delete database with name [name]

What it means

Repository failure in PurRepository.deleteDatabaseMeta: the database connection file could not be located or deleted (lookup via getPath returned null or the delete call failed). The message includes the database name and wraps the underlying exception.

Solutions

  1. Verify the repository user has delete permission on the shared databases area.
  2. Confirm the DatabaseMeta still exists (getDatabaseIDs/getDatabaseNames) before deleting.
  3. Retry after resolving file locks or versioning checkout state.
  4. Catch KettleException and surface the cause to the user instead of failing silently.

Example fix

// before
repository.deleteDatabaseMeta(meta.getName());
// after
try {
  repository.deleteDatabaseMeta(meta.getName());
} catch (KettleException e) {
  logError("Could not delete connection: " + e.getCause(), e);
}
Defensive patterns

Strategy: try-catch

Validate before calling

// check existence before delete
boolean exists = repository.getDatabaseNames(false) contains meta.getName();

Type guard

boolean deletable = name -> name != null && repositoryExists(name);

Try / catch

try { repository.deleteDatabaseMeta(name); } catch (KettleException e) { log.error("delete failed: " + e.getCause(), e); }

Prevention

When it happens

Trigger: Calling deleteDatabaseMeta(String) when the repository cannot delete the file — permission denied, file locked/checked out, or the connection doesn't resolve to an existing repository file.

Common situations: Users lacking delete rights on /etc/databases; the database was already deleted in another session; ETC folder write lock held by versioning.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/065802dc56888a7f. Report an issue: GitHub.

Appendix: source

Thrown at plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java:1522

  }

  @Override
  public void deleteDatabaseMeta( final String databaseName ) throws KettleException {
    RepositoryFile fileToDelete = null;
    ObjectId idDatabase = null;

    try {
      readWriteLock.writeLock().lock();
      try {
        fileToDelete = pur.getFile( getPath( databaseName, null, RepositoryObjectType.DATABASE ) );
        idDatabase = new StringObjectId( fileToDelete.getId().toString() );
        permanentlyDeleteSharedObject( idDatabase );
        removeFromSharedObjectCache( RepositoryObjectType.DATABASE, idDatabase );
      } finally {
        readWriteLock.writeLock().unlock();
      }
    } catch ( Exception e ) {
      throw new KettleException( "Unable to delete database with name [" + databaseName + "]", e );
    }
  }

  @Override
  public long getJobEntryAttributeInteger( ObjectId idJobentry, int nr, String code ) throws KettleException {
    // implemented by RepositoryProxy
    throw new UnsupportedOperationException();
  }

  @Override
  public String getJobEntryAttributeString( ObjectId idJobentry, int nr, String code ) throws KettleException {
    // implemented by RepositoryProxy
    throw new UnsupportedOperationException();
  }

  @Override
  public boolean getJobEntryAttributeBoolean( ObjectId arg0, int arg1, String arg2, boolean arg3 )
    throws KettleException {

View on GitHub (pinned to f3058517a1)