{"record":{"id":"906047f24a29bf24","repo":"pentaho/pentaho-kettle","slug":"processfiles-error-sourcefilenotexist","errorCode":null,"errorMessage":"ProcessFiles.Error.SourceFileNotExist","messagePattern":"ProcessFiles\\.Error\\.SourceFileNotExist","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/processfiles/ProcessFiles.java","lineNumber":112,"sourceCode":"      if ( meta.simulate ) {\n        if ( log.isBasic() ) {\n          logBasic( BaseMessages.getString( PKG, \"ProcessFiles.Log.SimulationModeON\" ) );\n        }\n      }\n    } // End If first\n    try {\n      // get source filename\n      String sourceFilename = getInputRowMeta().getString( r, data.indexOfSourceFilename );\n\n      if ( Utils.isEmpty( sourceFilename ) ) {\n        logError( BaseMessages.getString( PKG, \"ProcessFiles.Error.SourceFileEmpty\" ) );\n        throw new KettleException( BaseMessages.getString( PKG, \"ProcessFiles.Error.SourceFileEmpty\" ) );\n      }\n      data.sourceFile = KettleVFS.getInstance( getTransMeta().getBowl() ).getFileObject( sourceFilename, getTransMeta() );\n\n      if ( !data.sourceFile.exists() ) {\n        logError( BaseMessages.getString( PKG, \"ProcessFiles.Error.SourceFileNotExist\", sourceFilename ) );\n        throw new KettleException( BaseMessages.getString(\n          PKG, \"ProcessFiles.Error.SourceFileNotExist\", sourceFilename ) );\n      }\n      if ( data.sourceFile.getType() != FileType.FILE ) {\n        logError( BaseMessages.getString( PKG, \"ProcessFiles.Error.SourceFileNotFile\", sourceFilename ) );\n        throw new KettleException( BaseMessages.getString(\n          PKG, \"ProcessFiles.Error.SourceFileNotFile\", sourceFilename ) );\n      }\n      String targetFilename = null;\n      if ( meta.getOperationType() != ProcessFilesMeta.OPERATION_TYPE_DELETE ) {\n        // get value for target filename\n        targetFilename = getInputRowMeta().getString( r, data.indexOfTargetFilename );\n\n        if ( Utils.isEmpty( targetFilename ) ) {\n          logError( BaseMessages.getString( PKG, \"ProcessFiles.Error.TargetFileEmpty\" ) );\n          throw new KettleException( BaseMessages.getString( PKG, \"ProcessFiles.Error.TargetFileEmpty\" ) );\n        }\n        data.targetFile = KettleVFS.getInstance( getTransMeta().getBowl() ).getFileObject( targetFilename, getTransMeta() );\n        if ( data.targetFile.exists() ) {","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/processfiles/ProcessFiles.java#L94-L130","documentation":"Thrown when the source filename from the row is non-empty but the file it points to does not exist on the filesystem (VFS). Pentaho validates existence with data.sourceFile.exists() before performing copy/move/delete operations.","triggerScenarios":"data.sourceFile.exists() returns false after KettleVFS.getFileObject(sourceFilename); any operation type (copy/move/delete) on a missing file.","commonSituations":"File deleted by another process between listing and processing; typo or wrong case in path (case-sensitive Linux); relative path resolved against unexpected working directory; file on unmounted network share; staging files not yet created when transformation runs.","solutions":["Verify the file exists at the exact path in the row (check case and whitespace) before running the transformation.","Ensure any job entry that produces the files (e.g. unzip, download) runs before this transformation and succeeded.","Use absolute paths or verify the relative path against the PDI working directory.","Enable 'Create parent folder' is irrelevant here; instead add a 'Check if file exists' job entry or a File Exists step to guard the stream.","Check network share / mount availability and credentials."],"exampleFix":"// before\nFileExists(filename='${INPUT_DIR}/data.txt') -> ProcessFiles\n// after (guard dynamically)\nFileExists(filenameField='filename') -> FilterRows(exists=true) -> ProcessFiles","handlingStrategy":"validation","validationCode":"// Pre-check in a User Defined Java Expression or via File Exists step:\nnew java.io.File(sourceFilename).exists()","typeGuard":"boolean sourceFileReadable(String path) {\n  return path != null && new java.io.File(path).isFile();\n}","tryCatchPattern":"try {\n  processRow();\n} catch (KettleException e) {\n  if (e.getMessage().contains(\"SourceFileNotExist\")) {\n    logError(\"Source file missing: \" + extractPath(e));\n    // skip row or retry\n  } else throw e;\n}","preventionTips":["Use absolute paths to avoid working-directory ambiguity","Guarantee upstream file-producing job entries ran successfully","Add a 'Check if file exists' job entry or File Exists step guard","Verify case-sensitive paths on Linux and mounts/credentials on network shares"],"tags":["pdi","kettle","file-not-found","filesystem"],"backgroundTag":"file-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"}