{"record":{"id":"bdc9a96997537c43","repo":"pentaho/pentaho-kettle","slug":"jobentrywaitforsql-unableloadrep","errorCode":null,"errorMessage":"JobEntryWaitForSQL.UnableLoadRep","messagePattern":"JobEntryWaitForSQL\\.UnableLoadRep","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/entries/waitforsql/JobEntryWaitForSQL.java","lineNumber":277,"sourceCode":"    try {\n      connection = rep.loadDatabaseMetaFromJobEntryAttribute( id_jobentry, \"connection\", \"id_database\", databases );\n\n      schemaname = rep.getJobEntryAttributeString( id_jobentry, \"schemaname\" );\n      tablename = rep.getJobEntryAttributeString( id_jobentry, \"tablename\" );\n      successCondition =\n        getSuccessConditionByCode( Const.NVL(\n          rep.getJobEntryAttributeString( id_jobentry, \"success_condition\" ), \"\" ) );\n      rowsCountValue = rep.getJobEntryAttributeString( id_jobentry, \"rows_count_value\" );\n      iscustomSQL = rep.getJobEntryAttributeBoolean( id_jobentry, \"is_custom_sql\" );\n      isUseVars = rep.getJobEntryAttributeBoolean( id_jobentry, \"is_usevars\" );\n      isAddRowsResult = rep.getJobEntryAttributeBoolean( id_jobentry, \"add_rows_result\" );\n      customSQL = rep.getJobEntryAttributeString( id_jobentry, \"custom_sql\" );\n      maximumTimeout = rep.getJobEntryAttributeString( id_jobentry, \"maximum_timeout\" );\n      checkCycleTime = rep.getJobEntryAttributeString( id_jobentry, \"check_cycle_time\" );\n      successOnTimeout = rep.getJobEntryAttributeBoolean( id_jobentry, \"success_on_timeout\" );\n      isClearResultList = rep.getJobEntryAttributeBoolean( id_jobentry, \"clear_result_rows\" );\n    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleException( BaseMessages\n        .getString( PKG, \"JobEntryWaitForSQL.UnableLoadRep\", \"\" + id_jobentry ), dbe );\n    }\n  }\n\n  private static int getSuccessConditionByCode( String tt ) {\n    if ( tt == null ) {\n      return 0;\n    }\n\n    for ( int i = 0; i < successConditionsCode.length; i++ ) {\n      if ( successConditionsCode[i].equalsIgnoreCase( tt ) ) {\n        return i;\n      }\n    }\n    return 0;\n  }\n\n  @Override","sourceCodeStart":259,"sourceCodeEnd":295,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/entries/waitforsql/JobEntryWaitForSQL.java#L259-L295","documentation":"KettleException thrown by JobEntryWaitForSQL.loadRep when reading the job entry's attributes (connection, SQL, timeouts, cycle time, successOnTimeout, clearResultRows) from the repository fails with a KettleDatabaseException. It wraps the original DB exception and identifies the job entry by id. It indicates the repository metadata for this 'Wait for SQL' entry could not be loaded.","triggerScenarios":"Calling loadRep on a JobEntryWaitForSQL whose attributes cannot be read from the repository, e.g. the row for id_jobentry is missing/corrupt in R_JOBENTRY_ATTRIBUTE, the repository database connection is down, or a schema mismatch causes KettleDatabaseException.","commonSituations":"Corrupted or partially migrated Pentaho repository database; repository DB temporarily unavailable; opening an old kjb/job stored in a repository with a mismatched schema version.","solutions":["Verify the repository database is reachable and credentials are valid","Check R_JOBENTRY_ATTRIBUTE rows exist for the given id_jobentry and the schema matches your Pentaho version","Reopen/re-import the job or recreate the Wait For SQL job entry","Inspect the wrapped KettleDatabaseException cause for the underlying SQL error"],"exampleFix":"// before\njobEntry.loadRep(rep, metaStore, idJobentry, databases, slaveServers); // throws\n// after\ntry {\n  jobEntry.loadRep(rep, metaStore, idJobentry, databases, slaveServers);\n} catch (KettleException e) {\n  logError(\"Failed loading Wait For SQL entry \" + idJobentry + \": \" + e.getCause(), e);\n  // repair repository or recreate entry\n}","handlingStrategy":"try-catch","validationCode":"// before loadRep\nif (rep == null || idJobentry == null) throw new IllegalArgumentException(\"repository and id_jobentry required\");\n// optionally: verify connectivity with a cheap repository read","typeGuard":null,"tryCatchPattern":"try {\n  entry.loadRep(rep, metaStore, idJobentry, databases, slaveServers);\n} catch (KettleException e) {\n  logError(\"LoadRep failed for id=\" + idJobentry + \": \" + e.getCause(), e);\n  // fall back to default entry settings or abort job load\n}","preventionTips":["Keep repository database backups and schema migrations in sync with your Pentaho version","Monitor repository DB health before bulk job loads","Avoid hand-editing repository tables","Recreate job entries instead of patching corrupted rows"],"tags":["kettle","repository","database","job-entry"],"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"}