pentaho/pentaho-kettle · error · KettleException
Could not get repository instance
Error message
Could not get repository instance
What it means
connect instantiates the Repository implementation via PluginRegistry.loadClass(RepositoryPluginType, repositoryMeta.getId(), Repository.class) and calls repository.init(repositoryMeta). Any failure loading the plugin class or initializing it (missing plugin, bad metadata, init exception) is wrapped in 'Could not get repository instance'. The underlying repository was found; its implementation could not be constructed.
Solutions
- Add the missing repository plugin to the classpath (e.g., pentaho-pdi pur plugin jars) for the repositoryMeta id being used.
- Verify repositoryMeta.getId() matches a registered plugin: check PluginRegistry plugins of type RepositoryPluginType.
- Inspect the chained cause for the loadClass/init exception and fix the underlying init error.
- Align Pentaho/Kettle library versions so plugin ids match your repository metadata.
Example fix
// before
KettleEnvironment.init(); // plugins not loaded
Repository repo = factory.connect("PurRepo");
// after
KettleEnvironment.init(false);
PluginRegistry.getInstance().getPlugins(RepositoryPluginType.class); // ensure 'PurRepository' plugin present
Repository repo = factory.connect("PurRepo"); Defensive patterns
Strategy: validation
Validate before calling
boolean pluginLoaded = PluginRegistry.getInstance().getPlugins(RepositoryPluginType.class)
.stream().anyMatch(p -> p.getIds()[0].equals(repoMetaId));
if (!pluginLoaded) throw new IllegalStateException("Repository plugin not on classpath: " + repoMetaId); Try / catch
try { repo = factory.connect(name); }
catch (KettleException e) { if (e.getMessage().contains("Could not get repository instance")) { log.error("Plugin load/init failure", e.getCause()); } } Prevention
- Ship all repository plugin jars with your app
- Call KettleEnvironment.init() before connecting
- Match Pentaho library versions to repository metadata
When it happens
Trigger: PluginRegistry cannot load a Repository class for the repositoryMeta.getId() plugin id — plugin jar absent from the classpath, plugin id mismatch, or repository.init() throwing.
Common situations: Deploying an app with kettle-core but omitting the pur/repository plugin jars; version mismatch where the plugin id changed between Pentaho versions; classpath isolation (shaded jars / OSGi) hiding the plugin registry contents.
Related errors
- AbsSecurityProvider.ERROR_0002_UNABLE_TO_ACCESS_IS_ALLOWED
- AddSequenceMeta.Exception.UnableToReadStepInfo
- AddSequenceMeta.Exception.UnableToSaveStepInfo
- Attempting to create PDI Repository with no Active…
- Cannot delete another users home directory
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/3f9b94d1b2ef0dbf.
Report an issue: GitHub.
Appendix: source
Thrown at plugins/pur/core/src/main/java/org/pentaho/di/repository/utils/IRepositoryFactory.java:178
}
} catch ( Exception e ) {
throw new KettleException( "Repository not found", e ); //$NON-NLS-1$
}
if ( repositoryMeta == null ) {
throw new KettleException( "RepositoryMeta is null" ); //$NON-NLS-1$
}
Repository repository = null;
try {
repository =
PluginRegistry.getInstance().loadClass( RepositoryPluginType.class, repositoryMeta.getId(),
Repository.class );
repository.init( repositoryMeta );
} catch ( Exception e ) {
throw new KettleException( "Could not get repository instance", e ); //$NON-NLS-1$
}
// Two scenarios here: internal to server or external to server. If internal, you are already authenticated. If
// external, you must provide a username and additionally specify that the IP address of the machine running this
// code is trusted.
repository.connect( PentahoSessionHolder.getSession().getName(), "password" );
return repository;
}
}
}
View on GitHub (pinned to f3058517a1)