pentaho/pentaho-kettle · error · KettleException

Unable to rename directory folder to [ + id + ]

Error message

Unable to rename directory folder to [ + id + ]

What it means

KettleFileRepository.renameRepositoryObject() (directory branch) throws this KettleException when the VFS move of the folder to its new name fails. Note this variant does not chain the cause, so only the message is available, and it includes the directory id being renamed.

Solutions

  1. Verify the source folder exists and the target folder name does not already exist
  2. Check write permissions on the parent directory
  3. Close any views/processes holding files inside the folder, then retry
  4. Add logging around this call since the thrown exception omits the cause
Defensive patterns

Strategy: validation

Validate before calling

RepositoryDirectoryInterface dir = repo.loadRepositoryDirectoryTree().findDirectory(idPath);
FileObject target = KettleVFS.getInstance(DefaultBowl.getInstance()).getFileObject(newPath);
if (dir == null || target.exists()) throw new IllegalStateException("Invalid rename target");

Try / catch

try {
  repo.renameRepositoryObject(dirId, newDir, newName);
} catch (KettleException e) {
  log.error("Directory rename failed (no cause chained) for " + dirId, e);
}

Prevention

When it happens

Trigger: folder.moveTo(newFolder) fails because the source folder is missing, the target folder name already exists, the parent directory is read-only, or the folder is locked/in use.

Common situations: Renaming a directory that is the current working directory in Spoon; target name conflicts with an existing sibling folder; OS file locks; insufficient write permissions on the parent.

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/1f9a9e8f5c91a1de. Report an issue: GitHub.

Appendix: source

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

        FileObject folder = KettleVFS.getInstance( DefaultBowl.getInstance() ).getFileObject( dir.getPath() );

        String newFolderName = null;

        if ( newParentDir != null ) {
          FileObject newParentFolder = KettleVFS.getInstance( DefaultBowl.getInstance() )
            .getFileObject( newParentDir.getPath() );

          newFolderName = newParentFolder.toString() + "/" + newName;
        } else {
          newFolderName = folder.getParent().toString() + "/" + newName;
        }

        FileObject newFolder = KettleVFS.getInstance( DefaultBowl.getInstance() ).getFileObject( newFolderName );
        folder.moveTo( newFolder );

        return new StringObjectId( dir.getObjectId() );
      } catch ( Exception e ) {
        throw new KettleException( "Unable to rename directory folder to [" + id + "]" );
      }
    }
    return ( id );
  }

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

  @Override
  public ObjectId renameTransformation( ObjectId id_transformation, String versionComment,
      RepositoryDirectoryInterface newDir, String newName ) throws KettleException {
    ObjectId objectId = renameObject( id_transformation, newDir, newName, EXT_TRANSFORMATION );
    if ( !Utils.isEmpty( versionComment ) ) {
      insertLogEntry( "Rename transformation : " + versionComment );
    }

View on GitHub (pinned to f3058517a1)