pentaho/pentaho-kettle · error · KettleException

Unable to rename object with ID [ + id + ] to [ + newName +…

Error message

Unable to rename object with ID [ + id + ] to [ + newName + ]

What it means

KettleFileRepository.renameRepositoryObject() throws this KettleException when the underlying file move fails during a rename of a repository object (transformation, job, etc.). It wraps the VFS/IO exception thrown by fileObject.moveTo(newObject).

Solutions

  1. Confirm the source file for the ObjectId still exists on disk
  2. Check that no file with the target name already exists in the target directory
  3. Ensure the repository is not opened read-only and the target folder is writable
  4. Close other programs holding locks on the file (common on Windows) and retry

Example fix

// before
repo.renameRepositoryObject(id, newDir, "report", ".ktr"); // fails if 'report.ktr' exists
// after
if (repo.getObjectInformation(newId, RepositoryObjectType.TRANSFORMATION) == null) {
  repo.renameRepositoryObject(id, newDir, "report", ".ktr");
}
Defensive patterns

Strategy: validation

Validate before calling

if (!repo.getRepositoryCapabilities().isReadOnly() && repo.exists(id)) {
  // proceed with rename
}

Try / catch

try {
  ObjectId newId = repo.renameRepositoryObject(id, newDir, newName, ext);
} catch (KettleException e) {
  log.error("Rename failed for " + id + " -> " + newName, e);
}

Prevention

When it happens

Trigger: Calling the rename API with an ObjectId whose file no longer exists, a target name/extension that resolves to an existing file, or a target directory that is not writable.

Common situations: Renaming an object that was deleted by another user/process; target name collides with an existing file; read-only repository directory; OS-level file locks (file open elsewhere) blocking the move.

Understand the failure class

Background: "failed to write file", "Could not save figure", "Error saving remote file" — file write failed: causes and fixes across languages and libraries — this error's family across 38 libraries.

Related errors


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

Appendix: source

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

      // In case of a root object, the ID is the same as the relative filename...
      //
      FileObject fileObject = KettleVFS.getInstance( DefaultBowl.getInstance() )
        .getFileObject( calcDirectoryName( null ) + id.getId() );

      // Same name, different folder?
      if ( Utils.isEmpty( newName ) ) {
        newName = calcObjectName( id );
      }
      // The new filename can be anywhere so we re-calculate a new ID...
      //
      String newFilename = calcDirectoryName( newDirectory ) + newName + extension;

      FileObject newObject = KettleVFS.getInstance( DefaultBowl.getInstance() ).getFileObject( newFilename );
      fileObject.moveTo( newObject );

      return new StringObjectId( calcObjectId( newDirectory, newName, extension ) );
    } catch ( Exception e ) {
      throw new KettleException( "Unable to rename object with ID [" + id + "] to [" + newName + "]", e );
    }

  }

  private String calcObjectName( ObjectId id ) {
    int slashIndex = id.getId().lastIndexOf( '/' );
    int dotIndex = id.getId().lastIndexOf( '.' );

    return id.getId().substring( slashIndex + 1, dotIndex );
  }

  @Override
  public ObjectId renameJob( ObjectId id_job, RepositoryDirectoryInterface newDir, String newName )
    throws KettleException {
    return renameJob( id_job, null, newDir, newName );
  }

  @Override

View on GitHub (pinned to f3058517a1)