pentaho/pentaho-kettle · error · KettleException

Unable to create manager for

Error message

Unable to create manager for <managerClass>

What it means

In BaseBowl.getManager(), after a factory is found it is applied to produce the manager instance; if factory.apply(this) returns null, this KettleException is thrown. Unlike error 118, a factory IS registered but its creation logic returned null — usually a factory bug or an environment/state precondition the factory couldn't satisfy.

Solutions

  1. Fix the ManagerFactory's apply() to either create the manager or throw a descriptive exception instead of returning null
  2. Ensure the environment/dependencies the factory needs (KettleEnvironment, variables, repository) are initialized before getManager
  3. Log/inspect the factory implementation for null-return code paths
  4. Catch KettleException and surface which manager class failed to create

Example fix

// before
public T apply(Bowl bowl) {
  if (!ready) return null;
  return new MyManager(bowl);
}
// after
public T apply(Bowl bowl) {
  if (!ready) throw new KettleException("MyManager prerequisites missing");
  return new MyManager(bowl);
}
Defensive patterns

Strategy: try-catch

Validate before calling

// ensure prerequisites before requesting the manager
if (!KettleEnvironment.isInitialized()) {
  KettleEnvironment.init();
}
ManagerFactory<MyManager> f = BowlManagerFactoryRegistry.getInstance().getManagerFactory(MyManager.class);
MyManager probe = f != null ? f.apply(bowl) : null;
if (probe == null) throw new IllegalStateException("Factory returned null for MyManager");

Try / catch

try {
  MyManager m = bowl.getManager(MyManager.class);
} catch (KettleException e) {
  if (e.getMessage().startsWith("Unable to create manager")) {
    log.error("Manager factory returned null — check factory init prerequisites: " + e.getMessage(), e);
  } else throw e;
}

Prevention

When it happens

Trigger: A registered ManagerFactory whose apply() returns null, e.g. because it depends on a missing variable, repository, or configuration and silently returns null instead of throwing.

Common situations: Custom manager factories returning null on failed initialization; factories depending on Kettle environment state (variables, repo) not yet initialized; partially failed plugin loading.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


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

Appendix: source

Thrown at core/src/main/java/org/pentaho/di/core/bowl/BaseBowl.java:43

  private final Set<Bowl> parentBowls = ConcurrentHashMap.newKeySet();

  @Override
  public <T> T getManager( Class<T> managerClass ) throws KettleException {
    // can't use computeIfAbsent here because we want exceptions to propagate. :(
    T result = managerClass.cast( managerInstances.get( managerClass ) );
    if ( result != null ) {
      return result;
    }
    synchronized ( this ) {
      result = managerClass.cast( managerInstances.get( managerClass ) );
      if ( result == null ) {
        ManagerFactory<T> factory = BowlManagerFactoryRegistry.getInstance().getManagerFactory( managerClass );
        if ( factory == null ) {
          throw new KettleException( "No Factory found for " + managerClass );
        }
        result = factory.apply( this );
        if ( result == null ) {
          throw new KettleException( "Unable to create manager for " + managerClass );
        }
        managerInstances.put( managerClass, result );
      }
      return result;
    }
  }

  @Override
  public Set<Bowl> getParentBowls() {
    return parentBowls;
  }

  public void addParentBowl( Bowl parent ) {
    parentBowls.add( parent );
  }

  // use with caution. Clears all manager instances.
  // Other parts of the code rely on WeakReferences to managers to allow them to be GC'd when no

View on GitHub (pinned to f3058517a1)