{"record":{"id":"8000ba9445550ca5","repo":"pentaho/pentaho-kettle","slug":"unable-to-create-folder-newfolder","errorCode":null,"errorMessage":"Unable to create folder + newFolder","messagePattern":"Unable to create folder \\+ newFolder","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/repository/filerep/KettleFileRepository.java","lineNumber":367,"sourceCode":"    }\n  }\n\n  @Override\n  public RepositoryDirectoryInterface createRepositoryDirectory( RepositoryDirectoryInterface parentDirectory,\n    String directoryPath ) throws KettleException {\n    String folder = calcDirectoryName( parentDirectory );\n    String newFolder = folder;\n    if ( folder.endsWith( \"/\" ) ) {\n      newFolder += directoryPath;\n    } else {\n      newFolder += \"/\" + directoryPath;\n    }\n\n    FileObject parent = KettleVFS.getInstance( DefaultBowl.getInstance() ).getFileObject( newFolder );\n    try {\n      parent.createFolder();\n    } catch ( FileSystemException e ) {\n      throw new KettleException( \"Unable to create folder \" + newFolder, e );\n    }\n\n    // Incremental change of the directory structure...\n    //\n    RepositoryDirectory newDir = new RepositoryDirectory( parentDirectory, directoryPath );\n    parentDirectory.addSubdirectory( newDir );\n    newDir.setObjectId( new StringObjectId( calcObjectId( newDir ) ) );\n\n    return newDir;\n  }\n\n  @Override\n  public void saveRepositoryDirectory( RepositoryDirectoryInterface dir ) throws KettleException {\n    try {\n      String filename = calcDirectoryName( dir );\n      ObjectId objectId = new StringObjectId( calcRelativeElementDirectory( dir ) );\n\n      FileObject fileObject = KettleVFS.getInstance( DefaultBowl.getInstance() ).getFileObject( filename );","sourceCodeStart":349,"sourceCodeEnd":385,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/filerep/KettleFileRepository.java#L349-L385","documentation":"Thrown when KettleFileRepository.createRepositoryDirectory() fails to physically create the folder for the new repository directory via Apache Commons VFS (FileSystemException). The repository directory object is only created in memory after the folder is successfully created, so this error means nothing was changed.","triggerScenarios":"Calling createRepositoryDirectory(parentDirectory, directoryPath) when the target path already exists as a file, the parent is unwritable, the path contains illegal characters, or the VFS scheme is invalid/unreachable.","commonSituations":"Creating directories in a file repo on a network share with permission issues; a file already occupying the target name; path segments with characters invalid on the OS filesystem; misconfigured repo base URL.","solutions":["Read the chained FileSystemException for the concrete reason (exists-as-file, access denied, etc.).","Check no file already occupies the target folder path and remove/rename it.","Verify the process has write permission on the parent directory.","Sanitize the directory name — strip filesystem-illegal characters before creating."],"exampleFix":"// before\nrepo.createRepositoryDirectory(parentDir, \"new:folder\"); // ':' illegal on Windows\n\n// after\nString safe = directoryPath.replaceAll(\"[\\\\/:*?\\\"<>|]\", \"_\");\nrepo.createRepositoryDirectory(parentDir, safe);","handlingStrategy":"validation","validationCode":"// sanitize name and check parent writability before creating\nString safe = path.replaceAll(\"[\\\\/:*?\\\"<>|]\", \"_\");\nboolean ok = new File(parentPath).canWrite();","typeGuard":null,"tryCatchPattern":"try {\n  repo.createRepositoryDirectory(parentDir, path);\n} catch (KettleException e) {\n  if (e.getCause() instanceof FileSystemException) {\n    log.error(\"VFS folder creation failed: \" + e.getCause().getMessage());\n  } else { throw e; }\n}","preventionTips":["Strip filesystem-illegal characters from directory names","Ensure no file occupies the target folder path","Confirm write permission on the parent directory","Check the repository base URL/scheme is valid"],"tags":["kettle","file-repository","mkdir","vfs"],"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"}