{"record":{"id":"dacfd983a5bf83b3","repo":"pentaho/pentaho-kettle","slug":"you-are-not-allowed-to-move-rename-your-home-folder","errorCode":null,"errorMessage":"You are not allowed to move/rename your home folder.","messagePattern":"You are not allowed to move/rename your home folder\\.","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java","lineNumber":619,"sourceCode":"    String finalName = null;\n    String finalParentPath = null;\n    String interimFolderPath = null;\n\n    readWriteLock.writeLock().lock();\n    try {\n      RepositoryFile homeFolder;\n      RepositoryFile folder;\n\n      homeFolder = pur.getFile( ClientRepositoryPaths.getUserHomeFolderPath( user.getLogin() ) );\n      folder = pur.getFileById( dirId.getId() );\n\n      finalName = ( newName != null ? newName : folder.getName() );\n      interimFolderPath = getParentPath( folder.getPath() );\n      finalParentPath = ( newParent != null ? getPath( null, newParent, null ) : interimFolderPath );\n      // Make sure the user is not trying to move their own home directory\n      if ( isSameOrAncestorFolder( folder, homeFolder ) ) {\n        // Then throw an exception that the user cannot move their own home directory\n        throw new KettleException( \"You are not allowed to move/rename your home folder.\" );\n      }\n\n      if ( !renameHomeDirectories && isUserHomeDirectory( folder ) ) {\n        throw new RepositoryObjectAccessException( \"Cannot move another users home directory\",\n          RepositoryObjectAccessException.AccessExceptionType.USER_HOME_DIR );\n      }\n\n      pur.moveFile( dirId.getId(), finalParentPath + RepositoryFile.SEPARATOR + finalName, null );\n\n      rootRef.clearRef();\n      return dirId;\n    } catch ( Exception e ) {\n      throw new KettleException( \"Unable to move/rename directory with id [\" + dirId + \"] to new parent [\"\n        + finalParentPath + \"] and new name [\" + finalName + \"]\", e );\n    } finally {\n      readWriteLock.writeLock().unlock();\n    }\n  }","sourceCodeStart":601,"sourceCodeEnd":637,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java#L601-L637","documentation":"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.","triggerScenarios":"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.","commonSituations":"Refactoring folder trees with scripts that rename parents containing home folders; UI drag-and-drop moving /home/<user> into /public.","solutions":["Skip rename operations on folders equal to or above the user's home path.","Compute the home path via ClientRepositoryPaths.getUserHomeFolderPath(user.getLogin()) and compare with folder.getPath() before renaming.","Rename only the contents inside the home folder, or create a new folder and move content selectively."],"exampleFix":"// before\nrepo.renameRepositoryDirectory(dir, publicDir, \"myhome\");\n// after\nString home = \"/home/\" + user.getLogin(); if (!dir.getPath().equals(home) && !home.startsWith(dir.getPath())) { repo.renameRepositoryDirectory(dir, publicDir, \"myhome\"); }","handlingStrategy":"validation","validationCode":"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\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Exclude the user's home path and its ancestors from rename/move operations","Compare ancestor relationships via path prefix checks","Move contents into a new folder instead of renaming the home itself"],"tags":["pentaho","repository","permission"],"backgroundTag":"permission-denied","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}