{"record":{"id":"49a3163e07dd0248","repo":"pentaho/pentaho-kettle","slug":"jobentrysetvariables-meta-unableloadrep","errorCode":null,"errorMessage":"JobEntrySetVariables.Meta.UnableLoadRep","messagePattern":"JobEntrySetVariables\\.Meta\\.UnableLoadRep","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/entries/setvariables/JobEntrySetVariables.java","lineNumber":191,"sourceCode":"    List<SlaveServer> slaveServers ) throws KettleException {\n    try {\n      replaceVars = rep.getJobEntryAttributeBoolean( id_jobentry, \"replacevars\" );\n\n      filename = rep.getJobEntryAttributeString( id_jobentry, \"filename\" );\n      fileVariableType = getVariableType( rep.getJobEntryAttributeString( id_jobentry, \"file_variable_type\" ) );\n\n      // How many variableName?\n      int argnr = rep.countNrJobEntryAttributes( id_jobentry, \"variable_name\" );\n      allocate( argnr );\n\n      // Read them all...\n      for ( int a = 0; a < argnr; a++ ) {\n        variableName[a] = rep.getJobEntryAttributeString( id_jobentry, a, \"variable_name\" );\n        variableValue[a] = rep.getJobEntryAttributeString( id_jobentry, a, \"variable_value\" );\n        variableType[a] = getVariableType( rep.getJobEntryAttributeString( id_jobentry, a, \"variable_type\" ) );\n      }\n    } catch ( KettleException dbe ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"JobEntrySetVariables.Meta.UnableLoadRep\", String\n        .valueOf( id_jobentry ), dbe.getMessage() ), dbe );\n    }\n  }\n\n  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_job ) throws KettleException {\n    try {\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"replacevars\", replaceVars );\n\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"filename\", filename );\n      rep.saveJobEntryAttribute(\n        id_job, getObjectId(), \"file_variable_type\", getVariableTypeCode( fileVariableType ) );\n\n      // save the variableName...\n      if ( variableName != null ) {\n        for ( int i = 0; i < variableName.length; i++ ) {\n          rep.saveJobEntryAttribute( id_job, getObjectId(), i, \"variable_name\", variableName[i] );\n          rep.saveJobEntryAttribute( id_job, getObjectId(), i, \"variable_value\", variableValue[i] );\n          rep.saveJobEntryAttribute(","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/entries/setvariables/JobEntrySetVariables.java#L173-L209","documentation":"This KettleException is thrown in loadRep when reading the Set Variables entry's variable rows (variable_name, variable_value, variable_type) from the repository fails with a KettleException. The message includes the id_jobentry and the underlying error text, with the original exception chained as cause. It identifies a repository read failure for this entry's variable list.","triggerScenarios":"Loading the entry from a repository when rep.getJobEntryAttributeString(id, a, ...) throws: DB unavailable, missing/corrupt attribute rows for the stored variable count (argnr), or invalid id_jobentry.","commonSituations":"Repository rows partially deleted after a failed save; argnr (nr of variables) stored larger than actual attribute rows; repository migration lost data; DB connectivity blips.","solutions":["Check the chained cause for the real DB error and restore repository connectivity","Verify R_JOBENTRY_ATTRIBUTE rows for this id_jobentry; re-save the entry from Spoon to rewrite them","If row counts mismatch, correct or delete the entry's attribute rows and re-enter variables in Spoon","Repair the repository schema with Pentaho repair tools if corruption is widespread"],"exampleFix":"// before\nentry.loadRep(rep, metaStore, idJobentry, databases, slaveServers);\n// after\ntry {\n  entry.loadRep(rep, metaStore, idJobentry, databases, slaveServers);\n} catch (KettleException e) {\n  logError(\"Cannot load Set Variables entry \" + idJobentry + \": \" + e.getMessage(), e);\n  // inspect R_JOBENTRY_ATTRIBUTE rows, then re-save entry\n}","handlingStrategy":"try-catch","validationCode":"if (id_jobentry == null) throw new IllegalArgumentException(\"id_jobentry is null\");\nif (!rep.isConnected()) throw new IllegalStateException(\"Repository not connected\");","typeGuard":null,"tryCatchPattern":"try {\n  entry.loadRep(rep, metaStore, idJobentry, databases, slaveServers);\n} catch (KettleException e) {\n  logError(\"Repository load failed for id \" + id_jobentry + \": \" + e.getMessage(), e);\n  // verify attribute rows / re-save entry from Spoon\n}","preventionTips":["Keep repository DB backups and verify after migrations","Re-save job entries after repository restores to rewrite attributes","Match PDI client and repository schema versions","Monitor DB connectivity during batch job loading"],"tags":["pdi","repository","persistence"],"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"}