{"record":{"id":"8b8f76068a9cc617","repo":"pentaho/pentaho-kettle","slug":"error-loading-condition-from-the-repository-id-condition-id","errorCode":null,"errorMessage":"Error loading condition from the repository (id_condition={id_condition})","messagePattern":"Error loading condition from the repository \\(id_condition=(.+?)\\)","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryConditionDelegate.java","lineNumber":91,"sourceCode":"\n          long id_value = r.getInteger( \"ID_VALUE_RIGHT\", -1L );\n          if ( id_value > 0 ) {\n            ValueMetaAndData v = repository.loadValueMetaAndData( new LongObjectId( id_value ) );\n            condition.setRightExact( v );\n          }\n        } else {\n          for ( int i = 0; i < subids.length; i++ ) {\n            condition.addCondition( loadCondition( subids[i] ) );\n          }\n        }\n\n        return condition;\n      } else {\n        throw new KettleException( \"Condition with id_condition=\"\n          + id_condition + \" could not be found in the repository\" );\n      }\n    } catch ( KettleException dbe ) {\n      throw new KettleException(\n        \"Error loading condition from the repository (id_condition=\" + id_condition + \")\", dbe );\n    }\n  }\n\n  public ObjectId saveCondition( Condition condition ) throws KettleException {\n    return saveCondition( condition, null );\n  }\n\n  public ObjectId saveCondition( Condition condition, ObjectId id_condition_parent ) throws KettleException {\n    try {\n      condition.setObjectId( insertCondition( id_condition_parent, condition ) );\n      for ( int i = 0; i < condition.nrConditions(); i++ ) {\n        Condition subc = condition.getCondition( i );\n        repository.saveCondition( subc, condition.getObjectId() );\n      }\n\n      return condition.getObjectId();\n    } catch ( KettleException dbe ) {","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryConditionDelegate.java#L73-L109","documentation":"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.","triggerScenarios":"Any SQLException/KettleDatabaseException during the condition read in loadCondition, or recursive loadCondition of sub-conditions failing, or the id lookup returning no rows.","commonSituations":"Repository database connection dropped mid-load, corrupted R_CONDITION rows, or missing child conditions referenced by a parent condition.","solutions":["Inspect the chained cause (getCause()) for the underlying database error","Check repository database connectivity and health","Validate the R_CONDITION rows for the given id_condition (parent/child linkage)","Re-save or repair the affected transformation to rebuild condition data"],"exampleFix":"// before\nCondition c = delegate.loadCondition(id); // opaque wrapper error\n\n// after\ntry {\n  c = delegate.loadCondition(id);\n} catch (KettleException e) {\n  log.error(\"Condition load failed\", e.getCause()); // real DB error\n  throw e;\n}","handlingStrategy":"try-catch","validationCode":"// ensure repo connectivity before loading\nif (!repository.isConnected()) { repository.connect(user, pass); }","typeGuard":null,"tryCatchPattern":"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; }","preventionTips":["Always log getCause() to find the real DB error","Monitor repository DB health before bulk loads","Keep R_CONDITION parent/child rows consistent","Re-save transformations that fail condition loads after upgrades"],"tags":["repository","condition","error-wrapper"],"backgroundTag":"database-query-failed","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}