{"record":{"id":"84d9e14c3b7cd15f","repo":"pentaho/pentaho-kettle","slug":"zipfile-error-targetfilenamefieldmissing","errorCode":null,"errorMessage":"ZipFile.Error.TargetFilenameFieldMissing","messagePattern":"ZipFile\\.Error\\.TargetFilenameFieldMissing","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/zipfile/ZipFile.java","lineNumber":90,"sourceCode":"\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 ) {\n        // The field is unreachable !\n        throw new KettleException( BaseMessages.getString( PKG, \"ZipFile.Exception.CouldnotFindField\", meta\n          .getDynamicTargetFileNameField() ) );\n      }","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/zipfile/ZipFile.java#L72-L108","documentation":"Thrown in ZipFile.processRow() when the 'target filename field' (the name of the .zip file to create, taken from a stream field) is not configured. Mirrors the source-field check immediately after it: both dynamic fields are mandatory for the step to operate.","triggerScenarios":"First processRow() call: source filename field passes the check, but meta.getDynamicTargetFileNameField() is null/empty, raising 'ZipFile.Error.TargetFilenameFieldMissing'.","commonSituations":"Zip File step saved without 'Target filename fieldname' selected, metadata lost during copy/migration of step XML, field setting cleared by a script or template that only set the source field.","solutions":["Open the Zip File step dialog and set the 'Target filename fieldname' to an incoming String field holding the zip path.","Confirm the upstream step provides that field and the name matches exactly (case-sensitive).","Re-open and re-save the step if metadata was migrated and the attribute went missing.","Validate the transformation XML/repository entry includes the target filename field attribute before execution."],"exampleFix":"// before: only source field configured\nzipFileMeta.setDynamicSourceFileNameField( \"filename\" );\nzipFileMeta.setDynamicTargetFileNameField( null );\n\n// after: configure both required fields\nzipFileMeta.setDynamicSourceFileNameField( \"filename\" );\nzipFileMeta.setDynamicTargetFileNameField( \"zip_filename\" );","handlingStrategy":"validation","validationCode":"if ( Utils.isEmpty( zipFileMeta.getDynamicTargetFileNameField() ) ) {\n  throw new KettleException( \"Zip File step requires 'Target filename fieldname' to be set\" );\n}","typeGuard":null,"tryCatchPattern":"try {\n  trans.execute( null );\n} catch ( KettleException e ) {\n  if ( e.getMessage() != null && e.getMessage().contains( \"TargetFilenameFieldMissing\" ) ) {\n    logError( \"Configure the Zip File step's target (zip) filename field and re-run\", e );\n  }\n}","preventionTips":["Configure source and target fields together, never one without the other.","Confirm the upstream step emits a field holding the zip output path.","Run a design-time preview to surface missing configuration before scheduling.","Document required upstream fields for the step in your transformation template."],"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"}