{"record":{"id":"ccd19b72072fbafe","repo":"pentaho/pentaho-kettle","slug":"zipfile-error-sourcefilenotexist","errorCode":null,"errorMessage":"ZipFile.Error.SourceFileNotExist","messagePattern":"ZipFile\\.Error\\.SourceFileNotExist","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/zipfile/ZipFile.java","lineNumber":157,"sourceCode":"\n    try {\n      // get source filename\n      String sourceFilename = getInputRowMeta().getString( r, data.indexOfSourceFilename );\n\n      if ( Utils.isEmpty( sourceFilename ) ) {\n        log.logError( toString(), BaseMessages.getString( PKG, \"ZipFile.Error.SourceFileEmpty\" ) );\n        throw new KettleException( BaseMessages.getString( PKG, \"ZipFile.Error.SourceFileEmpty\" ) );\n      }\n      data.sourceFile = KettleVFS.getInstance( getTransMeta().getBowl() )\n        .getFileObject( sourceFilename, this );\n\n      // Check sourcefile\n      boolean skip = false;\n      if ( !data.sourceFile.exists() ) {\n        log\n          .logError( toString(), BaseMessages\n            .getString( PKG, \"ZipFile.Error.SourceFileNotExist\", sourceFilename ) );\n        throw new KettleException( BaseMessages\n          .getString( PKG, \"ZipFile.Error.SourceFileNotExist\", sourceFilename ) );\n      } else {\n        if ( data.sourceFile.getType() != FileType.FILE ) {\n          log.logError( toString(), BaseMessages\n            .getString( PKG, \"ZipFile.Error.SourceFileNotFile\", sourceFilename ) );\n          throw new KettleException( BaseMessages.getString(\n            PKG, \"ZipFile.Error.SourceFileNotFile\", sourceFilename ) );\n        }\n      }\n\n      // get basefolder\n      if ( data.indexOfBaseFolder > -1 ) {\n        data.baseFolder = getInputRowMeta().getString( r, data.indexOfBaseFolder );\n      }\n\n      // get destination folder\n      String moveToFolder = null;\n      if ( data.indexOfMoveToFolder > -1 ) {","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/zipfile/ZipFile.java#L139-L175","documentation":"The source filename from the row points to a path that does not exist on the filesystem at execution time. The step resolves the path via KettleVFS, checks FileObject.exists(), and throws this KettleException (after logging) because it cannot zip a nonexistent file.","triggerScenarios":"data.sourceFile.exists() returns false for the path taken from the row's source filename field at ZipFile.java:157.","commonSituations":"File deleted or moved between an earlier step and ZipFile; relative path resolved against a different working directory than expected; filename contains typos, wrong case (Linux), or stale date-pattern substitution (e.g., ${TODAY} format mismatch); agent/worker runs on a node lacking the shared mount.","solutions":["Verify the file exists at the exact path by listing the directory or testing manually.","Use absolute paths or fix the base folder configuration so relative paths resolve correctly.","Ensure the executing node has access to the filesystem/network share hosting the file.","Check that any dynamic filename construction (variables, date patterns) yields the expected name.","Pre-filter rows with a 'File exists' check step to skip missing files gracefully."],"exampleFix":"// before\nString f = \"data/export_\" + yesterday + \".csv\"; // pattern mismatch -> file missing\n// after\nString f = \"data/export_\" + DateTimeUtil.today() + \".csv\"; // or verify with File exists step","handlingStrategy":"validation","validationCode":"// Upstream 'File exists' check step or Java check:\nFile f = new File(sourceFilename);\nif (!f.exists()) {\n  // route row to an error stream / log instead of zipping\n}","typeGuard":null,"tryCatchPattern":"try {\n  transformation.execute();\n} catch (KettleException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"SourceFileNotExist\")) {\n    log.error(\"ZipFile source file missing: check path, working dir, and mounts\", e);\n  } else { throw e; }\n}","preventionTips":["Use absolute paths or verify the runtime working directory for relative paths.","Add a 'File exists' filter step so missing files are skipped or logged, not fatal.","Confirm executing agents mount the same shares as the dev machine.","Test dynamic filename patterns (dates/variables) against real filenames."],"tags":["pdi","kettle","filesystem","zip","vfs"],"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"}