{"record":{"id":"764a61316e1e8817","repo":"pentaho/pentaho-kettle","slug":"unable-to-create-directory-with-path","errorCode":null,"errorMessage":"Unable to create directory with path [","messagePattern":"Unable to create 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":434,"sourceCode":"      String[] path = Const.splitPath( directoryPath, RepositoryDirectory.DIRECTORY_SEPARATOR );\n\n      RepositoryDirectoryInterface follow = parentDirectory;\n\n      for ( int level = 0; level < path.length; level++ ) {\n        RepositoryDirectoryInterface child = follow.findChild( path[level] );\n        if ( child == null ) {\n          // create this one\n          child = new RepositoryDirectory( follow, path[level] );\n          saveRepositoryDirectory( child );\n          // link this with the parent directory\n          follow.addSubdirectory( child );\n        }\n\n        follow = child;\n      }\n      return follow;\n    } catch ( Exception e ) {\n      throw new KettleException( \"Unable to create directory with path [\" + directoryPath + \"]\", e );\n    }\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 ) {","sourceCodeStart":416,"sourceCodeEnd":452,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java#L416-L452","documentation":"Generic wrapper in PurRepository.createRepositoryDirectory: any exception while walking/creating the path segments under the validated parent is wrapped in a KettleException \"Unable to create directory with path [...]\" with the original cause chained.","triggerScenarios":"createRepositoryDirectory throws from the underlying pur (unified repository) client — e.g. permission denied on the parent folder, name conflicts, JCR session errors, or a failure in findDirectory/refreshing children while creating a multi-segment path.","commonSituations":"User lacks write permission on /public or another user's /home; network/session failure to the BA Server; concurrent creation of the same folder by two clients.","solutions":["Read e.getCause() to identify whether it is an access-control or connectivity issue.","Verify write (create) permission on the target parent folder.","Retry after confirming the folder does not already exist (name conflict).","Re-authenticate to the repository if the session expired."],"exampleFix":"// before\nrepo.createRepositoryDirectory(parent, dir);\n// after\ntry { repo.createRepositoryDirectory(parent, dir); } catch (KettleException e) { logger.warn(\"create failed for {} : {}\", path, e.getCause()); }","handlingStrategy":"try-catch","validationCode":"if (parent == null) throw new IllegalArgumentException(\"parent directory required\"); if (!hasCreatePermission(user, parent.getPath())) throw new SecurityException(\"no create permission on \" + parent.getPath());","typeGuard":null,"tryCatchPattern":"try { repo.createRepositoryDirectory(parent, dir); } catch (KettleException e) { log.warn(\"mkdir {} failed: {}\", path, e.getCause()); if (isNameConflict(e.getCause())) reuseExisting(path); }","preventionTips":["Check create ACLs on the parent before calling","Handle duplicate folder names by reusing the existing directory","Refresh directory tree before creating after concurrent edits"],"tags":["pentaho","repository","directory"],"backgroundTag":"mkdir-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"}