pentaho/pentaho-kettle · error · KettleException

Unable to get all database IDs

Error message

Unable to get all database IDs

What it means

PurRepository.getDatabaseIDs() lists all repository files of type DATABASE under the shared-objects root and converts their IDs to Kettle ObjectIds. Any failure in the underlying Pentaho Repository (JCR/PUC) file listing or ID conversion is wrapped in a KettleException with this message.

Solutions

  1. Verify the pur repository connection is healthy (connect() succeeded, user authenticated).
  2. Check that the /etc/databases (shared databases) area exists in the repository and the user has read permission.
  3. Inspect the cause chain of the KettleException for the underlying PentahoRepositoryException.
  4. Retry after fixing repository/network; fall back to getDatabaseNames() if only names are needed.

Example fix

// before
List<ObjectId> ids = repository.getDatabaseIDs(false);
// after
List<ObjectId> ids;
try {
  ids = repository.getDatabaseIDs(false);
} catch (KettleException e) {
  logError("Repository unreadable, using empty database list", e);
  ids = Collections.emptyList();
}
Defensive patterns

Strategy: try-catch

Validate before calling

// ensure connected before listing
if (!repository.isConnected()) { repository.connect(user, pass); }
List<RepositoryFile> dbs = repository.getAllFilesOfType? // n/a; verify via repository.exists(folder) if available

Type guard

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

Try / catch

try { ids = repository.getDatabaseIDs(false); } catch (KettleException e) { log.error("db id listing failed", e); ids = new ObjectId[0]; }

Prevention

When it happens

Trigger: Calling getDatabaseIDs(boolean) when the repository connection fails, the databases folder is missing/corrupt, or the file service throws while listing children.

Common situations: PDI spoon connecting to a Pentaho repository with network/auth issues; a pur repository where shared database connections were deleted or the folder permissions deny listing.

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

Appendix: source

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

      } else {
        return null;
      }
    } finally {
      readWriteLock.readLock().unlock();
    }
  }

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

  protected List<RepositoryFile> getAllFilesOfType( final ObjectId dirId, final RepositoryObjectType objectType,
                                                    final boolean includeDeleted ) throws KettleException {
    return getAllFilesOfType( dirId, Collections.singletonList( objectType ), includeDeleted );
  }

  protected List<RepositoryFile> getAllFilesOfType( final ObjectId dirId, final List<RepositoryObjectType> objectTypes,
                                                    final boolean includeDeleted ) throws KettleException {

    List<RepositoryFile> allChildren = new ArrayList<RepositoryFile>();
    List<RepositoryFile> children = getAllFilesOfType( dirId, objectTypes );
    allChildren.addAll( children );
    if ( includeDeleted ) {
      String dirPath = null;
      if ( dirId != null ) {
        // derive path using id

View on GitHub (pinned to f3058517a1)