{"record":{"id":"1cb8de26b7778955","repo":"pentaho/pentaho-kettle","slug":"repository-not-connected","errorCode":null,"errorMessage":"Repository not connected","messagePattern":"Repository not connected","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"plugins/pentaho-repository-vfs/core/src/main/java/org/pentaho/repositoryvfs/vfs/RepositoryVfsProvider.java","lineNumber":64,"sourceCode":"  }\n\n  private void registerRepoVFS() {\n    FileSystemManager fsm = KettleVFS.getInstance().getFileSystemManager();\n    if ( fsm instanceof DefaultFileSystemManager ) {\n      try {\n        ( (DefaultFileSystemManager) fsm ).addProvider( SCHEME, this );\n        final Spoon spoon = Spoon.getInstance();\n        System.out.println(  );\n      } catch ( Exception ex ) {\n        throw new RuntimeException( \"Error initialize repo:// VFS\", ex );\n      }\n    }\n  }\n\n  protected Repository getRepo() {\n    Repository repo = repositoryInstance.getConnectedRepositoryInstance();\n    if ( repo == null ) {\n      throw new RuntimeException( \"Repository not connected\" );\n    }\n    return repo;\n  }\n\n  @Override\n  public FileObject findFile( FileObject baseFile, String uri, FileSystemOptions fileSystemOptions )\n    throws FileSystemException {\n\n    if ( !uri.startsWith( \"repo://\" ) ) {\n      throw new FileSystemException( \"WRONG_URL\" );\n    }\n    String path = '/' + uri.substring( 7 );\n    return new RepositoryVfsFileObject( this, path );\n  }\n\n  @Override\n  public FileObject createFileSystem( String scheme, FileObject file, FileSystemOptions fileSystemOptions )\n    throws FileSystemException {","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/pentaho-repository-vfs/core/src/main/java/org/pentaho/repositoryvfs/vfs/RepositoryVfsProvider.java#L46-L82","documentation":"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.","triggerScenarios":"Any repo:// file operation (findFile, getInputStream, getOutputStream) while no repository connection is established — getConnectedRepositoryInstance() returns null.","commonSituations":"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.","solutions":["Connect to the repository (Spoon login or programmatically via the repository connect API) before using repo:// paths.","Verify getConnectedRepositoryInstance() is non-null at job startup and fail fast with a clear message.","Re-establish the connection if the session expired, then retry the operation.","Avoid repo:// URIs when running without a repository; use file:// outputs instead."],"exampleFix":"// before\nFileObject fo = VFS.getManager().resolveFile(\"repo:///home/admin/report.prpt\");\n// after\nRepository repo = KettleRepositoryLocator.getConnectedRepositoryInstance();\nif (repo == null) {\n  repository.connect(username, password); // or prompt user to log in\n}\nFileObject fo = VFS.getManager().resolveFile(\"repo:///home/admin/report.prpt\");","handlingStrategy":"validation","validationCode":"Repository repo = repositoryInstance.getConnectedRepositoryInstance();\nif (repo == null) { throw new IllegalStateException(\"Connect to the Pentaho repository before using repo:// paths\"); }","typeGuard":null,"tryCatchPattern":"try {\n  FileObject fo = VFS.getManager().resolveFile(repoUri);\n} catch (RuntimeException e) {\n  if (\"Repository not connected\".equals(e.getMessage())) {\n    repository.connect(user, pass); // then retry once\n  } else throw e;\n}","preventionTips":["Establish the repository connection at application/Spoon startup before resolving repo:// URIs.","Fail fast with a clear UI message if no repository is connected.","Handle session expiry by reconnecting and retrying.","Use file:// outputs in non-repository (headless) runs."],"tags":["repository","connection","vfs"],"backgroundTag":"authentication-required","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}