{"record":{"id":"0dbc3473c32c0c02","repo":"pentaho/pentaho-kettle","slug":"error-calling-ikettlevfs-getfileobject","errorCode":null,"errorMessage":"error calling IKettleVFS.getFileObject","messagePattern":"error calling IKettleVFS\\.getFileObject","errorType":"exception","errorClass":"FileException","httpStatus":null,"severity":"error","filePath":"plugins/file-open-save-new/core/src/main/java/org/pentaho/di/plugins/fileopensave/providers/vfs/service/KettleVFSService.java","lineNumber":57,"sourceCode":"  }\n\n  public KettleVFSService( IKettleVFS iKettleVFS ) {\n    this.iKettleVFS = iKettleVFS;\n  }\n\n  /**\n   * Wrapper around {@link IKettleVFS#getFileObject(String, VariableSpace)}\n   * @param vfsPath - file object where <code>vfsFile.getPath()</code> returns a URI\n   *  with the prefix or scheme equal to {@value  org.pentaho.di.connections.vfs.provider.ConnectionFileProvider#SCHEME}\n   * @param space\n   * @return\n   * @throws FileException\n   */\n  public FileObject getFileObject( String vfsPath, VariableSpace space ) throws FileException {\n    try {\n      return iKettleVFS.getFileObject( vfsPath, space );\n    } catch ( KettleFileException kfe ) {\n      throw new FileException( \"error calling IKettleVFS.getFileObject\", kfe );\n    }\n  }\n}\n","sourceCodeStart":39,"sourceCodeEnd":61,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/file-open-save-new/core/src/main/java/org/pentaho/di/plugins/fileopensave/providers/vfs/service/KettleVFSService.java#L39-L61","documentation":"KettleVFSService.getFileObject is a thin wrapper around IKettleVFS.getFileObject that translates KettleFileException into the plugin's FileException with this generic message. It signals that a FileObject could not be created for the given VFS path and variable space.","triggerScenarios":"Any call to KettleVFSService.getFileObject(vfsPath, space) where the underlying IKettleVFS throws KettleFileException — e.g. malformed VFS URI, unknown scheme, or filesystem resolution failure.","commonSituations":"Typos in vfsfile: URLs; missing VFS provider for the scheme; variables in the path that do not resolve; file locked or inaccessible during resolution.","solutions":["Log/inspect the wrapped KettleFileException cause for the real reason","Validate the VFS URI and its scheme before calling getFileObject","Ensure all variables in the path resolve in the passed VariableSpace","Confirm the VFS provider for the scheme is on the classpath"],"exampleFix":"// before\nFileObject fo = service.getFileObject( \"vfsfile:/bad^path\", space );\n// after\nString path = space.environmentSubstitute( vfsPath );\nif ( !path.startsWith( \"vfsfile:/\" ) ) {\n  throw new IllegalArgumentException( \"Unsupported VFS scheme: \" + path );\n}\nFileObject fo = service.getFileObject( path, space );","handlingStrategy":"try-catch","validationCode":"String resolved = space.environmentSubstitute( vfsPath );\nif ( resolved == null || resolved.isEmpty() ) throw new IllegalArgumentException( \"Empty VFS path\" );\nURI.create( resolved ); // basic URI syntax check","typeGuard":"boolean validVfsPath = vfsPath != null && vfsPath.matches( \"^[a-z]+:.*\" );","tryCatchPattern":"try { FileObject fo = service.getFileObject( vfsPath, space ); }\ncatch ( FileException fe ) {\n  if ( fe.getCause() instanceof KettleFileException ) {\n    log.error( \"Cannot resolve VFS path: \" + vfsPath, fe.getCause() );\n  }\n}","preventionTips":["Validate the VFS URI scheme before calling","Ensure variables resolve in the VariableSpace","Check the VFS provider for the scheme is on the classpath"],"tags":["vfs","file-resolution","wrapper-exception"],"backgroundTag":"file-not-found","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"}