pentaho/pentaho-kettle · error · KettleException

failed to check isFile in setStartDir()

Error message

failed to check isFile in setStartDir()

What it means

setStartDir() wraps any FileSystemException from FileObject.isFolder() (used to decide the dialog's starting directory) into a KettleException. Like its setFilename() sibling, the failure is raised by the VFS layer when the folder metadata cannot be read. The message text misleadingly says isFile even though it checks isFolder.

Solutions

  1. Verify the start-directory path stored/passed exists and is accessible; fall back to a default folder if not.
  2. Check permissions and connectivity for the VFS provider backing that path.
  3. Read the chained FileSystemException cause for the actual VFS failure.
  4. Clear stale saved dialog state (last-used folder) in the Kettle UI settings.

Example fix

// before
FileObject startDir = KettleVFS.getFileObject( lastUsedDir );
constructFileDialogOperation( shell, startDir, lastUsedDir );

// after
FileObject startDir = KettleVFS.getFileObject( lastUsedDir );
if ( startDir == null || !startDir.exists() || !startDir.isFolder() ) {
  startDir = KettleVFS.getFileObject( System.getProperty( "user.home" ) );
}
constructFileDialogOperation( shell, startDir, startDir.getName().getURI() );
Defensive patterns

Strategy: fallback

Validate before calling

FileObject dir = KettleVFS.getFileObject( startDir );
if ( dir == null || !dir.exists() || !dir.isFolder() ) {
  startDir = System.getProperty( "user.home" );
}

Type guard

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

Try / catch

try {
  constructFileDialogOperation( shell, fileObject, startDir );
} catch ( KettleException e ) {
  log.warn( "Start dir unavailable, falling back to home", e );
  constructFileDialogOperation( shell, null, System.getProperty( "user.home" ) );
}

Prevention

When it happens

Trigger: constructFileDialogOperation resolving a start directory whose VFS FileObject cannot be queried: unreachable SFTP host, permission-denied share, deleted/nonexistent folder referenced by a saved setting, or corrupt VFS URI.

Common situations: A previously remembered 'last directory' no longer exists or is no longer accessible; a mounted network drive went offline; repository-based paths moved after a repo migration.

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/ddee3fbf449b58e1. Report an issue: GitHub.

Appendix: source

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

      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() ) ) {
        op.setProvider( ProviderFilterType.CLUSTERS.toString() );
      } else {
        op.setProvider( ProviderFilterType.LOCAL.toString() );
      }
    } else if ( op.getProviderFilter().equalsIgnoreCase( ProviderFilterType.DEFAULT.toString() ) ) {
      if ( isConnectionFile( initalFile ) ) {
        op.setProvider( ProviderFilterType.VFS.toString() );
      } else if ( "hc".equalsIgnoreCase( initalFile.getURI().getScheme() ) ) {

View on GitHub (pinned to f3058517a1)