pentaho/pentaho-kettle · error · KettleException
ERROR_0018_META_REPOSITORY_NOT_POPULATED
ERROR_0018_META_REPOSITORY_NOT_POPULATED
Error message
RepositoryConnectionUtils.ERROR_0018_META_REPOSITORY_NOT_POPULATED
What it means
RepositoryConnectionUtils.connectToRepository loads repository metadata from either a supplied stream or the default repositories.xml before connecting. If that loading step throws any exception, it is rethrown as a KettleException with ERROR_0018_META_REPOSITORY_NOT_POPULATED — meaning the RepositoriesMeta object could not be populated, so no repository can be selected.
Solutions
- Fix or restore the repositories.xml file that readData()/readDataFromInputStream failed on (check the cause chain).
- Verify HOME/KETTLE_HOME points to a directory containing a readable repositories.xml for the running user.
- If a stream is supplied, confirm it delivers complete valid repositories.xml bytes before this call.
- Create a valid repositories.xml via Spoon or RepositoriesMeta.writeData() on a working machine and copy it over.
- Pre-validate with new RepositoriesMeta().readData() in a try block and give a clearer error if it fails.
Example fix
// before: opaque ERROR_0018 when file is missing
repository = RepositoryConnectionUtils.connectToRepository(log, null, "repo1", user, pass, null, false);
// after: pre-check the metadata file
File reposXml = new File(System.getProperty("user.home") + "/.kettle/repositories.xml");
if (!reposXml.canRead()) {
throw new IllegalStateException("repositories.xml missing/unreadable: " + reposXml);
}
repository = RepositoryConnectionUtils.connectToRepository(log, null, "repo1", user, pass, null, false); Defensive patterns
Strategy: validation
Validate before calling
File reposXml = new File(System.getProperty("user.home") + "/.kettle/repositories.xml");
if (!reposXml.canRead()) throw new IllegalStateException("repositories.xml not readable: " + reposXml);
new RepositoriesMeta().readData(); // dry-run before real connect Try / catch
try { rep = RepositoryConnectionUtils.connectToRepository(...); } catch (KettleException e) { if (e.getMessage().contains("ERROR_0018")) { /* metadata not populated: fix repositories.xml */ } throw e; } Prevention
- Ship a valid repositories.xml with headless deployments
- Set HOME/KETTLE_HOME explicitly for service accounts
- Dry-run RepositoriesMeta.readData() at startup to fail early with a clear message
When it happens
Trigger: Calling RepositoryConnectionUtils.connectToRepository(...) where readDataFromInputStream(stream) or readData() throws — i.e. missing, unreadable, or malformed ~/.kettle/repositories.xml (or a broken supplied stream).
Common situations: Headless server/job where HOME is not set so repositories.xml cannot be found; corrupted repositories.xml after a crash; deploying without shipping a repositories.xml; permission problems in the user's home directory.
Related errors
- ElasticSearchBulk.Error.InvalidIdField
- ElasticSearchBulk.Error.NoJsonField
- ERROR_0004_REPOSITORY_NOT_FOUND
- ERROR_0016_COULD_NOT_GET_REPOSITORY_INSTANCE
- Error evaluating timestamp value metadata
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/8b5d9e554d360d1b.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/repository/RepositoryConnectionUtils.java:81
}
try {
if ( isSingleDiServerInstance ) {
if ( logger.isDebugEnabled() ) {
logger.debug( "singleDiServerInstance=true, loading default repository" );
}
// Get the embedded repository xml
String repositoriesXml = getEmbeddedDefaultRepositoryXml( fullyQualifiedServerUrl );
ByteArrayInputStream sbis = new ByteArrayInputStream( repositoriesXml.getBytes( Const.XML_ENCODING ) );
repositoriesMeta.readDataFromInputStream( sbis );
} else {
// TODO: add support for specified repositories.xml files...
repositoriesMeta.readData(); // Read from the default $HOME/.kettle/repositories.xml file.
}
} catch ( Exception e ) {
throw new KettleException( BaseMessages.getString(
"RepositoryConnectionUtils.ERROR_0018_META_REPOSITORY_NOT_POPULATED" ), e ); //$NON-NLS-1$
}
if ( logger.isDebugEnabled() ) {
logger.debug( " Finding repository metadata" );
}
// Find the specified repository.
RepositoryMeta repositoryMeta = null;
try {
if ( isSingleDiServerInstance ) {
repositoryMeta = repositoriesMeta.findRepository( SINGLE_DI_SERVER_INSTANCE );
} else {
repositoryMeta = repositoriesMeta.findRepository( repositoryName );
}
} catch ( Exception e ) {
throw new KettleException( BaseMessages.getString( PKG,View on GitHub (pinned to f3058517a1)