{"record":{"id":"29b0626a0670ef30","repo":"pentaho/pentaho-kettle","slug":"vfs-provider-mismatched-fs-for-name-error","errorCode":"vfs.provider/mismatched-fs-for-name.error","errorMessage":"vfs.provider/mismatched-fs-for-name.error","messagePattern":"vfs\\.provider/mismatched-fs-for-name\\.error","errorType":"exception","errorClass":"FileSystemException","httpStatus":null,"severity":"error","filePath":"plugins/pentaho-googledrive-vfs/core/src/main/java/org/pentaho/googledrive/vfs/GoogleDriveFileSystem.java","lineNumber":53,"sourceCode":"  protected FileObject createFile( AbstractFileName abstractFileName ) throws Exception {\n    return new GoogleDriveFileObject( abstractFileName, this );\n  }\n\n  public void addCapabilities( Collection<Capability> caps ) {\n    caps.addAll( GoogleDriveFileProvider.capabilities );\n  }\n\n  protected void clearFileFromCache( FileName name ) {\n    super.removeFileFromCache( name );\n  }\n\n  public FileObject resolveFile( FileName name ) throws FileSystemException {\n    return this.processFile( name, true );\n  }\n\n  private synchronized FileObject processFile( FileName name, boolean useCache ) throws FileSystemException {\n    if ( !super.getRootName().getRootURI().equals( name.getRootURI() ) ) {\n      throw new FileSystemException( \"vfs.provider/mismatched-fs-for-name.error\",\n          new Object[] { name, super.getRootName(), name.getRootURI() } );\n    } else {\n      FileObject file;\n      if ( useCache ) {\n        file = super.getFileFromCache( name );\n      } else {\n        file = null;\n      }\n\n      if ( file == null ) {\n        try {\n          file = this.createFile( (AbstractFileName) name );\n        } catch ( Exception var5 ) {\n          return null;\n        }\n\n        file = super.decorateFileObject( file );\n        if ( useCache ) {","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/pentaho-googledrive-vfs/core/src/main/java/org/pentaho/googledrive/vfs/GoogleDriveFileSystem.java#L35-L71","documentation":"GoogleDriveFileSystem.processFile() guards its VFS layer: a FileName is only resolvable inside the file system whose root URI matches. When the requested name's root URI differs from this file system's root URI, it throws vfs.provider/mismatched-fs-for-name.error with the name, the expected root, and the actual root.","triggerScenarios":"Calling resolveFile(name) (e.g. from VFS.getManager().resolveFile or a nested scheme resolution) with a FileName whose root URI (scheme/authority) does not match the Google Drive file system's root, e.g. mixing 'gd:/...' and 'googledrive://...' URIs or passing a file from another provider.","commonSituations":"Composing paths across VFS providers (e.g. resolving 'file:///...' through the Google Drive provider); URIs spelled differently between configuration and code; cached file system reused for a differently-rooted name.","solutions":["Ensure the FileName's root URI exactly matches the root URI of the GoogleDriveFileSystem (same scheme, host, and path).","Resolve the file through the correct VFS provider/manager instead of forcing it through the Google Drive file system.","Use the same URI scheme string consistently in configuration and code (e.g. always 'googledrive://')."],"exampleFix":"// before\nFileObject f = fs.resolveFile(VFS.getManager().resolveURI(\"file:///tmp/x.txt\")); // foreign root\n// after\nFileObject f = VFS.getManager().resolveFile(\"googledrive://mydrive/path/to/file\");","handlingStrategy":"validation","validationCode":"URI root = fs.getRoot().getName().getURI();\nURI nameRoot = name.getRootURI();\nif (!root.equals(nameRoot)) { /* resolve through the matching file system instead */ }","typeGuard":null,"tryCatchPattern":"try {\n  FileObject f = fs.resolveFile(name);\n} catch (FileSystemException e) {\n  if (e.getMessage().startsWith(\"vfs.provider/mismatched-fs-for-name\")) {\n    // resolve via VFS manager with the correct provider/scheme\n  } else { throw e; }\n}","preventionTips":["Use one consistent URI scheme for Google Drive paths across config and code.","Never mix foreign files (file://, other providers) into a GoogleDriveFileSystem instance.","Resolve through VFS.getManager() rather than cached file system objects when the target root may differ."],"tags":["vfs","google-drive","uri","filesystem","scheme-mismatch"],"backgroundTag":"invalid-url","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"}