{"record":{"id":"8e304c4c7e9745e4","repo":"pentaho/pentaho-kettle","slug":"jobmeta-log-unabletoreaddatabaseidsfromrepository","errorCode":null,"errorMessage":"JobMeta.Log.UnableToReadDatabaseIDSFromRepository","messagePattern":"JobMeta\\.Log\\.UnableToReadDatabaseIDSFromRepository","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryJobDelegate.java","lineNumber":723,"sourceCode":"\n        // See if there already is one in the transformation\n        //\n        DatabaseMeta check = jobMeta.findDatabase( databaseMeta.getName() );\n\n        // We only add, never overwrite database connections.\n        //\n        if ( check == null || overWriteShared ) {\n          if ( databaseMeta.getName() != null ) {\n            jobMeta.getDatabaseManagementInterface().add( databaseMeta );\n            if ( !overWriteShared ) {\n              databaseMeta.setChanged( false );\n            }\n          }\n        }\n      }\n      jobMeta.setChanged( false );\n    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleException(\n        BaseMessages.getString( PKG, \"JobMeta.Log.UnableToReadDatabaseIDSFromRepository\" ), dbe );\n    } catch ( KettleException ke ) {\n      throw new KettleException(\n        BaseMessages.getString( PKG, \"JobMeta.Log.UnableToReadDatabasesFromRepository\" ), ke );\n    }\n  }\n\n  /**\n   * Read the slave servers in the repository and add them to this transformation if they are not yet present.\n   *\n   * @param jobMeta\n   *          The job to put the slave servers in\n   * @param overWriteShared\n   *          if an object with the same name exists, overwrite\n   * @throws KettleException\n   */\n  public void readSlaves( JobMeta jobMeta, boolean overWriteShared ) throws KettleException {\n    try {","sourceCodeStart":705,"sourceCodeEnd":741,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryJobDelegate.java#L705-L741","documentation":"readDatabases loads database connection definitions stored in the repository (R_DATABASE table) into the JobMeta. When reading their ids/rows raises a KettleDatabaseException, it is wrapped in this KettleException meaning 'unable to read database IDs from the repository'.","triggerScenarios":"Calling repository.readJobMeta / JobMeta load path that invokes KettleDatabaseRepositoryJobDelegate.readDatabases when querying R_DATABASE (or related id lookups) fails: missing/corrupt repository tables, dead connection, SQL error, or invalid rows.","commonSituations":"Opening a job from a repository while the metadata database is down or unreachable; repository schema version mismatch causing a missing column/table; corrupted R_DATABASE rows; connectivity timeouts.","solutions":["Inspect the chained KettleDatabaseException cause for the actual SQL/connection error.","Verify the repository metadata database is reachable and credentials are valid.","Repair/upgrade the repository tables (Repository upgrade scripts) to match your Kettle version.","Restart the repository connection (reconnect) and reload the job."],"exampleFix":"// before\nJobMeta job = (JobMeta) repository.loadJob(name, directory, monitor, null); // throws on unreadable R_DATABASE\n// after\ntry {\n  JobMeta job = (JobMeta) repository.loadJob(name, directory, monitor, null);\n} catch (KettleException e) {\n  if (!repository.isConnected()) repository.connect(repoMeta.getUsername(), repoMeta.getPassword());\n  // then retry load after checking the SQL error in e.getCause()\n}","handlingStrategy":"try-catch","validationCode":"if (!repository.isConnected()) { repository.connect(user, password); }\n// optionally check repository meta tables exist before loading:\n// repository.getDatabaseMeta().testConnection()","typeGuard":null,"tryCatchPattern":"try {\n  JobMeta job = (JobMeta) repository.loadJob(name, dir, monitor, null);\n} catch (KettleException e) {\n  logError(\"Could not read databases from repository: \" + (e.getCause() != null ? e.getCause().getMessage() : e.getMessage()), e);\n  // reconnect or run repository repair, then retry\n}","preventionTips":["Test the repository DB connection before opening jobs.","Keep repository upgrade scripts current with your Kettle version.","Avoid sharing repositories across mismatched Kettle versions.","Back up repository metadata before upgrades."],"tags":["database","repository","read-failure","jobmeta"],"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"}