pentaho/pentaho-kettle · error · KettleException

Error saving condition to the repository.

Error message

Error saving condition to the repository.

What it means

Wrapper KettleException thrown by saveCondition when writing the condition (or its sub-conditions) to R_CONDITION fails. The original KettleException/database error is chained as cause. It wraps insert/update failures plus recursive saves of child conditions behind a uniform message.

Solutions

  1. Check getCause() for the underlying database error
  2. Verify repository database connectivity and writability (disk space, read-only mode)
  3. Confirm the ID sequence/generator tables (R_REPOSITORY_LOG style sequences) are intact
  4. Retry the save; if it persists, repair the repository schema with the provided upgrade/repair scripts

Example fix

// before
conditionDelegate.saveCondition(condition); // may throw wrapped DB error

// after
try {
  conditionDelegate.saveCondition(condition);
} catch (KettleException e) {
  log.error("Save failed, cause:", e.getCause());
  throw e;
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (!repository.isConnected()) throw new IllegalStateException("Connect repository before saving conditions");

Try / catch

try { delegate.saveCondition(condition); } catch (KettleException e) { Throwable root = e; while (root.getCause() != null) root = root.getCause(); log.error("Save root cause: ", root); throw e; }

Prevention

When it happens

Trigger: insertCondition or the update path throws (e.g., sequence/ID generation failure, constraint violation, connection loss), or a recursive repository.saveCondition(subCondition, parentId) fails.

Common situations: Repository DB out of disk space or read-only, lost connection mid-save, sequence R_CONDITION ID generator exhausted or missing, FK constraint issues.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryConditionDelegate.java:110

        "Error loading condition from the repository (id_condition=" + id_condition + ")", dbe );
    }
  }

  public ObjectId saveCondition( Condition condition ) throws KettleException {
    return saveCondition( condition, null );
  }

  public ObjectId saveCondition( Condition condition, ObjectId id_condition_parent ) throws KettleException {
    try {
      condition.setObjectId( insertCondition( id_condition_parent, condition ) );
      for ( int i = 0; i < condition.nrConditions(); i++ ) {
        Condition subc = condition.getCondition( i );
        repository.saveCondition( subc, condition.getObjectId() );
      }

      return condition.getObjectId();
    } catch ( KettleException dbe ) {
      throw new KettleException( "Error saving condition to the repository.", dbe );
    }
  }

  public synchronized ObjectId insertCondition( ObjectId id_condition_parent, Condition condition ) throws KettleException {
    ObjectId id = repository.connectionDelegate.getNextConditionID();

    String tablename = KettleDatabaseRepository.TABLE_R_CONDITION;
    RowMetaAndData table = new RowMetaAndData();
    table.addValue( new ValueMetaInteger(
      KettleDatabaseRepository.FIELD_CONDITION_ID_CONDITION ), id );
    table.addValue(
      new ValueMetaInteger(
        KettleDatabaseRepository.FIELD_CONDITION_ID_CONDITION_PARENT ),
      id_condition_parent );
    table.addValue( new ValueMetaBoolean(
      KettleDatabaseRepository.FIELD_CONDITION_NEGATED ), Boolean
      .valueOf( condition.isNegated() ) );
    table.addValue( new ValueMetaString(

View on GitHub (pinned to f3058517a1)