pentaho/pentaho-kettle · error · KettleException

Unable to verify file

Error message

Unable to verify file '<file>'

What it means

JobEntryXMLWellFormed.checkOneFile wraps any exception raised while validating a single file's XML well-formedness in a KettleException. The file's name is interpolated into the message and the original cause is preserved as the wrapped exception, so the real reason (parse error, I/O problem, VFS issue) is in the cause chain.

Solutions

  1. Open the file listed in the message in a plain XML parser to see the real cause from the wrapped exception
  2. Fix or remove the malformed/unreadable file
  3. Verify the filename variables resolve to a valid, accessible path
  4. Check file permissions and that the file is not locked by another process

Example fix

// before: job fails with generic message
// after: pre-check the file before running the job entry
if ( new File( filename ).exists() && new File( filename ).canRead() ) {
  jobEntry.execute( result, 0 );
}
Defensive patterns

Strategy: try-catch

Validate before calling

File f = new File( filename );
if ( !f.exists() || !f.canRead() ) {
  throw new IllegalStateException( "File missing or unreadable: " + filename );
}

Try / catch

try {
  jobEntry.execute( result, 0 );
} catch ( KettleException e ) {
  Throwable cause = e.getCause();
  logError( "File check failed for entry: " + cause.getMessage(), cause );
  result.setResult( false );
}

Prevention

When it happens

Trigger: processFileFolder calls checkOneFile for each file; any Exception thrown while obtaining/reading/parsing the file (e.g. KettleVFS file resolution failure, SAXParser IOException, malformed XML) triggers the wrap.

Common situations: Malformed XML files in the watched folder; file deleted or locked between listing and validation; invalid/variable-unresolved filenames; VFS cannot open network/zip-hosted files.

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

Appendix: source

Thrown at plugins/xml/core/src/main/java/org/pentaho/di/job/entries/xmlwellformed/JobEntryXMLWellFormed.java:527

        // Update Bad formed files number
        updateBadFormed();
        if ( resultfilenames.equals( ADD_ALL_FILENAMES ) || resultfilenames.equals( ADD_BAD_FORMED_FILES_ONLY ) ) {
          addFileToResultFilenames( KettleVFS.getFilename( file ), result, parentJob );
        }
      } else {
        if ( log.isDetailed() ) {
          logDetailed( "---------------------------" );
          logDetailed( BaseMessages.getString( PKG, "JobXMLWellFormed.Error.FileWellFormed", file.toString() ) );
        }
        // Update Well formed files number
        updateWellFormed();
        if ( resultfilenames.equals( ADD_ALL_FILENAMES ) || resultfilenames.equals( ADD_WELL_FORMED_FILES_ONLY ) ) {
          addFileToResultFilenames( KettleVFS.getFilename( file ), result, parentJob );
        }
      }

    } catch ( Exception e ) {
      throw new KettleException( "Unable to verify file '" + file + "'", e );
    }
    return retval;
  }

  private void updateWellFormed() {
    NrWellFormed++;
  }

  private void updateBadFormed() {
    NrBadFormed++;
    updateAllErrors();
  }

  private void addFileToResultFilenames( String fileaddentry, Result result, Job parentJob ) {
    try {
      ResultFile resultFile =
          new ResultFile( ResultFile.FILE_TYPE_GENERAL, KettleVFS.getInstance( parentJobMeta.getBowl() )
            .getFileObject( fileaddentry, this ), parentJob.getJobname(), toString() );

View on GitHub (pinned to f3058517a1)