pentaho/pentaho-kettle · error · KettleException

Unable to delete database with name [ + name + ] and…

Error message

Unable to delete database with name [ + name + ] and extension [ + extension + ]

What it means

deleteRootObject() deletes a repository object file (name + extension) directly under the repository root. If the VFS delete operation fails for any reason, a KettleException naming the object and extension is thrown with the original cause chained.

Solutions

  1. Check the chained cause: 'does not exist' means the file is already gone — refresh repository metadata or ignore.
  2. Verify the file repo root directory setting matches where the object files actually live.
  3. Close other processes holding locks on the file and retry.
  4. Grant the process delete permission on the repository directory.

Example fix

// before: fails when file already removed
repo.deleteRootObject(name, extension);

// after: tolerate already-deleted objects
try {
  repo.deleteRootObject(name, extension);
} catch (KettleException e) {
  if (!e.getCause().toString().contains("does not exist")) throw e;
  log.warn("Already deleted: " + name);
}
Defensive patterns

Strategy: try-catch

Validate before calling

// confirm the object file exists before deleting
File f = new File(repoBaseDir, name + extension);
boolean exists = f.exists();

Try / catch

try {
  repo.deleteRootObject(name, extension);
} catch (KettleException e) {
  if (e.getCause() != null && String.valueOf(e.getCause()).contains("does not exist")) {
    log.warn("Already deleted: " + name); // idempotent-delete tolerated
  } else { throw e; }
}

Prevention

When it happens

Trigger: Calling deleteRootObject(name, extension) (used by deleteDatabaseMeta and similar) when the target file does not exist as a FileObject that can be deleted, the path is wrong, or the file is locked/permission-protected.

Common situations: Deleting a database connection from a file repository where the .kdb file was manually moved/renamed; file locked by another process; read-only filesystem or insufficient permissions; stale repository references to removed files.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/repository/filerep/KettleFileRepository.java:449

  @Override
  public void deleteSlave( ObjectId id_slave ) throws KettleException {
    // ID and filename are the same
    deleteFile( calcDirectoryName( null ) + id_slave.getId() );
  }

  @Override
  public void deleteDatabaseMeta( String databaseName ) throws KettleException {
    deleteRootObject( databaseName, EXT_DATABASE );
  }

  public void deleteRootObject( String name, String extension ) throws KettleException {
    try {
      String filename = calcDirectoryName( null ) + name + extension;
      FileObject fileObject = KettleVFS.getInstance( DefaultBowl.getInstance() ).getFileObject( filename );
      fileObject.delete();
    } catch ( Exception e ) {
      throw new KettleException( "Unable to delete database with name ["
        + name + "] and extension [" + extension + "]", e );
    }
  }

  public void deleteFile( String filename ) throws KettleException {
    try {
      FileObject fileObject = KettleVFS.getInstance( DefaultBowl.getInstance() ).getFileObject( filename );
      fileObject.delete();
    } catch ( Exception e ) {
      throw new KettleException( "Unable to delete file with name [" + filename + "]", e );
    }
  }

  @Override
  public ObjectId getClusterID( String name ) throws KettleException {
    // The ID is the filename relative to the base directory, including the file extension
    //
    return new StringObjectId( calcObjectId( (RepositoryDirectory) null ) + name + EXT_SLAVE_SERVER );

View on GitHub (pinned to f3058517a1)