pentaho/pentaho-kettle · error · InvocationTargetException

Spoon.RipDB.Exception.UnableToSaveTransformationToRepository

Spoon.RipDB.Exception.UnableToSaveTransformationToRepository

Error message

Spoon.RipDB.Exception.UnableToSaveTransformationToRepository

What it means

During the 'Rip database' wizard, SpoonJobDelegate saves the transformation (to repository or file) after creating the target table. If the save fails and returns false, it wraps an InvocationTargetException with localized message Spoon.RipDB.Exception.UnableToSaveTransformationToRepository.

Solutions

  1. Ensure the transformation has a valid name and target filename/repository path before running the rip wizard.
  2. Verify repository connectivity and credentials before starting the rip operation.
  3. Check disk space and write permissions for the target .ktr file location.
  4. Confirm the target repository directory exists, then retry the rip.

Example fix

// before
ok = spoon.saveToFile( transMeta ); // fails when transMeta.getFilename() is null
// after
if ( transMeta.getFilename() == null || transMeta.getFilename().length() == 0 ) {
  // prompt the user for a filename first
}
ok = spoon.saveToFile( transMeta );
Defensive patterns

Strategy: validation

Validate before calling

if (transMeta.getName() == null || transMeta.getName().isEmpty()) { /* set a name first */ }
if (spoon.getRepository() != null && !spoon.getRepository().isConnected()) { /* reconnect first */ }

Try / catch

try {
  ripAndSave(transMeta);
} catch (InvocationTargetException e) {
  if (e.getMessage() != null && e.getMessage().contains("UnableToSaveTransformationToRepository")) {
    // prompt user to pick a filename/repository directory and retry
  }
}

Prevention

When it happens

Trigger: ripping a DB where spoon.saveToRepository(transMeta, false) or spoon.saveToFile(transMeta) returns false: no filename set, repository save rejected or cancelled, or an I/O error writing the .ktr file.

Common situations: User cancels the save dialog; repository connection dropped mid-save; transformation has no name/filename so saveToFile aborts; insufficient repository permissions or missing repository directory.

Understand the failure class

Background: "failed to write file", "Could not save figure", "Error saving remote file" — file write failed: causes and fixes across languages and libraries — this error's family across 38 libraries.

Related errors


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

Appendix: source

Thrown at ui/src/main/java/org/pentaho/di/ui/spoon/delegates/SpoonJobDelegate.java:707

        BaseMessages.getString( PKG, "Spoon.ErrorDialog.RipDB.ErrorRippingTheDatabase.Message" ), e );
      return null;
    } finally {
      spoon.refreshGraph();
      spoon.refreshTree();
    }

    return jobMeta;
  }

  private void saveTransformation( TransMeta transMeta ) throws KettleException, InvocationTargetException {
    boolean ok;
    if ( spoon.getRepository() != null ) {
      ok = spoon.saveToRepository( transMeta, false );
    } else {
      ok = spoon.saveToFile( transMeta );
    }
    if ( !ok ) {
      throw new InvocationTargetException( new Exception(
        BaseMessages.getString( PKG, "Spoon.RipDB.Exception.UnableToSaveTransformationToRepository" ) ),
        BaseMessages.getString( PKG, "Spoon.RipDB.Exception.UnableToSaveTransformationToRepository" ) );
    }
  }

  private String getSQLString( DatabaseMeta sourceDbInfo, TableInputMeta tii, TransMeta transMeta )
    throws InvocationTargetException {
    // First set the limit to 1 to speed things up!
    String tmpSql = tii.getSQL();
    tii.setSQL( tii.getSQL() + sourceDbInfo.getLimitClause( 1 ) );
    String sql;
    try {
      sql = transMeta.getSQLStatementsString();
    } catch ( KettleStepException kse ) {
      throw new InvocationTargetException( kse, BaseMessages.getString(
        PKG, "Spoon.RipDB.Exception.ErrorGettingSQLFromTransformation" )
        + transMeta + "] : " + kse.getMessage() );
    }

View on GitHub (pinned to f3058517a1)