pentaho/pentaho-kettle · error · KettleException

Error loading condition from the repository

Error message

Error loading condition from the repository (id_condition={id_condition})

What it means

Wrapper KettleException thrown by loadCondition when any KettleException (including database errors or the nested 'could not be found' error) occurs while reconstructing a condition from the repository. The original exception is chained as the cause. It signals a failed condition load, wrapping lower-level database problems behind a stable message.

Solutions

  1. Inspect the chained cause (getCause()) for the underlying database error
  2. Check repository database connectivity and health
  3. Validate the R_CONDITION rows for the given id_condition (parent/child linkage)
  4. Re-save or repair the affected transformation to rebuild condition data

Example fix

// before
Condition c = delegate.loadCondition(id); // opaque wrapper error

// after
try {
  c = delegate.loadCondition(id);
} catch (KettleException e) {
  log.error("Condition load failed", e.getCause()); // real DB error
  throw e;
}
Defensive patterns

Strategy: try-catch

Validate before calling

// ensure repo connectivity before loading
if (!repository.isConnected()) { repository.connect(user, pass); }

Try / catch

try { c = delegate.loadCondition(id); } catch (KettleException e) { Throwable root = e; while (root.getCause() != null) root = root.getCause(); log.error("Root cause: ", root); throw e; }

Prevention

When it happens

Trigger: Any SQLException/KettleDatabaseException during the condition read in loadCondition, or recursive loadCondition of sub-conditions failing, or the id lookup returning no rows.

Common situations: Repository database connection dropped mid-load, corrupted R_CONDITION rows, or missing child conditions referenced by a parent condition.

Understand the failure class

Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.

Related errors


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

Appendix: source

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

          long id_value = r.getInteger( "ID_VALUE_RIGHT", -1L );
          if ( id_value > 0 ) {
            ValueMetaAndData v = repository.loadValueMetaAndData( new LongObjectId( id_value ) );
            condition.setRightExact( v );
          }
        } else {
          for ( int i = 0; i < subids.length; i++ ) {
            condition.addCondition( loadCondition( subids[i] ) );
          }
        }

        return condition;
      } else {
        throw new KettleException( "Condition with id_condition="
          + id_condition + " could not be found in the repository" );
      }
    } catch ( KettleException dbe ) {
      throw new KettleException(
        "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 ) {

View on GitHub (pinned to f3058517a1)