pentaho/pentaho-kettle · error · KettleException

failed to check isFile in setFilename()

Error message

failed to check isFile in setFilename()

What it means

setFilename() wraps a KettleException around any FileSystemException thrown while calling FileObject.isFile() on an Apache Commons VFS file object. VFS resolves the file system lazily, so asking isFile() can fail due to network/protocol problems, not just logic errors. The wrapper keeps the FileDialogOperation construction flow simple by converting VFS-specific exceptions into Kettle's standard exception type.

Solutions

  1. Verify the file path/URI passed to the dialog is valid and reachable in KettleVFS (e.g. try KettleVFS.getFileObject(path) in a test).
  2. Check network/credentials for the underlying VFS provider (SFTP key, SMB share, repository connection).
  3. Confirm the VFS provider jar for the scheme is on the classpath.
  4. Inspect the wrapped FileSystemException (cause) in the log for the root cause.

Example fix

// before
FileObject fileObject = KettleVFS.getFileObject( userSuppliedPath );
op = constructFileDialogOperation( shell, fileObject );

// after
FileObject fileObject = KettleVFS.getFileObject( userSuppliedPath );
if ( fileObject != null && fileObject.exists() ) { // resolves URI up-front, fails fast with a clear path
  op = constructFileDialogOperation( shell, fileObject );
}
Defensive patterns

Strategy: try-catch

Validate before calling

FileObject fo = KettleVFS.getFileObject( path );
if ( fo == null || !fo.exists() ) {
  throw new IllegalArgumentException( "Path not resolvable: " + path );
}

Type guard

boolean isResolvable( FileObject fo ) {
  try { return fo != null && fo.exists(); } catch ( FileSystemException e ) { return false; }
}

Try / catch

try {
  constructFileDialogOperation( shell, fileObject );
} catch ( KettleException e ) {
  if ( e.getCause() instanceof FileSystemException ) {
    log.warn( "VFS path not accessible, using default dir", e );
    constructFileDialogOperation( shell, null );
  } else { throw e; }
}

Prevention

When it happens

Trigger: Calling constructFileDialogOperation with a FileObject whose file system cannot be resolved or queried: a non-existent remote file over SFTP/SMB, an unreachable VFS host, invalid credentials, or a malformed VFS URI such as 'sftp://host/wrong/path'.

Common situations: Opening the file dialog pointed at a network location that is offline or whose credentials changed; a VFS URI typo; a plugin providing a VFS scheme is missing from the classpath.

Understand the failure class

Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.

Related errors


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

Appendix: source

Thrown at ui/src/main/java/org/pentaho/di/ui/core/events/dialog/SelectionAdapterFileDialog.java:251

      default:
        throw new IllegalArgumentException( "Unexpected SelectionOperation: " + selectionOperation );
    }

  }

  void setPath( FileDialogOperation fileDialogOperation, FileObject fileObject, String filePath ) throws KettleException {
    try {
      fileDialogOperation.setPath( fileObject.isFile() ? filePath : null  );
    } catch ( FileSystemException fse ) {
      throw new KettleException( "failed to check isFile in setPath()", fse );
    }
  }

  void setFilename( FileDialogOperation fileDialogOperation, FileObject fileObject ) throws KettleException {
    try {
      fileDialogOperation.setFilename( fileObject.isFile() ? fileObject.getName().getBaseName() : null );
    } catch ( FileSystemException fse ) {
      throw new KettleException( "failed to check isFile in setFilename()", fse );
    }
  }

  void setStartDir( FileDialogOperation fileDialogOperation, FileObject fileObject, String filePath ) throws KettleException {
    try {
      fileDialogOperation.setStartDir( fileObject.isFolder() ? filePath : null );
    } catch ( FileSystemException fse ) {
      throw new KettleException( "failed to check isFile in setStartDir()", fse );
    }
  }

  void setProvider( FileDialogOperation op, FileObject initalFile ) {
    if ( op.getProviderFilter() == null ) {
      if ( isConnectedToRepository() ) {
        op.setProvider( ProviderFilterType.REPOSITORY.toString() );
      } else if ( isConnectionFile( initalFile ) ) {
        op.setProvider( ProviderFilterType.VFS.toString() );
      } else if ( "hc".equalsIgnoreCase( initalFile.getURI().getScheme() ) ) {

View on GitHub (pinned to f3058517a1)