{"record":{"id":"602b1fbd74ad403f","repo":"pentaho/pentaho-kettle","slug":"unable-to-save-repository-directory-with-path","errorCode":null,"errorMessage":"Unable to save repository directory with path [","messagePattern":"Unable to save repository directory with path \\[","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java","lineNumber":453,"sourceCode":"    }\n  }\n\n  @Override public void saveRepositoryDirectory( final RepositoryDirectoryInterface dir ) throws KettleException {\n    // id of root dir is null--check for it\n    if ( \"/\".equals( dir.getParent().getName() ) ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"PurRepository.FailedDirectoryCreation.Message\" ) );\n    }\n\n    readWriteLock.writeLock().lock();\n    try {\n      RepositoryFile\n        newFolder =\n        pur.createFolder( dir.getParent().getObjectId() != null ? dir.getParent().getObjectId().getId() : null,\n          new RepositoryFile.Builder( dir.getName() ).folder( true ).build(), null );\n\n      dir.setObjectId( new StringObjectId( newFolder.getId().toString() ) );\n    } catch ( Exception e ) {\n      throw new KettleException( \"Unable to save repository directory with path [\" + getPath( null, dir, null ) + \"]\",\n        e );\n    } finally {\n      readWriteLock.writeLock().unlock();\n    }\n  }\n\n  /**\n   * Determine if \"baseFolder\" is the same as \"folder\" or if \"folder\" is a descendant of \"baseFolder\"\n   *\n   * @param folder\n   *          Folder to test for similarity / ancestory; Must not be null\n   * @param baseFolder\n   *          Folder that may be the same or an ancestor; Must not be null\n   * @return True if folder is a descendant of baseFolder or False if not; False if either folder or baseFolder are null\n   */\n  protected boolean isSameOrAncestorFolder( RepositoryFile folder, RepositoryFile baseFolder ) {\n    // If either folder is null, return false. We cannot do a proper comparison\n    if ( folder != null && baseFolder != null ) {","sourceCodeStart":435,"sourceCodeEnd":471,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java#L435-L471","documentation":"Wrapper around the unified repository createFolder call in saveRepositoryDirectory: any failure creating the folder on the server is wrapped as \"Unable to save repository directory with path [...]\" with the cause chained; the write lock is always released in finally.","triggerScenarios":"pur.createFolder fails — parent ObjectId missing/null unexpectedly, folder name invalid or already exists, user lacks create permission, or a server-side JCR error occurs while creating the folder.","commonSituations":"Duplicate folder name in the same parent; stale ObjectId on the parent after another client modified the tree; permission denied for non-admin users writing outside their home folder.","solutions":["Check the chained cause; if it is a duplicate/conflict, pick a unique folder name or reuse the existing folder.","Refresh the parent directory (findDirectory) to obtain a current ObjectId before saving.","Verify the user has create-child permission on the parent folder.","Retry the save after re-authenticating if the session expired."],"exampleFix":"// before\nrepo.saveRepositoryDirectory(dir);\n// after\nRepositoryDirectoryInterface fresh = repo.findDirectory(getParentPath(dir.getPath())); dir.setParent(fresh); repo.saveRepositoryDirectory(dir);","handlingStrategy":"retry","validationCode":"RepositoryDirectoryInterface fresh = repo.findDirectory(parentPath); if (fresh == null) throw new IllegalStateException(\"parent missing: \" + parentPath);","typeGuard":null,"tryCatchPattern":"try { repo.saveRepositoryDirectory(dir); } catch (KettleException e) { if (isConflict(e.getCause())) { dir.setName(uniqueName(dir.getName())); repo.saveRepositoryDirectory(dir); } else throw e; }","preventionTips":["Refresh parent ObjectIds before saving","Use unique folder names within a parent","Confirm write permissions outside your own home folder"],"tags":["pentaho","repository","directory"],"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"}