pentaho/pentaho-kettle · error · RuntimeException

Repository not connected

Error message

Repository not connected

What it means

RepositoryVfsProvider.getRepo() fetches the connected repository instance from repositoryInstance.getConnectedRepositoryInstance(); if none is connected (null) it throws RuntimeException 'Repository not connected'. All repo:// VFS operations depend on this connected repository.

Solutions

  1. Connect to the repository (Spoon login or programmatically via the repository connect API) before using repo:// paths.
  2. Verify getConnectedRepositoryInstance() is non-null at job startup and fail fast with a clear message.
  3. Re-establish the connection if the session expired, then retry the operation.
  4. Avoid repo:// URIs when running without a repository; use file:// outputs instead.

Example fix

// before
FileObject fo = VFS.getManager().resolveFile("repo:///home/admin/report.prpt");
// after
Repository repo = KettleRepositoryLocator.getConnectedRepositoryInstance();
if (repo == null) {
  repository.connect(username, password); // or prompt user to log in
}
FileObject fo = VFS.getManager().resolveFile("repo:///home/admin/report.prpt");
Defensive patterns

Strategy: validation

Validate before calling

Repository repo = repositoryInstance.getConnectedRepositoryInstance();
if (repo == null) { throw new IllegalStateException("Connect to the Pentaho repository before using repo:// paths"); }

Try / catch

try {
  FileObject fo = VFS.getManager().resolveFile(repoUri);
} catch (RuntimeException e) {
  if ("Repository not connected".equals(e.getMessage())) {
    repository.connect(user, pass); // then retry once
  } else throw e;
}

Prevention

When it happens

Trigger: Any repo:// file operation (findFile, getInputStream, getOutputStream) while no repository connection is established — getConnectedRepositoryInstance() returns null.

Common situations: Using repo:// URIs in transformations before the user connected to a Pentaho repository in Spoon; a disconnected/expired repository session; running headless without programmatically connecting to the repository.

Related errors


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

Appendix: source

Thrown at plugins/pentaho-repository-vfs/core/src/main/java/org/pentaho/repositoryvfs/vfs/RepositoryVfsProvider.java:64

  }

  private void registerRepoVFS() {
    FileSystemManager fsm = KettleVFS.getInstance().getFileSystemManager();
    if ( fsm instanceof DefaultFileSystemManager ) {
      try {
        ( (DefaultFileSystemManager) fsm ).addProvider( SCHEME, this );
        final Spoon spoon = Spoon.getInstance();
        System.out.println(  );
      } catch ( Exception ex ) {
        throw new RuntimeException( "Error initialize repo:// VFS", ex );
      }
    }
  }

  protected Repository getRepo() {
    Repository repo = repositoryInstance.getConnectedRepositoryInstance();
    if ( repo == null ) {
      throw new RuntimeException( "Repository not connected" );
    }
    return repo;
  }

  @Override
  public FileObject findFile( FileObject baseFile, String uri, FileSystemOptions fileSystemOptions )
    throws FileSystemException {

    if ( !uri.startsWith( "repo://" ) ) {
      throw new FileSystemException( "WRONG_URL" );
    }
    String path = '/' + uri.substring( 7 );
    return new RepositoryVfsFileObject( this, path );
  }

  @Override
  public FileObject createFileSystem( String scheme, FileObject file, FileSystemOptions fileSystemOptions )
    throws FileSystemException {

View on GitHub (pinned to f3058517a1)