pentaho/pentaho-kettle · error · KettleException

Unable to read all databases

Error message

Unable to read all databases

What it means

Repository access failure in PurRepository while reading all database definitions: the batched data read from the server failed or could not be interpreted. The message wraps the underlying exception; individual missing databases are only logged, this throw indicates a wholesale read failure.

Solutions

  1. Check the cause chain for the underlying repository exception.
  2. Verify shared database connections exist and are readable in the repository.
  3. Recreate the affected DatabaseMeta entries and save them again.
  4. Catch and continue with locally defined connections.

Example fix

// before
for (DatabaseMeta db : repository.readDatabases()) { ... }
// after
List<DatabaseMeta> dbs;
try {
  dbs = repository.readDatabases();
} catch (KettleException e) {
  logError("Falling back to local DB connections", e);
  dbs = Collections.emptyList();
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (!repository.isConnected()) throw new IllegalStateException("connect first");
// optionally pre-check: repository.getDatabaseNames(false) returns non-null

Type guard

boolean dbReadable = repository != null && repository.isConnected();

Try / catch

try { dbs = repository.readDatabases(); } catch (KettleException e) { log.error("read databases failed", e); dbs = emptyList(); }

Prevention

When it happens

Trigger: Calling readDatabases() when the underlying getAllFilesOfType(DATABASE)/data lookup fails — unreadable file content, missing nodes, or service errors.

Common situations: Corrupted shared database connections; permission issues on the databases folder; transient pentaho repository outage during transformation startup.

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

Appendix: source

Thrown at plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java:1500

      //Grab data from all objects at once to lower calls to server
      List<NodeRepositoryFileData> data = pur.getDataForReadInBatch( children, NodeRepositoryFileData.class );
      Iterator<NodeRepositoryFileData> dataIter = data.iterator();

      for ( RepositoryFile file : children ) {
        //Both list should be ordered, so the items match
        DataNode node = dataIter.next().getNode();
        if ( !hasOsgiFolder && StringUtils.equals( node.getProperty( "TYPE" ).getString(), "KettleThin" ) ) {
          log.logDetailed( "Unable to find database {" + file.getName() + "}" );
          continue;
        }
        DatabaseMeta databaseMeta = (DatabaseMeta) databaseMetaTransformer.dataNodeToElement( node );
        databaseMeta.setName( file.getTitle() );
        dbMetas.add( databaseMeta );
      }

      return dbMetas;
    } catch ( Exception e ) {
      throw new KettleException( "Unable to read all databases", e );
    } finally {
      readWriteLock.readLock().unlock();
    }
  }

  @Override
  public void deleteDatabaseMeta( final String databaseName ) throws KettleException {
    RepositoryFile fileToDelete = null;
    ObjectId idDatabase = null;

    try {
      readWriteLock.writeLock().lock();
      try {
        fileToDelete = pur.getFile( getPath( databaseName, null, RepositoryObjectType.DATABASE ) );
        idDatabase = new StringObjectId( fileToDelete.getId().toString() );
        permanentlyDeleteSharedObject( idDatabase );
        removeFromSharedObjectCache( RepositoryObjectType.DATABASE, idDatabase );
      } finally {

View on GitHub (pinned to f3058517a1)