{"record":{"id":"30f58ab0a48c934a","repo":"pentaho/pentaho-kettle","slug":"mail-log-zipfilenameempty","errorCode":null,"errorMessage":"Mail.Log.ZipFilenameEmpty","messagePattern":"Mail\\.Log\\.ZipFilenameEmpty","errorType":"validation","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/mail/impl/src/main/java/org/pentaho/di/trans/steps/mail/Mail.java","lineNumber":505,"sourceCode":"\n    // check authentication\n    if ( meta.isUsingAuthentication().equals( AUTENTICATION_BASIC ) ) {\n      // check authentication user\n      if ( Utils.isEmpty( meta.getAuthenticationUser() ) ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"Mail.Log.AuthenticationUserFieldEmpty\" ) );\n      }\n\n      // check authentication pass\n      if ( Utils.isEmpty( meta.getAuthenticationPassword() ) ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"Mail.Log.AuthenticationPasswordFieldEmpty\" ) );\n      }\n    }\n  }\n\n  @VisibleForTesting\n  void validateZipFiles( MailMeta meta ) throws KettleException {\n    if ( meta.isZipFiles() && ( Utils.isEmpty( meta.getZipFilename() ) && !meta.isZipFilenameDynamic() ) ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"Mail.Log.ZipFilenameEmpty\" ) );\n    }\n  }\n\n  @VisibleForTesting\n  void processAttachedFiles() throws KettleException {\n    if ( meta.isDynamicFilename() ) {\n      // cache the position of the attached source filename field\n      cacheSourceFileNameField();\n      // cache the position of the attached wildcard field\n      cacheWildCardField();\n    } else {\n      // static attached filenames\n      data.realSourceFileFoldername = environmentSubstitute( meta.getSourceFileFoldername() );\n      data.realSourceWildcard = environmentSubstitute( meta.getSourceWildcard() );\n    }\n  }\n\n  private void cacheWildCardField() throws KettleException {","sourceCodeStart":487,"sourceCodeEnd":523,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/mail/impl/src/main/java/org/pentaho/di/trans/steps/mail/Mail.java#L487-L523","documentation":"Thrown by Mail.validateZipFiles (invoked from validateMetaFields) when the step is configured to zip attachments (meta.isZipFiles() is true), the zip filename is not dynamic, and meta.getZipFilename() is empty. With zipping enabled and no dynamic field, a static zip file name is mandatory, so the step aborts during processRow.","triggerScenarios":"Enabling 'zip attachments' in the Mail step with the Zip Filename field left blank and the dynamic zip option off; code-built MailMeta with setZipFiles(true) but neither setZipFilename(...) nor dynamic mode.","commonSituations":"Toggling zip on and forgetting the filename; the static zip name removed during a config cleanup while dynamic mode was not enabled; transformations copied between projects losing the zip filename value.","solutions":["Set the static Zip Filename in the Mail step dialog (e.g. /tmp/attachments.zip).","Call meta.setZipFilename(\"/tmp/attachments.zip\") in code, or enable dynamic mode and set the dynamic zip field instead.","If zipping is unnecessary, disable the zip-files option."],"exampleFix":"// before\nmeta.setZipFiles(true);\n// after\nmeta.setZipFiles(true);\nmeta.setZipFilename(\"/tmp/attachments.zip\");","handlingStrategy":"validation","validationCode":"if ( meta.isZipFiles() && !meta.isZipFilenameDynamic()\n     && ( meta.getZipFilename() == null || meta.getZipFilename().trim().isEmpty() ) ) {\n  throw new IllegalArgumentException(\"Mail step: zip filename required when zipping without dynamic field\");\n}","typeGuard":null,"tryCatchPattern":"try { transformation.execute(); } catch ( KettleException e ) { if ( e.getMessage().contains(\"ZipFilenameEmpty\") ) { /* set zipFilename or enable dynamic zip */ } else { throw e; } }","preventionTips":["Whenever enabling zip, set either a static filename or a dynamic field","Review zip-related settings together as a unit","Test mail-with-attachments transformations in staging before production"],"tags":["kettle","mail-step","zip","validation"],"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"}