pentaho/pentaho-kettle · error · KettleException

ExcelInput.Exception.CanNotCreateFileObject

ExcelInput.Exception.CanNotCreateFileObject

Error message

ExcelInput.Exception.CanNotCreateFileObject

What it means

Thrown in processRow when KettleVFS cannot create a FileObject for a filename received on the file-row rowset. The KettleFileException is wrapped in a KettleException including the offending file value. It signals a VFS-level failure resolving the file path (bad URI scheme, invalid path, provider error).

Solutions

  1. Correct the file value flowing into the step to be a valid absolute path or VFS URI
  2. Test the exact string with a simple VFS open (e.g. in a 'Get file names' step) to see the resolver error
  3. Ensure the filename has no characters illegal in a VFS URI and that the scheme (file:, s3:, etc.) is supported by installed VFS plugins
Defensive patterns

Strategy: validation

Validate before calling

// Validate each filename before feeding it to the Excel Input 'file' rowset
for (String f : fileValues) {
  if (f == null || f.trim().isEmpty()) throw new IllegalArgumentException("empty file value");
  FileObject fo = KettleVFS.getInstance(bowl).getFileObject(f, transMeta); // throws early if invalid
}

Try / catch

try {
  data.files.addFile(KettleVFS.getInstance(bowl).getFileObject(fileValue, transMeta));
} catch (KettleFileException e) {
  logError("Unresolvable VFS path: " + fileValue, e); // skip row or abort
}

Prevention

When it happens

Trigger: A row arriving on the 'file' input rowset contains a string that KettleVFS.getFileObject() cannot resolve into a FileObject (invalid VFS URI, unsupported scheme, resolver failure).

Common situations: Filenames with spaces or special characters that break VFS URI parsing; paths using a scheme no VFS provider is installed for; rows fed from a previous step containing malformed or empty file values.

Understand the failure class

Background: "open() failed", "failed to open file", "cannot create file" — what a file open error means and how to fix it — this error's family across 42 libraries.

Related errors


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

Appendix: source

Thrown at plugins/excel/core/src/main/java/org/pentaho/di/trans/steps/excelinput/ExcelInput.java:400

        Object[] fileRow = getRowFrom( rowSet );
        while ( fileRow != null ) {
          if ( idx < 0 ) {
            idx = rowSet.getRowMeta().indexOfValue( meta.getAcceptingField() );
            if ( idx < 0 ) {
              logError( BaseMessages.getString( PKG, "ExcelInput.Error.FilenameFieldNotFound", ""
                + meta.getAcceptingField() ) );

              setErrors( 1 );
              stopAll();
              return false;
            }
          }
          String fileValue = rowSet.getRowMeta().getString( fileRow, idx );
          try {
            data.files.addFile( KettleVFS.getInstance( getTransMeta().getBowl() )
              .getFileObject( fileValue, getTransMeta() ) );
          } catch ( KettleFileException e ) {
            throw new KettleException( BaseMessages.getString(
              PKG, "ExcelInput.Exception.CanNotCreateFileObject", fileValue ), e );
          }

          // Grab another row
          fileRow = getRowFrom( rowSet );
        }
      }

      handleMissingFiles();
    }

    // See if we're not done processing...
    // We are done processing if the filenr >= number of files.
    if ( data.filenr >= data.files.nrOfFiles() ) {
      if ( log.isDetailed() ) {
        logDetailed( BaseMessages.getString( PKG, "ExcelInput.Log.NoMoreFiles", "" + data.filenr ) );
      }

View on GitHub (pinned to f3058517a1)