{"record":{"id":"939be123e438c8e2","repo":"pentaho/pentaho-kettle","slug":"file-not-found","errorCode":null,"errorMessage":"File not found","messagePattern":"File not found","errorType":"exception","errorClass":"org.pentaho.di.core.exception.KettleFileNotFoundException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/row/ValueDataUtil.java","lineNumber":114,"sourceCode":"      round2Mode = ROUND_2_MODE_DEFAULT_VALUE;\n      log.debug( \"System property is omitted: ROUND_2_MODE. Default value used: \" + SYS_PROPERTY_ROUND_2_MODE_DEFAULT_VALUE + \".\" );\n    } else if ( SYS_PROPERTY_ROUND_2_MODE_DEFAULT_VALUE.equals( rpaValue ) ) {\n      round2Mode = ROUND_2_MODE_DEFAULT_VALUE;\n      log.debug( \"System property read: ROUND_2_MODE=\" + ROUND_2_MODE_DEFAULT_VALUE + \" (default value)\" );\n    } else if ( SYS_PROPERTY_ROUND_2_MODE_BACKWARD_COMPATIBILITY_VALUE.equalsIgnoreCase( rpaValue ) ) {\n      round2Mode = ROUND_2_MODE_BACKWARD_COMPATIBILITY_VALUE;\n      log.debug( \"System property read: ROUND_2_MODE=\" + SYS_PROPERTY_ROUND_2_MODE_BACKWARD_COMPATIBILITY_VALUE\n          + \" (backward compatibility value)\" );\n    } else {\n      log.warn( \"Incorrect value of system property read: ROUND_2_MODE=\" + rpaValue + \". Set to \" + SYS_PROPERTY_ROUND_2_MODE_DEFAULT_VALUE\n          + \" instead.\" );\n    }\n    return round2Mode;\n  }\n\n  private static void throwsErrorOnFileNotFound( FileObject file ) throws KettleFileNotFoundException, FileSystemException {\n    if ( file == null || !file.exists() ) {\n      throw new KettleFileNotFoundException( \"File not found\", file.getName().getPath() );\n    }\n  }\n\n  /**\n   * @deprecated Use {@link Const#ltrim(String)} instead\n   */\n  @Deprecated\n  public static final String leftTrim( String string ) {\n    return Const.ltrim( string );\n  }\n\n  /**\n   * @deprecated Use {@link Const#rtrim(String)} instead\n   */\n  @Deprecated\n  public static final String rightTrim( String string ) {\n    return Const.rtrim( string );\n  }","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/row/ValueDataUtil.java#L96-L132","documentation":"ValueDataUtil.throwsErrorOnFileNotFound pre-checks a Commons-VFS FileObject before file-based calculations (checksums, CRC32, Adler32, encoding detection, XML validation). If the file is null or does not exist it throws KettleFileNotFoundException carrying the path. It exists to fail fast with a clear message instead of a downstream FileSystemException.","triggerScenarios":"Calling ValueDataUtil.createChecksum, checksumCRC32, checksumAdler32, loadFileContentInBinary, isXMLFileWellFormed, or getFileEncoding with a file path that is null-resolving or absent on the filesystem/VFS.","commonSituations":"Typos or wrong relative paths in a 'File exists/Checksum' step; file deleted between listing and processing; running on a node where the file is not mounted; case-sensitivity differences on Linux.","solutions":["Verify the path exists (file.exists()) before the call, and correct typos/relative-path resolution","Check that the file is accessible from the machine executing the step (mounted volume, agent node)","Use a 'Check if file exists' step or earlier validation to skip missing files gracefully","Confirm correct case sensitivity for the target OS filesystem"],"exampleFix":"// before\nObject crc = ValueDataUtil.checksumCRC32(meta, vfsFile); // file may not exist\n// after\nif (vfsFile != null && vfsFile.exists()) {\n  Object crc = ValueDataUtil.checksumCRC32(meta, vfsFile);\n} else {\n  // skip or log missing file\n}","handlingStrategy":"validation","validationCode":"// Java (Commons VFS)\nif (fileObject == null || !fileObject.exists()) {\n  throw new FileNotFoundException(fileObject == null ? \"<null>\" : fileObject.getName().getPath());\n}","typeGuard":"boolean isUsableFile(FileObject f) {\n  try { return f != null && f.exists() && f.getType().hasChildren() != null; }\n  catch (FileSystemException e) { return false; }\n}","tryCatchPattern":"try {\n  Object crc = ValueDataUtil.checksumCRC32(meta, file);\n} catch (KettleFileNotFoundException e) {\n  log.warn(\"Missing file: \" + e.getMessage());\n  // skip or default value\n}","preventionTips":["Resolve paths against a configured base directory and validate at startup","Handle OS case-sensitivity differences (Linux vs Windows)","Use a 'Check if file exists' flow step before file-dependent calculations","Verify files are mounted/accessible on the node actually executing the step"],"tags":["file","vfs","not-found","kettle"],"backgroundTag":"file-not-found","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"}