pentaho/pentaho-kettle · error · FileException

error calling IKettleVFS.getFileObject

Error message

error calling IKettleVFS.getFileObject

What it means

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.

Solutions

  1. Log/inspect the wrapped KettleFileException cause for the real reason
  2. Validate the VFS URI and its scheme before calling getFileObject
  3. Ensure all variables in the path resolve in the passed VariableSpace
  4. Confirm the VFS provider for the scheme is on the classpath

Example fix

// before
FileObject fo = service.getFileObject( "vfsfile:/bad^path", space );
// after
String path = space.environmentSubstitute( vfsPath );
if ( !path.startsWith( "vfsfile:/" ) ) {
  throw new IllegalArgumentException( "Unsupported VFS scheme: " + path );
}
FileObject fo = service.getFileObject( path, space );
Defensive patterns

Strategy: try-catch

Validate before calling

String resolved = space.environmentSubstitute( vfsPath );
if ( resolved == null || resolved.isEmpty() ) throw new IllegalArgumentException( "Empty VFS path" );
URI.create( resolved ); // basic URI syntax check

Type guard

boolean validVfsPath = vfsPath != null && vfsPath.matches( "^[a-z]+:.*" );

Try / catch

try { FileObject fo = service.getFileObject( vfsPath, space ); }
catch ( FileException fe ) {
  if ( fe.getCause() instanceof KettleFileException ) {
    log.error( "Cannot resolve VFS path: " + vfsPath, fe.getCause() );
  }
}

Prevention

When it happens

Trigger: Any call to KettleVFSService.getFileObject(vfsPath, space) where the underlying IKettleVFS throws KettleFileException — e.g. malformed VFS URI, unknown scheme, or filesystem resolution failure.

Common situations: Typos in vfsfile: URLs; missing VFS provider for the scheme; variables in the path that do not resolve; file locked or inaccessible during resolution.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


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

Appendix: source

Thrown at plugins/file-open-save-new/core/src/main/java/org/pentaho/di/plugins/fileopensave/providers/vfs/service/KettleVFSService.java:57

  }

  public KettleVFSService( IKettleVFS iKettleVFS ) {
    this.iKettleVFS = iKettleVFS;
  }

  /**
   * Wrapper around {@link IKettleVFS#getFileObject(String, VariableSpace)}
   * @param vfsPath - file object where <code>vfsFile.getPath()</code> returns a URI
   *  with the prefix or scheme equal to {@value  org.pentaho.di.connections.vfs.provider.ConnectionFileProvider#SCHEME}
   * @param space
   * @return
   * @throws FileException
   */
  public FileObject getFileObject( String vfsPath, VariableSpace space ) throws FileException {
    try {
      return iKettleVFS.getFileObject( vfsPath, space );
    } catch ( KettleFileException kfe ) {
      throw new FileException( "error calling IKettleVFS.getFileObject", kfe );
    }
  }
}

View on GitHub (pinned to f3058517a1)