pentaho/pentaho-kettle · error · KettleException

You are not allowed to move/rename your home folder.

Error message

You are not allowed to move/rename your home folder.

What it means

renameRepositoryDirectory protects the current user's home folder from being moved or renamed: if the target folder is the same as or an ancestor of the user's home folder, a KettleException "You are not allowed to move/rename your home folder." is thrown before calling the backend.

Solutions

  1. Skip rename operations on folders equal to or above the user's home path.
  2. Compute the home path via ClientRepositoryPaths.getUserHomeFolderPath(user.getLogin()) and compare with folder.getPath() before renaming.
  3. Rename only the contents inside the home folder, or create a new folder and move content selectively.

Example fix

// before
repo.renameRepositoryDirectory(dir, publicDir, "myhome");
// after
String home = "/home/" + user.getLogin(); if (!dir.getPath().equals(home) && !home.startsWith(dir.getPath())) { repo.renameRepositoryDirectory(dir, publicDir, "myhome"); }
Defensive patterns

Strategy: validation

Validate before calling

String home = "/home/" + user.getLogin(); String p = folder.getPath(); if (p.equals(home) || home.startsWith(p)) throw new IllegalArgumentException("refusing to move/rename own home folder");

Prevention

When it happens

Trigger: Calling renameRepositoryDirectory(dir, newParent, newName) where dir is /home/<your-username> or any ancestor of it — e.g. renaming /home itself or moving a user home to another parent.

Common situations: Refactoring folder trees with scripts that rename parents containing home folders; UI drag-and-drop moving /home/<user> into /public.

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

Appendix: source

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

    String finalName = null;
    String finalParentPath = null;
    String interimFolderPath = null;

    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();
    }
  }

View on GitHub (pinned to f3058517a1)