pentaho/pentaho-kettle · error · KettleException

Unable to move/rename directory with id [

Error message

Unable to move/rename directory with id [

What it means

Generic wrapper failure of renameRepositoryDirectory: after attempting pur.moveFile on the repository file backing the directory, any exception is rethrown as a KettleException naming the directory id, new parent path, and new name. It means the server-side move/rename of the repository directory failed for any reason (network, permissions, missing folder, duplicate name).

Solutions

  1. Check the cause (e.getCause()) to find the real server-side failure and address it (missing file, duplicate name, permissions).
  2. Verify the directory id still exists and the target parent exists before renaming.
  3. Ensure the new name does not collide with an existing sibling; pick a unique name.
  4. Re-authenticate/reconnect to the PUR repository and retry.

Example fix

// before
repo.renameRepositoryDirectory(id, parent, name);
// after
try {
  repo.renameRepositoryDirectory(id, parent, name);
} catch (KettleException e) {
  throw new KettleException("Rename of " + id + " failed: " + e.getCause(), e);
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (repo.getRepositoryDirectoryTree().findDirectory(dirId) == null) {
  throw new KettleException("Directory " + dirId + " no longer exists");
}

Type guard

null

Try / catch

try {
  repo.renameRepositoryDirectory(dirId, newParent, newName);
} catch (KettleException e) {
  Throwable cause = e.getCause();
  log.error("Rename of {} failed: {}", dirId, cause, e);
  throw e;
}

Prevention

When it happens

Trigger: Calling renameRepositoryDirectory(ObjectId, RepositoryDirectoryInterface, String) when the underlying pur.moveFile throws — e.g. the dirId no longer exists, target path already exists, or the JCR/PUR service call fails. The write lock is held during the call.

Common situations: Concurrent deletion of the directory by another client; renaming to a name that already exists in the target parent; session/credentials expired against the BA server; network interruption to the enterprise repository.

Understand the failure class

Background: "API request failed": what wrapped HTTP errors from external APIs mean and how to find the real cause — this error's family across 29 libraries.

Related errors


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

Appendix: source

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

      interimFolderPath = getParentPath( folder.getPath() );
      finalParentPath = ( newParent != null ? getPath( null, newParent, null ) : interimFolderPath );
      // Make sure the user is not trying to move their own home directory
      if ( isSameOrAncestorFolder( folder, homeFolder ) ) {
        // Then throw an exception that the user cannot move their own home directory
        throw new KettleException( "You are not allowed to move/rename your home folder." );
      }

      if ( !renameHomeDirectories && isUserHomeDirectory( folder ) ) {
        throw new RepositoryObjectAccessException( "Cannot move another users home directory",
          RepositoryObjectAccessException.AccessExceptionType.USER_HOME_DIR );
      }

      pur.moveFile( dirId.getId(), finalParentPath + RepositoryFile.SEPARATOR + finalName, null );

      rootRef.clearRef();
      return dirId;
    } catch ( Exception e ) {
      throw new KettleException( "Unable to move/rename directory with id [" + dirId + "] to new parent ["
        + finalParentPath + "] and new name [" + finalName + "]", e );
    } finally {
      readWriteLock.writeLock().unlock();
    }
  }

  protected RepositoryFileTree loadRepositoryFileTree( String path ) {
    readWriteLock.readLock().lock();
    RepositoryFileTree result;
    try {
      result = pur.getTree( path, -1, null, true );
    } finally {
      readWriteLock.readLock().unlock();
    }

    return result;
  }

View on GitHub (pinned to f3058517a1)