pentaho/pentaho-kettle · error · KettleException

TransMeta.Log.ErrorSavingTransformationToRepository

TransMeta.Log.ErrorSavingTransformationToRepository

Error message

Error saving transformation to repository!

What it means

Wrapper thrown by saveTransformation when any inner repository operation raises a KettleDatabaseException. The repository transaction is rolled back first, the underlying DB error is logged, and a KettleException with this message plus the original cause is rethrown. It means the transformation save failed at the database layer and nothing was committed.

Solutions

  1. Inspect the cause (dbe) logged with this message for the real SQL/DB error and fix that root problem first.
  2. Verify repository connectivity and credentials; retry the save after restoring the connection.
  3. Confirm the repository tables exist and match the expected version (run repository upgrade/creation scripts).
  4. Shorten oversized metadata (names, descriptions) that may exceed column limits.

Example fix

// before
repository.save(transMeta, versionComment, monitor, null); // KettleException wraps DB failure
// after
try {
  repository.save(transMeta, versionComment, monitor, null);
} catch (KettleException e) {
  log.logError("Save failed, cause: " + e.getCause(), e); // examine root KettleDatabaseException
  if (repositoryConnected()) {
    throw e;
  }
  // restore connection then retry
}
Defensive patterns

Strategy: try-catch

Validate before calling

// verify repository reachable before saving
if (!repository.isConnected() || repository.getConnection().getConnection() == null) { repository.connect(user, password); }

Try / catch

try { repository.save(transMeta, comment, monitor, null); } catch (KettleException e) { Throwable root = deepestCause(e); log.logError("Save failed: " + root.getMessage(), root); throw e; }

Prevention

When it happens

Trigger: Any KettleDatabaseException during save of transformation metadata: inserting/updating the transformation row, steps, hops, notes, slave servers, cluster schemas, dependencies, or parameters (e.g. constraint violations, connection loss, oversized columns).

Common situations: Repository database down or network dropped mid-save; schema mismatch after upgrading Pentaho/Kettle against an old repository; duplicate transformation name under repository-enforced uniqueness; field length exceeded by very long step descriptions.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryTransDelegate.java:405

      repository.unlockRepository();

      // Perform a commit!
      repository.commit();

      transMeta.clearChanged();
      if ( monitor != null ) {
        monitor.worked( 1 );
      }
      if ( monitor != null ) {
        monitor.done();
      }
    } catch ( KettleDatabaseException dbe ) {
      // Oops, roll back!
      repository.rollback();

      log.logError( BaseMessages.getString( PKG, "TransMeta.Log.ErrorSavingTransformationToRepository" )
        + Const.CR + dbe.getMessage() );
      throw new KettleException( BaseMessages.getString(
        PKG, "TransMeta.Log.ErrorSavingTransformationToRepository" ), dbe );
    }
  }

  /**
   * Save the parameters of this transformation to the repository.
   *
   *
   * @throws KettleException
   *           Upon any error.
   *
   *
   *           TODO: Move this code over to the Repository class for refactoring...
   */
  public void saveTransParameters( TransMeta transMeta ) throws KettleException {
    String[] paramKeys = transMeta.listParameters();
    for ( int idx = 0; idx < paramKeys.length; idx++ ) {
      String desc = transMeta.getParameterDescription( paramKeys[idx] );

View on GitHub (pinned to f3058517a1)