pentaho/pentaho-kettle · error · KettleException

Unable to get all database names

Error message

Unable to get all database names

What it means

PurRepository.getDatabaseNames(boolean) lists all DATABASE-type repository files and returns their titles. Any exception during the repository file listing is wrapped in a KettleException with this message.

Solutions

  1. Confirm repository connectivity and authentication before the call.
  2. Verify the shared databases directory exists and is readable by the current repository user.
  3. Check the wrapped cause exception for the root error from the file service.
  4. Catch KettleException and degrade gracefully to an empty list or local metadata.

Example fix

// before
String[] names = repository.getDatabaseNames(false);
// after
String[] names;
try {
  names = repository.getDatabaseNames(false);
} catch (KettleException e) {
  logError("Could not list repository databases", e);
  names = new String[0];
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (!repository.isConnected()) throw new IllegalStateException("Connect first");

Type guard

boolean ready = repository != null && repository.hasService(IRepositoryService.class);

Try / catch

try { names = repository.getDatabaseNames(false); } catch (KettleException e) { log.warn("cannot list dbs", e); names = new String[0]; }

Prevention

When it happens

Trigger: Calling getDatabaseNames(boolean) when the repository backend fails to list children of the databases folder (network outage, deleted folder, insufficient permissions).

Common situations: Shared DB connection listing at PDI startup with a broken pentaho repository connection; users without read rights on the shared objects directory.

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

Appendix: source

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

    } finally {
      readWriteLock.readLock().unlock();
    }

    Collections.sort( allFiles );
    return allFiles;
  }

  @Override
  public String[] getDatabaseNames( boolean includeDeleted ) throws KettleException {
    try {
      List<RepositoryFile> children = getAllFilesOfType( null, RepositoryObjectType.DATABASE, includeDeleted );
      List<String> names = new ArrayList<String>( children.size() );
      for ( RepositoryFile file : children ) {
        names.add( file.getTitle() );
      }
      return names.toArray( new String[ 0 ] );
    } catch ( Exception e ) {
      throw new KettleException( "Unable to get all database names", e );
    }
  }

  /**
   * Initialize the shared object assembler map with known assemblers
   */
  private void initSharedObjectAssemblerMap() {
    sharedObjectAssemblerMap =
      new EnumMap<RepositoryObjectType, SharedObjectAssembler<?>>( RepositoryObjectType.class );
    sharedObjectAssemblerMap.put( RepositoryObjectType.DATABASE, databaseMetaTransformer );
    sharedObjectAssemblerMap.put( RepositoryObjectType.CLUSTER_SCHEMA, clusterTransformer );
    sharedObjectAssemblerMap.put( RepositoryObjectType.PARTITION_SCHEMA, partitionSchemaTransformer );
    sharedObjectAssemblerMap.put( RepositoryObjectType.SLAVE_SERVER, slaveTransformer );
  }

  public DatabaseDelegate getDatabaseMetaTransformer() {
    return databaseMetaTransformer;
  }

View on GitHub (pinned to f3058517a1)