{"record":{"id":"bdb27f433ee15d72","repo":"pentaho/pentaho-kettle","slug":"connectionfilesystem-connectionmanagergone","errorCode":"ConnectionFileSystem.ConnectionManagerGone","errorMessage":"ConnectionFileSystem.ConnectionManagerGone","messagePattern":"ConnectionFileSystem\\.ConnectionManagerGone","errorType":"error_code","errorClass":"KettleVFSFileSystemException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/connections/vfs/provider/ConnectionFileSystem.java","lineNumber":74,"sourceCode":"  private final VFSConnectionManagerHelper vfsConnectionManagerHelper;\n\n  public ConnectionFileSystem( @NonNull FileName rootName,\n                               @NonNull FileSystemOptions fileSystemOptions,\n                               @NonNull ConnectionManager connectionManager,\n                               @NonNull VFSConnectionManagerHelper vfsConnectionManagerHelper ) {\n    super( rootName, null, fileSystemOptions );\n\n    this.connectionManager = new WeakReference( Objects.requireNonNull( connectionManager ) );\n    this.vfsConnectionManagerHelper = Objects.requireNonNull( vfsConnectionManagerHelper );\n  }\n\n  @Override\n  protected FileObject createFile( AbstractFileName fileName ) throws Exception {\n    ConnectionFileName pvfsFileName = (ConnectionFileName) fileName;\n\n    ConnectionManager locConnMgr = this.connectionManager.get();\n    if ( locConnMgr == null ) {\n      throw new KettleVFSFileSystemException( \"ConnectionFileSystem.ConnectionManagerGone\" );\n    }\n    // 1. pvfs:// has no associated connection, so no provider file object.\n    String connectionName = pvfsFileName.getConnection();\n    if ( connectionName == null ) {\n      return new PvfsRootFileObject( pvfsFileName, this );\n    }\n\n    // 2. A file name that references a connection that does not exist.\n    VFSConnectionDetails details = locConnMgr.getDetails( connectionName );\n    if ( details == null ) {\n      return new UndefinedConnectionFileObject( pvfsFileName, this );\n    }\n\n    initializeVariableSpace( details );\n\n    // 3. Connections with buckets don't support degenerate root provider URIs (e.g. s3://).\n    //    If using buckets, such URIs would be generated, if transformer were called.\n    if ( pvfsFileName.isConnectionRoot() && vfsConnectionManagerHelper.usesBuckets( details ) ) {","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/connections/vfs/provider/ConnectionFileSystem.java#L56-L92","documentation":"ConnectionFileSystem holds the ConnectionManager via a lazily-supplied reference (this.connectionManager.get()). When creating a file object, if the reference yields null the manager is 'gone' and the filesystem cannot resolve the pvfs:// name, so it throws. This guards the whole createFile path against a disposed/unset manager.","triggerScenarios":"resolveFile -> createFile is invoked while connectionManager.get() returns null — the supplier-backed reference was never set or was cleared (filesystem closed/reset before use).","commonSituations":"Using a ConnectionFileSystem after shutdown/cleanup; a race where the filesystem is used concurrently with teardown; constructing the filesystem without wiring the ConnectionManager supplier.","solutions":["Ensure the ConnectionManager reference is set before resolving pvfs:// files","Do not resolve pvfs:// files after the filesystem/connection layer has been closed","Re-create or re-open the ConnectionFileSystem so the manager supplier is re-populated","Check for concurrent shutdown threads clearing the manager reference"],"exampleFix":"// before: resolving after cleanup\ncloseConnections();\nFileObject f = fs.resolveFile(\"pvfs://conn/x\");\n// after\nFileObject f = fs.resolveFile(\"pvfs://conn/x\");\ncloseConnections();","handlingStrategy":"try-catch","validationCode":"if (connectionManagerRef.get() == null) { /* re-register or abort before resolving pvfs files */ }","typeGuard":"boolean managerAvailable = connectionManagerRef.get() != null;","tryCatchPattern":"try { fo = fs.resolveFile(pvfsUrl); } catch (FileSystemException e) { /* re-open filesystem and retry once */ }","preventionTips":["Set the ConnectionManager supplier before first resolve","Close filesystems only after all VFS work completes","Avoid racing shutdown threads with VFS resolution"],"tags":["vfs","null-reference","connection-manager","lifecycle"],"backgroundTag":"internal-invariant-violation","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"}