pentaho/pentaho-kettle · error · KettleException
ChangeFileEncoding.Error.ParentFolderNotExist
ChangeFileEncoding.Error.ParentFolderNotExist
Error message
ChangeFileEncoding.Error.ParentFolderNotExist
What it means
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).
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.
Example fix
// before: dialog option isCreateParentFolder = false // after isCreateParentFolder = true // 'Create parent folder' checkbox checked
Defensive patterns
Strategy: validation
Validate before calling
import java.io.File;
File parent = new File( resolvedSourcePath ).getParentFile();
if ( parent != null && !parent.exists() ) {
parent.mkdirs(); // or fail fast with a clear message
} Prevention
- Enable 'Create parent folder' when paths are generated dynamically.
- Ensure network mounts are up before running transformations that depend on them.
When it happens
Trigger: In processRow: if (!data.sourceFile.getParent().exists()) { if (meta.isCreateParentFolder()) createFolder(); else throw ParentFolderNotExist } — missing parent dir plus createParentFolder=false.
Common situations: 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.
Related errors
- ChangeFileEncoding.Error.SourceFileNotAFile
- ChangeFileEncoding.Error.SourceFileNotExists
- Unable to save directory [ + dir + ] in the repository
- We can not find folder
- [ + ArgList[0] + ] is not a file!
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/605e7a77c3d6b2fb.
Report an issue: GitHub.
Appendix: source
Thrown at plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/changefileencoding/ChangeFileEncoding.java:154
// Check if source file exists
if ( !data.sourceFile.exists() ) {
throw new KettleException(
BaseMessages.getString( PKG, "ChangeFileEncoding.Error.SourceFileNotExists", sourceFilename ) );
}
// Check if source file is a file
if ( data.sourceFile.getType() != FileType.FILE ) {
throw new KettleException(
BaseMessages.getString( PKG, "ChangeFileEncoding.Error.SourceFileNotAFile", sourceFilename ) );
}
// create directory only if not exists
if ( !data.sourceFile.getParent().exists() ) {
if ( meta.isCreateParentFolder() ) {
data.sourceFile.getParent().createFolder();
} else {
throw new KettleException( BaseMessages.getString( PKG, "ChangeFileEncoding.Error.ParentFolderNotExist",
data.sourceFile.getParent().toString() ) );
}
}
// Change file encoding
changeEncoding( sourceFilename, targetFilename );
putRow( data.inputRowMeta, outputRow ); // copy row to output rowset(s);
if ( isDetailed() ) {
logDetailed( BaseMessages.getString( PKG, "ChangeFileEncoding.LineNumber",
getLinesRead() + " : " + getInputRowMeta().getString( outputRow ) ) );
}
} catch ( Exception e ) {
boolean sendToErrorRow = false;
String errorMessage = null;
if ( getStepMeta().isDoingErrorHandling() ) {View on GitHub (pinned to f3058517a1)