{"record":{"id":"675f73d0093bc21e","repo":"pentaho/pentaho-kettle","slug":"propertyoutput-log-cannotcreateparentfolder","errorCode":null,"errorMessage":"PropertyOutput.Log.CanNotCreateParentFolder","messagePattern":"PropertyOutput\\.Log\\.CanNotCreateParentFolder","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/propertyoutput/PropertyOutput.java","lineNumber":210,"sourceCode":"      FileObject parentfolder = null;\n      try {\n        // Do we need to create parent folder ?\n\n        // Check for parent folder\n        // Get parent folder\n        parentfolder = data.file.getParent();\n        if ( !parentfolder.exists() ) {\n          if ( log.isDetailed() ) {\n            logDetailed( BaseMessages.getString( PKG, \"PropertyOutput.Log.ParentFolderExists\", parentfolder.getName().toString() ) );\n          }\n          parentfolder.createFolder();\n          if ( log.isDetailed() ) {\n            logDetailed( BaseMessages.getString( PKG, \"PropertyOutput.Log.CanNotCreateParentFolder\", parentfolder.getName().toString() ) );\n          }\n        }\n      } catch ( Exception e ) {\n        logError( BaseMessages.getString( PKG, \"PropertyOutput.Log.CanNotCreateParentFolder\", parentfolder.getName().toString() ) );\n        throw new KettleException( BaseMessages.getString( PKG, \"PropertyOutput.Log.CanNotCreateParentFolder\", parentfolder.getName().toString() ) );\n      } finally {\n        if ( parentfolder != null ) {\n          try {\n            parentfolder.close();\n          } catch ( Exception ex ) { /* Ignore */\n          }\n        }\n      }\n    }\n  }\n\n  private boolean closeFile() {\n    if ( data.file == null ) {\n      return true;\n    }\n    boolean retval = false;\n    try ( OutputStream propsFile = KettleVFS.getInstance( getTransMeta().getBowl() )\n          .getOutputStream( data.file, false ) ) {","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/propertyoutput/PropertyOutput.java#L192-L228","documentation":"createParentFolder attempts to create the parent directory of the output file when 'create parent folder' is enabled in the step metadata. If any exception occurs during folder creation (or the folder cannot be created), it logs and throws a KettleException using the CanNotCreateParentFolder message including the folder name, which then propagates through openNewFile.","triggerScenarios":"meta.isCreateParentFolder() is true; resolveFile on the parent succeeds, but folder.exists() is false and createFolder() throws (permission denied, read-only filesystem, invalid path), or any Exception is raised in the try block.","commonSituations":"Writing to a path under a directory the Pentaho user cannot write to; creating deeply nested paths on a read-only mount; filename points to a filesystem root or an invalid VFS URI so parent resolution fails.","solutions":["Grant write/create permission on the parent directory for the user running the transformation (kitchen/pan or Spoon).","Create the directory manually beforehand if it must be owned by a specific user.","Verify the folder path derived from the filename is valid (no unexpanded variables, correct VFS scheme).","Check filesystem mount status / disk space if the target is a network mount."],"exampleFix":"// shell, before running the transformation\n// before\nmkdir: fails silently, step throws at runtime\n// after\nmkdir -p /data/output && chown pentaho:pentaho /data/output","handlingStrategy":"try-catch","validationCode":"File parent = new File(filename).getAbsoluteFile().getParentFile();\nif (!parent.exists() && !parent.getAbsoluteFile().getParentFile().canWrite()) {\n    throw new IllegalStateException(\"Cannot create folder \" + parent);\n}","typeGuard":null,"tryCatchPattern":"try {\n    openNewFile();\n} catch (KettleException e) {\n    if (e.getMessage().contains(\"CanNotCreateParentFolder\")) {\n        // check permissions on the folder named in the message\n    }\n}","preventionTips":["Run the transformation under a user with write access to the output tree.","Create deep directory structures in deployment scripts (mkdir -p) rather than relying on runtime creation.","Verify network mounts are up before scheduled runs."],"tags":["pentaho-kettle","mkdir","permissions","filesystem"],"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"}