{"record":{"id":"f85b23f235fcdfa7","repo":"pentaho/pentaho-kettle","slug":"tableexists-meta-unableloadrep","errorCode":null,"errorMessage":"TableExists.Meta.UnableLoadRep","messagePattern":"TableExists\\.Meta\\.UnableLoadRep","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/entries/tableexists/JobEntryTableExists.java","lineNumber":108,"sourceCode":"\n      tablename = XMLHandler.getTagValue( entrynode, \"tablename\" );\n      schemaname = XMLHandler.getTagValue( entrynode, \"schemaname\" );\n      String dbname = XMLHandler.getTagValue( entrynode, \"connection\" );\n      connection = DatabaseMeta.findDatabase( databases, dbname );\n    } catch ( KettleException e ) {\n      throw new KettleXMLException( BaseMessages.getString( PKG, \"TableExists.Meta.UnableLoadXml\" ), e );\n    }\n  }\n\n  public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,\n    List<SlaveServer> slaveServers ) throws KettleException {\n    try {\n      tablename = rep.getJobEntryAttributeString( id_jobentry, \"tablename\" );\n      schemaname = rep.getJobEntryAttributeString( id_jobentry, \"schemaname\" );\n\n      connection = rep.loadDatabaseMetaFromJobEntryAttribute( id_jobentry, \"connection\", \"id_database\", databases );\n    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleException(\n        BaseMessages.getString( PKG, \"TableExists.Meta.UnableLoadRep\", \"\" + id_jobentry ), 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(), \"tablename\", tablename );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"schemaname\", schemaname );\n\n      rep.saveDatabaseMetaJobEntryAttribute( id_job, getObjectId(), \"connection\", \"id_database\", connection );\n    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"TableExists.Meta.UnableSaveRep\", \"\" + id_job ), dbe );\n    }\n  }\n\n  public void setTablename( String tablename ) {\n    this.tablename = tablename;\n  }","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/entries/tableexists/JobEntryTableExists.java#L90-L126","documentation":"JobEntryTableExists.loadRep wraps any KettleDatabaseException thrown while reading tablename, schemaname and the connection attribute from the repository into a KettleException with the localized 'TableExists.Meta.UnableLoadRep' message (with id_jobentry interpolated) and the original as cause. It means repository persistence for this entry could not be read.","triggerScenarios":"Calling loadRep when rep.loadDatabaseMetaFromJobEntryAttribute or the getJobEntryAttributeString calls throw: missing id_jobentry row, broken repository connection, or corrupted connection/id_database reference columns.","commonSituations":"Repository database upgraded/migrated with attribute rows lost; job copied between repositories where referenced database connection IDs no longer exist; transient DB outage during job load.","solutions":["Check the chained KettleDatabaseException cause for the real SQL/connection error","Verify the id_jobentry exists in r_jobentry_attribute with tablename/schemaname/connection rows","Confirm the referenced database connection exists in the target repository","Re-save the job entry from Spoon to rewrite its repository attributes","Test and repair the repository connection before reloading the job"],"exampleFix":"// before: load fails after repo migration lost connection rows\nentry.loadRep(rep, metaStore, id_jobentry, databases, slaveServers); // throws\n// after: guard on existence and restore connection first\nDatabaseMeta db = DatabaseMeta.findDatabase(databases, \"MY_CONN\");\nif (db != null) {\n  entry.loadRep(rep, metaStore, id_jobentry, databases, slaveServers);\n}","handlingStrategy":"try-catch","validationCode":"// Java: verify repository reachability and attribute rows before loadRep\nif (rep == null || !rep.isConnected()) {\n  throw new KettleException(\"Repository not connected\");\n}","typeGuard":"if (id_jobentry != null && rep != null && rep.isConnected()) { /* safe to loadRep */ }","tryCatchPattern":"try {\n  entry.loadRep(rep, metaStore, id_jobentry, databases, slaveServers);\n} catch (KettleException e) {\n  logError(\"TableExists repo load failed for \" + id_jobentry + \": \" + e.getCause(), e);\n  // re-establish repo connection and retry\n}","preventionTips":["Check repository connection health before loading jobs","Verify attribute rows survive repository migrations","Ensure referenced database connections exist in the target repository","Re-save entries in Spoon after cross-repository copies"],"tags":["pentaho-kettle","repository","database"],"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"}