pentaho/pentaho-kettle · error · KettleException

ZipFile.Exception.EmptyMovetoFolder

Error message

ZipFile.Exception.EmptyMovetoFolder

What it means

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.

Solutions

  1. Open the ZipFile step, and with operation=Move, set the 'move to folder' field to an existing input field.
  2. If no move is desired, change the operation type back to Zip or Add.
  3. When building ZipFileMeta in code, call setMoveToFolderField(...) before execution.

Example fix

// before
meta.setOperationType(ZipFileMeta.OPERATION_TYPE_MOVE);
// move-to-folder field left null
// after
meta.setOperationType(ZipFileMeta.OPERATION_TYPE_MOVE);
meta.setMoveToFolderField("targetFolder");
Defensive patterns

Strategy: validation

Validate before calling

// Validate metadata consistency before execution
if (zipFileMeta.getOperationType() == ZipFileMeta.OPERATION_TYPE_MOVE
    && (zipFileMeta.getMoveToFolderField() == null
        || zipFileMeta.getMoveToFolderField().isEmpty())) {
  throw new IllegalArgumentException("ZipFile: operation is MOVE but move-to-folder field is empty");
}

Try / catch

try {
  transformation.execute();
} catch (KettleException e) {
  if (e.getMessage() != null && e.getMessage().contains("EmptyMovetoFolder")) {
    log.error("ZipFile MOVE operation requires a move-to-folder field", e);
  } else { throw e; }
}

Prevention

When it happens

Trigger: meta.getOperationType() == ZipFileMeta.OPERATION_TYPE_MOVE and Utils.isEmpty(meta.getMoveToFolderField()) is true at ZipFile.java:125.

Common situations: 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.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/3d2189c5a5b31366. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/zipfile/ZipFile.java:125

          .getDynamicTargetFileNameField() ) );
      }

      if ( meta.isKeepSouceFolder() ) {
        if ( !Utils.isEmpty( meta.getBaseFolderField() ) ) {
          // cache the position of the source filename field
          data.indexOfBaseFolder = getInputRowMeta().indexOfValue( meta.getBaseFolderField() );
          if ( data.indexOfBaseFolder < 0 ) {
            // The field is unreachable !
            throw new KettleException( BaseMessages.getString( PKG, "ZipFile.Exception.CouldnotFindField", meta
              .getBaseFolderField() ) );
          }
        }
      }

      // Move to folder
      if ( meta.getOperationType() == ZipFileMeta.OPERATION_TYPE_MOVE ) {
        if ( Utils.isEmpty( meta.getMoveToFolderField() ) ) {
          throw new KettleException( BaseMessages.getString( PKG, "ZipFile.Exception.EmptyMovetoFolder" ) );
        }
        data.indexOfMoveToFolder = getInputRowMeta().indexOfValue( meta.getMoveToFolderField() );
        if ( data.indexOfMoveToFolder < 0 ) {
          // The field is unreachable !
          throw new KettleException( BaseMessages.getString( PKG, "ZipFile.Exception.CouldnotFindField", meta
            .getMoveToFolderField() ) );
        }
      }

    } // End If first

    boolean sendToErrorRow = false;
    String errorMessage = null;

    try {
      // get source filename
      String sourceFilename = getInputRowMeta().getString( r, data.indexOfSourceFilename );

View on GitHub (pinned to f3058517a1)