{"record":{"id":"d20ab3f7c0681b8f","repo":"pentaho/pentaho-kettle","slug":"unable-to-verify-file-file","errorCode":null,"errorMessage":"Unable to verify file '<file>'","messagePattern":"Unable to verify file '<file>'","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/xml/core/src/main/java/org/pentaho/di/job/entries/xmlwellformed/JobEntryXMLWellFormed.java","lineNumber":527,"sourceCode":"        // Update Bad formed files number\n        updateBadFormed();\n        if ( resultfilenames.equals( ADD_ALL_FILENAMES ) || resultfilenames.equals( ADD_BAD_FORMED_FILES_ONLY ) ) {\n          addFileToResultFilenames( KettleVFS.getFilename( file ), result, parentJob );\n        }\n      } else {\n        if ( log.isDetailed() ) {\n          logDetailed( \"---------------------------\" );\n          logDetailed( BaseMessages.getString( PKG, \"JobXMLWellFormed.Error.FileWellFormed\", file.toString() ) );\n        }\n        // Update Well formed files number\n        updateWellFormed();\n        if ( resultfilenames.equals( ADD_ALL_FILENAMES ) || resultfilenames.equals( ADD_WELL_FORMED_FILES_ONLY ) ) {\n          addFileToResultFilenames( KettleVFS.getFilename( file ), result, parentJob );\n        }\n      }\n\n    } catch ( Exception e ) {\n      throw new KettleException( \"Unable to verify file '\" + file + \"'\", e );\n    }\n    return retval;\n  }\n\n  private void updateWellFormed() {\n    NrWellFormed++;\n  }\n\n  private void updateBadFormed() {\n    NrBadFormed++;\n    updateAllErrors();\n  }\n\n  private void addFileToResultFilenames( String fileaddentry, Result result, Job parentJob ) {\n    try {\n      ResultFile resultFile =\n          new ResultFile( ResultFile.FILE_TYPE_GENERAL, KettleVFS.getInstance( parentJobMeta.getBowl() )\n            .getFileObject( fileaddentry, this ), parentJob.getJobname(), toString() );","sourceCodeStart":509,"sourceCodeEnd":545,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/xml/core/src/main/java/org/pentaho/di/job/entries/xmlwellformed/JobEntryXMLWellFormed.java#L509-L545","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Open the file listed in the message in a plain XML parser to see the real cause from the wrapped exception","Fix or remove the malformed/unreadable file","Verify the filename variables resolve to a valid, accessible path","Check file permissions and that the file is not locked by another process"],"exampleFix":"// before: job fails with generic message\n// after: pre-check the file before running the job entry\nif ( new File( filename ).exists() && new File( filename ).canRead() ) {\n  jobEntry.execute( result, 0 );\n}","handlingStrategy":"try-catch","validationCode":"File f = new File( filename );\nif ( !f.exists() || !f.canRead() ) {\n  throw new IllegalStateException( \"File missing or unreadable: \" + filename );\n}","typeGuard":null,"tryCatchPattern":"try {\n  jobEntry.execute( result, 0 );\n} catch ( KettleException e ) {\n  Throwable cause = e.getCause();\n  logError( \"File check failed for entry: \" + cause.getMessage(), cause );\n  result.setResult( false );\n}","preventionTips":["Validate that all filename variables resolve before running the job","Pre-parse sample files with a standalone XML parser in CI","Ensure files are fully written before the job entry scans them","Monitor folders for files locked by other processes"],"tags":["pdi","xml","file-validation","kettle-exception"],"backgroundTag":"file-read-failed","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}