{"record":{"id":"672fc4b0b0c3877b","repo":"pentaho/pentaho-kettle","slug":"zipfile-error-sourcefileempty","errorCode":null,"errorMessage":"ZipFile.Error.SourceFileEmpty","messagePattern":"ZipFile\\.Error\\.SourceFileEmpty","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/zipfile/ZipFile.java","lineNumber":146,"sourceCode":"        if ( data.indexOfMoveToFolder < 0 ) {\n          // The field is unreachable !\n          throw new KettleException( BaseMessages.getString( PKG, \"ZipFile.Exception.CouldnotFindField\", meta\n            .getMoveToFolderField() ) );\n        }\n      }\n\n    } // End If first\n\n    boolean sendToErrorRow = false;\n    String errorMessage = null;\n\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 ) );","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/zipfile/ZipFile.java#L128-L164","documentation":"The source filename read from the current row is null or empty, so there is no file to zip. The step logs 'ZipFile.Error.SourceFileEmpty' and throws a KettleException, aborting processing of that row because zipping an unnamed file is meaningless.","triggerScenarios":"getInputRowMeta().getString(r, data.indexOfSourceFilename) returns null/empty string for the source filename field at ZipFile.java:146.","commonSituations":"Upstream step emitted a row with a null filename (e.g., a table lookup returned NULL); an input text file had a short/blank line; a filter or join produced empty filename values; wrong field selected so an unrelated empty column is read.","solutions":["Fix the upstream step so it always populates the source filename field before ZipFile.","Insert a Filter rows step to route rows with empty filenames to a separate stream or log.","Use a 'Value Mapper' or 'If field value is null' / NVL-like step to supply a default or skip.","Verify the correct field is selected as the source filename in the ZipFile dialog."],"exampleFix":"// before: rows flow straight into ZipFile with possibly null filename\n// after: add Filter rows step\n// filter: sourceFilename IS NOT NULL AND sourceFilename != \"\"","handlingStrategy":"validation","validationCode":"// In an upstream 'Filter rows' or user-defined Java expression:\n// condition: sourceFilename IS NOT NULL AND TRIM(sourceFilename) <> \"\"","typeGuard":null,"tryCatchPattern":"try {\n  transformation.execute();\n} catch (KettleException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"SourceFileEmpty\")) {\n    log.warn(\"Row skipped: empty source filename - fix upstream data\", e);\n  } else { throw e; }\n}","preventionTips":["Filter or default empty filename values upstream of ZipFile.","Use NVL/default-value steps on fields sourced from lookups or text inputs.","Preview data at the ZipFile input hop to catch nulls early."],"tags":["pdi","kettle","null-value","empty-string","zip"],"backgroundTag":"empty-required-field","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"}