{"record":{"id":"3d2189c5a5b31366","repo":"pentaho/pentaho-kettle","slug":"zipfile-exception-emptymovetofolder","errorCode":null,"errorMessage":"ZipFile.Exception.EmptyMovetoFolder","messagePattern":"ZipFile\\.Exception\\.EmptyMovetoFolder","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/zipfile/ZipFile.java","lineNumber":125,"sourceCode":"          .getDynamicTargetFileNameField() ) );\n      }\n\n      if ( meta.isKeepSouceFolder() ) {\n        if ( !Utils.isEmpty( meta.getBaseFolderField() ) ) {\n          // cache the position of the source filename field\n          data.indexOfBaseFolder = getInputRowMeta().indexOfValue( meta.getBaseFolderField() );\n          if ( data.indexOfBaseFolder < 0 ) {\n            // The field is unreachable !\n            throw new KettleException( BaseMessages.getString( PKG, \"ZipFile.Exception.CouldnotFindField\", meta\n              .getBaseFolderField() ) );\n          }\n        }\n      }\n\n      // Move to folder\n      if ( meta.getOperationType() == ZipFileMeta.OPERATION_TYPE_MOVE ) {\n        if ( Utils.isEmpty( meta.getMoveToFolderField() ) ) {\n          throw new KettleException( BaseMessages.getString( PKG, \"ZipFile.Exception.EmptyMovetoFolder\" ) );\n        }\n        data.indexOfMoveToFolder = getInputRowMeta().indexOfValue( meta.getMoveToFolderField() );\n        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","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/zipfile/ZipFile.java#L107-L143","documentation":"The step operation is MOVE, which requires a 'move to folder' field, but the configured field name is empty in the step metadata. The step validates this during first-row processing and throws immediately because moving a zipped file is impossible without a destination folder.","triggerScenarios":"meta.getOperationType() == ZipFileMeta.OPERATION_TYPE_MOVE and Utils.isEmpty(meta.getMoveToFolderField()) is true at ZipFile.java:125.","commonSituations":"User switched the operation from Zip/Add to Move but left the 'move to folder' field blank; step metadata loaded from an old repository export missing the setting; programmatic metadata construction omitted setMoveToFolderField.","solutions":["Open the ZipFile step, and with operation=Move, set the 'move to folder' field to an existing input field.","If no move is desired, change the operation type back to Zip or Add.","When building ZipFileMeta in code, call setMoveToFolderField(...) before execution."],"exampleFix":"// before\nmeta.setOperationType(ZipFileMeta.OPERATION_TYPE_MOVE);\n// move-to-folder field left null\n// after\nmeta.setOperationType(ZipFileMeta.OPERATION_TYPE_MOVE);\nmeta.setMoveToFolderField(\"targetFolder\");","handlingStrategy":"validation","validationCode":"// Validate metadata consistency before execution\nif (zipFileMeta.getOperationType() == ZipFileMeta.OPERATION_TYPE_MOVE\n    && (zipFileMeta.getMoveToFolderField() == null\n        || zipFileMeta.getMoveToFolderField().isEmpty())) {\n  throw new IllegalArgumentException(\"ZipFile: operation is MOVE but move-to-folder field is empty\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  transformation.execute();\n} catch (KettleException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"EmptyMovetoFolder\")) {\n    log.error(\"ZipFile MOVE operation requires a move-to-folder field\", e);\n  } else { throw e; }\n}","preventionTips":["Whenever you change the operation type, revisit all dependent settings in the dialog.","Centralize ZipFileMeta construction so operation-specific fields are set together.","Validate metadata programmatically before submitting jobs to a scheduler."],"tags":["pdi","kettle","missing-field","zip","configuration"],"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"}