pentaho/pentaho-kettle · error · KettleException

Unable to read shared objects from repository

Error message

Unable to read shared objects from repository

What it means

PurRepository.readAllSharedObjects() loads and caches all shared object types (partition schemas, cluster schemas, slave servers) and wraps any failure in this KettleException, nulling the shared-object cache. Any failure in the underlying loads (connection, missing files, transform errors) surfaces here.

Solutions

  1. Inspect e.getCause() to see which shared-object load failed first.
  2. Reconnect to the repository (connect) and retry readAllSharedObjects.
  3. Verify the repository user can read the folders holding cluster schemas, partition schemas, and slave servers.
  4. If data-format issues follow an upgrade, check Pentaho client/server version compatibility.

Example fix

// before
SharedObjects so = repo.getSharedObjects();
// after
try {
  SharedObjects so = repo.getSharedObjects();
} catch (KettleException e) {
  log.error("shared objects read failed: " + e.getCause(), e);
  repo.disconnect();
  repo.connect(user, pass); // reconnect then retry once
  SharedObjects so2 = repo.getSharedObjects();
}
Defensive patterns

Strategy: retry

Validate before calling

if (repo == null || !repo.isConnected()) throw new IllegalStateException("repository not connected");

Type guard

boolean usable(Repository repo) { try { return repo != null && repo.isConnected(); } catch (Throwable t) { return false; } }

Try / catch

try { return repo.getSharedObjects(); } catch (KettleException e) { log.error("cause: ", e.getCause()); reconnect(); return repo.getSharedObjects(); }

Prevention

When it happens

Trigger: Calling getSharedObjects()/readAllSharedObjects() when any of the underlying shared-object loads fail: repository disconnected, shared-object folders missing or unreadable, or individual object assembly throws.

Common situations: Repository session expired before reading shared objects; restricted user cannot read shared-object folders; corrupted or legacy-format shared objects after a Pentaho server upgrade; network failure mid-load.

Understand the failure class

Background: "API request failed": what wrapped HTTP errors from external APIs mean and how to find the real cause — this error's family across 29 libraries.

Related errors


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

Appendix: source

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

  }

  protected Map<RepositoryObjectType, List<? extends SharedObjectInterface<?>>> loadAndCacheSharedObjects(
    final boolean deepCopy ) throws KettleException {
    readWriteLock.readLock().lock();
    sharedObjectsLock.writeLock().lock();
    try {
      if ( sharedObjectsByType == null ) {
        sharedObjectsByType =
          new EnumMap<RepositoryObjectType, List<? extends SharedObjectInterface<?>>>( RepositoryObjectType.class );
        // Slave Servers are referenced by Cluster Schemas so they must be loaded first
        readSharedObjects( sharedObjectsByType, RepositoryObjectType.DATABASE, RepositoryObjectType.PARTITION_SCHEMA,
          RepositoryObjectType.SLAVE_SERVER, RepositoryObjectType.CLUSTER_SCHEMA );
      }
      return deepCopy ? deepCopy( sharedObjectsByType ) : sharedObjectsByType;
    } catch ( Exception e ) {
      sharedObjectsByType = null;
      // TODO i18n
      throw new KettleException( "Unable to read shared objects from repository", e ); //$NON-NLS-1$
    } finally {
      sharedObjectsLock.writeLock().unlock();
      readWriteLock.readLock().unlock();
    }
  }

  protected Map<RepositoryObjectType, List<? extends SharedObjectInterface<?>>>  loadAndCacheSharedObjects()
    throws KettleException {
    return loadAndCacheSharedObjects( true );
  }

  private Map<RepositoryObjectType, List<? extends SharedObjectInterface<?>>> deepCopy(
    Map<RepositoryObjectType, List<? extends SharedObjectInterface<?>>> orig ) throws KettleException {
    Map<RepositoryObjectType, List<? extends SharedObjectInterface<?>>>
      copy =
      new EnumMap<RepositoryObjectType, List<? extends SharedObjectInterface<?>>>( RepositoryObjectType.class );
    sharedObjectsLock.writeLock().lock();
    try {

View on GitHub (pinned to f3058517a1)