pentaho/pentaho-kettle · error · RepositoryObjectAccessException

Cannot move another users home directory

Error message

Cannot move another users home directory

What it means

PurRepository.renameRepositoryDirectory refuses to rename/move a repository directory that is another user's home directory. The PUR (Pentaho Enterprise Repository) adapter enforces server-side policy that home folders of other users are immutable to the caller. It throws RepositoryObjectAccessException with AccessExceptionType.USER_HOME_DIR to signal this policy violation.

Solutions

  1. Rename a directory other than another user's home folder, or rename/move only its children instead of the home folder itself.
  2. Perform the operation as an administrator and enable the renameHomeDirectories option so home folders may be moved.
  3. Catch RepositoryObjectAccessException and check AccessExceptionType.USER_HOME_DIR to skip home folders in bulk operations.
  4. Verify the folder's path before renaming: if it lies under /home, exclude it.

Example fix

// before
repository.renameRepositoryDirectory(dirId, newParentDir, newName);
// after
if (!isUnderHome(dir.getPath())) {
  repository.renameRepositoryDirectory(dirId, newParentDir, newName);
} else {
  log.warn("Skipping home directory " + dir.getPath());
}
Defensive patterns

Strategy: try-catch

Validate before calling

RepositoryDirectoryInterface home = repo.getUserHomeDirectory();
String path = dir.getPath();
if (path.startsWith("/home") && !path.equals(home.getPath())) {
  throw new KettleException("Refusing to move another user's home directory: " + path);
}

Type guard

boolean isOtherUsersHome(RepositoryDirectoryInterface dir, String currentUser) {
  String p = dir.getPath();
  return p.startsWith("/home/") && !p.equals("/home/" + currentUser);
}

Try / catch

try {
  repo.renameRepositoryDirectory(dirId, newParent, newName);
} catch (RepositoryObjectAccessException e) {
  if (e.getAccessExceptionType() == RepositoryObjectAccessException.AccessExceptionType.USER_HOME_DIR) {
    log.warn("Skipped home directory");
  } else throw e;
}

Prevention

When it happens

Trigger: Calling renameRepositoryDirectory (or RepositoryDirectory rename flows that delegate to it) with a folder argument that isUserHomeDirectory(folder) identifies as some user's home folder, while renameHomeDirectories is false (i.e. the current user is not allowed to move home directories).

Common situations: Admin scripts that bulk-reorganize /home; renaming a parent folder that contains or equals another user's home; UI drag-and-drop of another user's home folder; migration scripts run with an account lacking home-move rights.

Understand the failure class

Background: Permission denied / not authorized / 403 Forbidden: access-control rejections when the caller lacks the required role, grant, or ownership — this error's family across 18 libraries.

Related errors


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

Appendix: source

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

    readWriteLock.writeLock().lock();
    try {
      RepositoryFile homeFolder;
      RepositoryFile folder;

      homeFolder = pur.getFile( ClientRepositoryPaths.getUserHomeFolderPath( user.getLogin() ) );
      folder = pur.getFileById( dirId.getId() );

      finalName = ( newName != null ? newName : folder.getName() );
      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;

View on GitHub (pinned to f3058517a1)