pentaho/pentaho-kettle · error · KettleException

RepositoryMeta is null

Error message

RepositoryMeta is null

What it means

After the lookup, connect checks repositoryMeta for null and throws 'RepositoryMeta is null'. This distinguishes the case where findRepository silently returned nothing (name not present) from exception-based failures, ensuring the factory never proceeds with a null repository definition.

Solutions

  1. Verify the repository name exists in repositories.xml exactly (case/whitespace).
  2. Re-create the repository definition in Spoon (Manage Repositories) or edit repositories.xml.
  3. Enumerate RepositoriesMeta.getRepositories() at runtime and log available names before connecting.
  4. Ensure the process runs as a user whose $HOME/.kettle contains the expected repositories.xml.

Example fix

// before
Repository repo = factory.connect("prod"); // name not defined anywhere
// after
RepositoriesMeta meta = new RepositoriesMeta(); meta.readData();
boolean exists = Arrays.stream(meta.getRepositories()).anyMatch(r -> r.getName().equals("prod"));
if (!exists) throw new IllegalArgumentException("Unknown repository: prod");
Repository repo = factory.connect("prod");
Defensive patterns

Strategy: validation

Validate before calling

RepositoriesMeta meta = new RepositoriesMeta(); meta.readData();
if (meta.findRepository(name) == null) throw new IllegalArgumentException("Unknown repository: " + name);

Try / catch

try { repo = factory.connect(name); }
catch (KettleException e) { if (e.getMessage().contains("RepositoryMeta is null")) { /* prompt user to select valid repo */ } }

Prevention

When it happens

Trigger: repositoriesMeta.findRepository(repositoryName) returns null because no repository with that exact name is defined (and singleDiServerInstance lookup also missed).

Common situations: Repository name typo; repositories.xml populated on a different machine/user profile than the one running the code; relying on a repository that was deleted from the metadata.

Understand the failure class

Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.

Related errors


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

Appendix: source

Thrown at plugins/pur/core/src/main/java/org/pentaho/di/repository/utils/IRepositoryFactory.java:167

      } catch ( Exception e ) {
        throw new KettleException( "Meta repository not populated", e ); //$NON-NLS-1$
      }

      // Find the specified repository.
      RepositoryMeta repositoryMeta = null;
      try {
        if ( singleDiServerInstance ) {
          repositoryMeta = repositoriesMeta.findRepository( SINGLE_DI_SERVER_INSTANCE );
        } else {
          repositoryMeta = repositoriesMeta.findRepository( repositoryName );
        }

      } 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" );

View on GitHub (pinned to f3058517a1)