{"record":{"id":"7c9a6317ba5b6e66","repo":"pentaho/pentaho-kettle","slug":"zipfile-error-sourcefilenamefieldmissing","errorCode":null,"errorMessage":"ZipFile.Error.SourceFilenameFieldMissing","messagePattern":"ZipFile\\.Error\\.SourceFilenameFieldMissing","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/zipfile/ZipFile.java","lineNumber":86,"sourceCode":"    data = (ZipFileData) sdi;\n\n    Object[] r = getRow(); // Get row from input rowset & set row busy!\n    if ( r == null ) { // no more input to be expected...\n\n      setOutputDone();\n      return false;\n    }\n\n    if ( first ) {\n      first = false;\n\n      data.outputRowMeta = getInputRowMeta().clone();\n      meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this,\n        getTrans().getRepository(), getTrans().getMetaStore() );\n\n      // Check is source filename field is provided\n      if ( Utils.isEmpty( meta.getDynamicSourceFileNameField() ) ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"ZipFile.Error.SourceFilenameFieldMissing\" ) );\n      }\n      // Check is target filename field is provided\n      if ( Utils.isEmpty( meta.getDynamicTargetFileNameField() ) ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"ZipFile.Error.TargetFilenameFieldMissing\" ) );\n      }\n\n      // cache the position of the source filename field\n      if ( data.indexOfSourceFilename < 0 ) {\n        data.indexOfSourceFilename = getInputRowMeta().indexOfValue( meta.getDynamicSourceFileNameField() );\n        if ( data.indexOfSourceFilename < 0 ) {\n          // The field is unreachable !\n          throw new KettleException( BaseMessages.getString( PKG, \"ZipFile.Exception.CouldnotFindField\", meta\n            .getDynamicSourceFileNameField() ) );\n        }\n      }\n\n      data.indexOfZipFilename = getInputRowMeta().indexOfValue( meta.getDynamicTargetFileNameField() );\n      if ( data.indexOfZipFilename < 0 ) {","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/zipfile/ZipFile.java#L68-L104","documentation":"Thrown in ZipFile.processRow() during initialization when the 'source filename field' (dynamic source file name) is not configured in the step metadata. The Zip File step zips files whose names come from an incoming stream field, so this field must be set; Utils.isEmpty treats null or empty string as missing.","triggerScenarios":"First call to processRow() after getFields(): if meta.getDynamicSourceFileNameField() is null/empty, the KettleException 'ZipFile.Error.SourceFilenameFieldMissing' is thrown and the step fails to start.","commonSituations":"Step dialog saved without selecting the 'Source filename fieldname', transformation XML or repository entry missing that attribute (hand-edited or partial migration), field option reset after upgrading a transformation.","solutions":["Open the Zip File step dialog and set the 'Source filename fieldname' to an incoming String field containing file paths.","Ensure the upstream step actually supplies a filename field and map its name exactly in the dialog.","If migrating/copied transformations, re-open and re-save the step to regenerate missing metadata attributes.","Validate the saved .ktr XML contains the dynamic source filename field tag before deploying."],"exampleFix":"// before: metadata without source field configured\nzipFileMeta.setDynamicSourceFileNameField( null );\n\n// after: set the field coming from the previous step\nzipFileMeta.setDynamicSourceFileNameField( \"filename\" ); // must match an incoming field","handlingStrategy":"validation","validationCode":"if ( Utils.isEmpty( zipFileMeta.getDynamicSourceFileNameField() ) ) {\n  throw new KettleException( \"Zip File step requires 'Source filename fieldname' to be set\" );\n}","typeGuard":null,"tryCatchPattern":"try {\n  trans.execute( null ); // run transformation containing the Zip File step\n} catch ( KettleException e ) {\n  if ( e.getMessage() != null && e.getMessage().contains( \"SourceFilenameFieldMissing\" ) ) {\n    logError( \"Configure the Zip File step's source filename field and re-run\", e );\n  }\n}","preventionTips":["Always fill both source and target filename fields in the Zip File dialog.","Preview the upstream step to confirm the field names before wiring the Zip File step.","Re-open and re-save migrated steps to regenerate missing metadata.","Validate transformation XML includes the field attributes before deployment."],"tags":["pdi","zipfile","configuration","missing-field"],"backgroundTag":"missing-required-config-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"}