{"record":{"id":"605e7a77c3d6b2fb","repo":"pentaho/pentaho-kettle","slug":"changefileencoding-error-parentfoldernotexist","errorCode":"ChangeFileEncoding.Error.ParentFolderNotExist","errorMessage":"ChangeFileEncoding.Error.ParentFolderNotExist","messagePattern":"ChangeFileEncoding\\.Error\\.ParentFolderNotExist","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/changefileencoding/ChangeFileEncoding.java","lineNumber":154,"sourceCode":"\n      // Check if source file exists\n      if ( !data.sourceFile.exists() ) {\n        throw new KettleException(\n            BaseMessages.getString( PKG, \"ChangeFileEncoding.Error.SourceFileNotExists\", sourceFilename ) );\n      }\n\n      // Check if source file is a file\n      if ( data.sourceFile.getType() != FileType.FILE ) {\n        throw new KettleException(\n            BaseMessages.getString( PKG, \"ChangeFileEncoding.Error.SourceFileNotAFile\", sourceFilename ) );\n      }\n\n      // create directory only if not exists\n      if ( !data.sourceFile.getParent().exists() ) {\n        if ( meta.isCreateParentFolder() ) {\n          data.sourceFile.getParent().createFolder();\n        } else {\n          throw new KettleException( BaseMessages.getString( PKG, \"ChangeFileEncoding.Error.ParentFolderNotExist\",\n            data.sourceFile.getParent().toString() ) );\n        }\n      }\n\n      // Change file encoding\n      changeEncoding( sourceFilename, targetFilename );\n\n      putRow( data.inputRowMeta, outputRow ); // copy row to output rowset(s);\n\n      if ( isDetailed() ) {\n        logDetailed( BaseMessages.getString( PKG, \"ChangeFileEncoding.LineNumber\",\n          getLinesRead() + \" : \" + getInputRowMeta().getString( outputRow ) ) );\n      }\n    } catch ( Exception e ) {\n      boolean sendToErrorRow = false;\n      String errorMessage = null;\n\n      if ( getStepMeta().isDoingErrorHandling() ) {","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/changefileencoding/ChangeFileEncoding.java#L136-L172","documentation":"The parent directory of the source file does not exist, and the step's 'Create parent folder' option is disabled, so the step throws this KettleException naming the missing parent folder. The step requires the parent directory of the source file to be present (it only auto-creates it when the option is enabled).","triggerScenarios":"In processRow: if (!data.sourceFile.getParent().exists()) { if (meta.isCreateParentFolder()) createFolder(); else throw ParentFolderNotExist } — missing parent dir plus createParentFolder=false.","commonSituations":"Filename built dynamically and a directory segment is misspelled; a network mount is not mounted so the directory appears missing; the user assumed the step would create intermediate directories but left the option unchecked.","solutions":["Enable 'Create parent folder' in the step dialog so missing directories are auto-created.","Create the missing directory manually or in a preceding job entry ('Create a folder').","Fix the filename so the parent directory segment is correct."],"exampleFix":"// before: dialog option\nisCreateParentFolder = false\n// after\nisCreateParentFolder = true  // 'Create parent folder' checkbox checked","handlingStrategy":"validation","validationCode":"import java.io.File;\nFile parent = new File( resolvedSourcePath ).getParentFile();\nif ( parent != null && !parent.exists() ) {\n  parent.mkdirs(); // or fail fast with a clear message\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Enable 'Create parent folder' when paths are generated dynamically.","Ensure network mounts are up before running transformations that depend on them."],"tags":["etl","kettle","directory","vfs"],"backgroundTag":"directory-not-found","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"}