pentaho/pentaho-kettle · error · KettleException

JobMeta.Log.UnableToReadDatabasesFromRepository

Error message

JobMeta.Log.UnableToReadDatabasesFromRepository

What it means

The same readDatabases method also catches a KettleException (not just KettleDatabaseException) raised while processing the repository's database connection definitions and rewraps it with the message 'unable to read databases from the repository'. It signals a higher-level failure (e.g. constructing/looking up a DatabaseMeta failed) during shared-object loading into JobMeta.

Solutions

  1. Inspect the chained KettleException cause to find which database connection row/definition failed.
  2. Reinstall the missing database driver/plugin used by the stored connection.
  3. Fix or remove the broken connection definitions in the repository metadata.
  4. Ensure repository read occurs after a successful repository connection (databases list available).

Example fix

// before
readDatabases(jobMeta, true); // KettleException from bad connection row
// after
try {
  readDatabases(jobMeta, true);
} catch (KettleException e) {
  logError("Failed to load shared database connections: " + e.getCause(), e);
  // remove/repair offending connection definition in repository, then retry
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (!repository.isConnected()) { repository.connect(user, password); }
// ensure all DatabaseMeta plugins used by stored connections are installed before load

Try / catch

try {
  readSharedObjects(jobMeta);
} catch (KettleException e) {
  logError("Shared database connection could not be loaded: " + (e.getCause() != null ? e.getCause().getMessage() : e.getMessage()), e);
  // repair/remove the offending connection definition, then retry
}

Prevention

When it happens

Trigger: Calling readDatabases via repository read/save paths (also readSharedObjects) when database meta lookup/instantiation from repository rows throws KettleException: e.g. a repository DatabaseMeta row references an invalid plugin type or the DatabaseMeta cannot be created.

Common situations: Repository rows for connections created with a plugin no longer installed; malformed connection metadata; missing database driver preventing DatabaseMeta creation while loading shared objects.

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/7b4c4bf5fdc9227a. Report an issue: GitHub.

Appendix: source

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

        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 {
      ObjectId[] dbids = repository.getSlaveIDs( false );
      for ( int i = 0; i < dbids.length; i++ ) {
        SlaveServer slaveServer = repository.loadSlaveServer( dbids[i], null ); // Load last version

View on GitHub (pinned to f3058517a1)