{"record":{"id":"1f9a9e8f5c91a1de","repo":"pentaho/pentaho-kettle","slug":"unable-to-rename-directory-folder-to-id","errorCode":null,"errorMessage":"Unable to rename directory folder to [ + id + ]","messagePattern":"Unable to rename directory folder to \\[ \\+ id \\+ \\]","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/repository/filerep/KettleFileRepository.java","lineNumber":1236,"sourceCode":"        FileObject folder = KettleVFS.getInstance( DefaultBowl.getInstance() ).getFileObject( dir.getPath() );\n\n        String newFolderName = null;\n\n        if ( newParentDir != null ) {\n          FileObject newParentFolder = KettleVFS.getInstance( DefaultBowl.getInstance() )\n            .getFileObject( newParentDir.getPath() );\n\n          newFolderName = newParentFolder.toString() + \"/\" + newName;\n        } else {\n          newFolderName = folder.getParent().toString() + \"/\" + newName;\n        }\n\n        FileObject newFolder = KettleVFS.getInstance( DefaultBowl.getInstance() ).getFileObject( newFolderName );\n        folder.moveTo( newFolder );\n\n        return new StringObjectId( dir.getObjectId() );\n      } catch ( Exception e ) {\n        throw new KettleException( \"Unable to rename directory folder to [\" + id + \"]\" );\n      }\n    }\n    return ( id );\n  }\n\n  @Override\n  public ObjectId renameTransformation( ObjectId id_transformation, RepositoryDirectoryInterface newDir, String newName )\n    throws KettleException {\n    return renameTransformation( id_transformation, null, newDir, newName );\n  }\n\n  @Override\n  public ObjectId renameTransformation( ObjectId id_transformation, String versionComment,\n      RepositoryDirectoryInterface newDir, String newName ) throws KettleException {\n    ObjectId objectId = renameObject( id_transformation, newDir, newName, EXT_TRANSFORMATION );\n    if ( !Utils.isEmpty( versionComment ) ) {\n      insertLogEntry( \"Rename transformation : \" + versionComment );\n    }","sourceCodeStart":1218,"sourceCodeEnd":1254,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/filerep/KettleFileRepository.java#L1218-L1254","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify the source folder exists and the target folder name does not already exist","Check write permissions on the parent directory","Close any views/processes holding files inside the folder, then retry","Add logging around this call since the thrown exception omits the cause"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"RepositoryDirectoryInterface dir = repo.loadRepositoryDirectoryTree().findDirectory(idPath);\nFileObject target = KettleVFS.getInstance(DefaultBowl.getInstance()).getFileObject(newPath);\nif (dir == null || target.exists()) throw new IllegalStateException(\"Invalid rename target\");","typeGuard":null,"tryCatchPattern":"try {\n  repo.renameRepositoryObject(dirId, newDir, newName);\n} catch (KettleException e) {\n  log.error(\"Directory rename failed (no cause chained) for \" + dirId, e);\n}","preventionTips":["Check sibling folders for name conflicts first","Close Spoon views on the folder before renaming","Remember this exception drops the cause - add your own logging"],"tags":["repository","directory","rename","file-system"],"backgroundTag":"file-write-failed","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"}