pentaho/pentaho-kettle · error · KettleException

JobMeta.Log.UnableToReadDatabaseIDSFromRepository

Error message

JobMeta.Log.UnableToReadDatabaseIDSFromRepository

What it means

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'.

Solutions

  1. Inspect the chained KettleDatabaseException cause for the actual SQL/connection error.
  2. Verify the repository metadata database is reachable and credentials are valid.
  3. Repair/upgrade the repository tables (Repository upgrade scripts) to match your Kettle version.
  4. Restart the repository connection (reconnect) and reload the job.

Example fix

// before
JobMeta job = (JobMeta) repository.loadJob(name, directory, monitor, null); // throws on unreadable R_DATABASE
// after
try {
  JobMeta job = (JobMeta) repository.loadJob(name, directory, monitor, null);
} catch (KettleException e) {
  if (!repository.isConnected()) repository.connect(repoMeta.getUsername(), repoMeta.getPassword());
  // then retry load after checking the SQL error in e.getCause()
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (!repository.isConnected()) { repository.connect(user, password); }
// optionally check repository meta tables exist before loading:
// repository.getDatabaseMeta().testConnection()

Try / catch

try {
  JobMeta job = (JobMeta) repository.loadJob(name, dir, monitor, null);
} catch (KettleException e) {
  logError("Could not read databases from repository: " + (e.getCause() != null ? e.getCause().getMessage() : e.getMessage()), e);
  // reconnect or run repository repair, then retry
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/8e304c4c7e9745e4. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryJobDelegate.java:723

        // See if there already is one in the transformation
        //
        DatabaseMeta check = jobMeta.findDatabase( databaseMeta.getName() );

        // We only add, never overwrite database connections.
        //
        if ( check == null || overWriteShared ) {
          if ( databaseMeta.getName() != null ) {
            jobMeta.getDatabaseManagementInterface().add( databaseMeta );
            if ( !overWriteShared ) {
              databaseMeta.setChanged( false );
            }
          }
        }
      }
      jobMeta.setChanged( false );
    } catch ( KettleDatabaseException dbe ) {
      throw new KettleException(
        BaseMessages.getString( PKG, "JobMeta.Log.UnableToReadDatabaseIDSFromRepository" ), dbe );
    } catch ( KettleException ke ) {
      throw new KettleException(
        BaseMessages.getString( PKG, "JobMeta.Log.UnableToReadDatabasesFromRepository" ), ke );
    }
  }

  /**
   * Read the slave servers in the repository and add them to this transformation if they are not yet present.
   *
   * @param jobMeta
   *          The job to put the slave servers in
   * @param overWriteShared
   *          if an object with the same name exists, overwrite
   * @throws KettleException
   */
  public void readSlaves( JobMeta jobMeta, boolean overWriteShared ) throws KettleException {
    try {

View on GitHub (pinned to f3058517a1)