pentaho/pentaho-kettle · error · RuntimeException

The function call is File throw an error : + e.toString()

Error message

The function call is File throw an error :  + e.toString()

What it means

Thrown by ScriptAddedFunctions.isFile when an IOException occurs while resolving or closing the VFS file object. The IOException is caught and rethrown as a RuntimeException with message 'The function call is File throw an error : ' plus e.toString(), so the original cause text appears after the prefix.

Solutions

  1. Read the cause text after the 'is File throw an error : ' prefix to find the real IOException.
  2. Validate the VFS URI format and credentials (scheme, host, user) for remote filesystems.
  3. Retry if the failure was transient (network blip on sftp/http providers).
  4. Escape special characters in the path or switch to a local-path equivalent.
Defensive patterns

Strategy: try-catch

Validate before calling

var f = new java.io.File(path);
if (f.exists() && f.canRead()) {
  var ok = isFile(path);
}

Try / catch

try {
  ok = isFile(path);
} catch (e) {
  // message is 'The function call is File throw an error : ' + cause
  Logger.logError('isFile failed: ' + e.message);
}

Prevention

When it happens

Trigger: KettleVFS.getInstance(bowl).getFileObject(path) or file.close() throws IOException: malformed VFS URI, remote filesystem unreachable, permission/I/O errors during resolution.

Common situations: SFTP/HTTP VFS providers failing due to network or auth problems, URIs with unescaped special characters, and transient remote-filesystem outages.

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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/script/ScriptAddedFunctions.java:2149

        }
        FileObject file = null;

        try {
          // Source file
          file = KettleVFS.getInstance( bowl ).getFileObject( (String) ArgList[0] );
          boolean isafile = false;
          if ( file.exists() ) {
            if ( file.getType().equals( FileType.FILE ) ) {
              isafile = true;
            } else {
              throw new RuntimeException( "[" + ArgList[0] + "] is not a file!" );
            }
          } else {
            throw new RuntimeException( "file [" + ArgList[0] + "] can not be found!" );
          }
          return isafile;
        } catch ( IOException e ) {
          throw new RuntimeException( "The function call is File throw an error : " + e.toString() );
        } finally {
          if ( file != null ) {
            try {
              file.close();
            } catch ( Exception e ) {
              // Ignore errors
            }
          }
        }

      } else {
        throw new RuntimeException( "The function call isFile is not valid." );
      }
    } catch ( Exception e ) {
      throw new RuntimeException( e.toString() );
    }
  }

View on GitHub (pinned to f3058517a1)