{"record":{"id":"820576b1f2763e24","repo":"pentaho/pentaho-kettle","slug":"kettlevalueexception-with-no-message-rethrow-of","errorCode":null,"errorMessage":"KettleValueException with no message (rethrow of KettleFileNotFoundException from deprecated loadFileContentInBinary)","messagePattern":"KettleValueException with no message \\(rethrow of KettleFileNotFoundException from deprecated loadFileContentInBinary\\)","errorType":"exception","errorClass":"org.pentaho.di.core.exception.KettleValueException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/row/ValueDataUtil.java","lineNumber":674,"sourceCode":"    }\n    if ( dataA != null && dataB == null ) {\n      return dataA;\n    }\n\n    return plus( metaA, dataA, metaB, dataB );\n  }\n\n  /**\n   * @deprecated Use {@link ValueDataUtil#loadFileContentInBinary(ValueMetaInterface, Object, boolean)} instead\n   */\n  @Deprecated\n  public static Object loadFileContentInBinary( Bowl bowl, ValueMetaInterface metaA, Object dataA )\n    throws KettleValueException {\n    Object content = null;\n    try {\n      content = loadFileContentInBinary( bowl, metaA, dataA, true );\n    } catch ( KettleFileNotFoundException e ) {\n      throw new KettleValueException();\n    }\n    return content;\n  }\n\n  /**\n   *\n   * @param metaA\n   *   The ValueMetaInterface\n   * @param dataA\n   *   Filename\n   * @param failIfNoFile\n   *   Indicates if the transformation should fail if no file is found\n   * @return File's content in binary\n   * @throws KettleValueException\n   * @throws KettleFileNotFoundException\n   */\n  public static byte[] loadFileContentInBinary( Bowl bowl, ValueMetaInterface metaA, Object dataA,\n    boolean failIfNoFile ) throws KettleValueException, KettleFileNotFoundException {","sourceCodeStart":656,"sourceCodeEnd":692,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/row/ValueDataUtil.java#L656-L692","documentation":"This deprecated overload of loadFileContentInBinary catches the KettleFileNotFoundException thrown by the full version and rethrows it as a bare new KettleValueException() with NO message or cause. The original filename and reason are lost, making this error notoriously opaque.","triggerScenarios":"Calling ValueDataUtil.loadFileContentInBinary(bowl, metaA, dataA) where the file named in dataA does not exist — the inner call's KettleFileNotFoundException is swallowed and replaced by a message-less KettleValueException.","commonSituations":"Legacy transformations using the binary file content calculator on a missing/unmounted file; paths valid on dev machine but absent in production.","solutions":["Switch to the 4-arg overload loadFileContentInBinary(bowl, metaA, dataA, failIfNoFile) which propagates the real exception","Pre-check file existence and skip the call when the file is missing","Call the newer non-deprecated API so KettleFileNotFoundException with the path is preserved","Log the input filename before the call to recover which file failed"],"exampleFix":"// before\nObject content = ValueDataUtil.loadFileContentInBinary(bowl, metaA, dataA); // throws empty KettleValueException\n// after\nObject content = ValueDataUtil.loadFileContentInBinary(bowl, metaA, dataA, true); // preserves KettleFileNotFoundException","handlingStrategy":"try-catch","validationCode":"// Java: pre-check file existence via the value's filename\nString filename = metaA.getString(dataA);\nFileObject f = KettleVFS.getFileObject(filename);\nif (f == null || !f.exists()) {\n  throw new FileNotFoundException(\"Binary content file missing: \" + filename);\n}","typeGuard":null,"tryCatchPattern":"try {\n  content = ValueDataUtil.loadFileContentInBinary(bowl, metaA, dataA);\n} catch (KettleValueException e) {\n  // message-less by design; check the filename yourself\n  log.error(\"Binary file load failed for: \" + metaA.getString(dataA));\n  throw e;\n}","preventionTips":["Migrate off this deprecated overload to the 4-arg variant that preserves the cause","Log the target filename before invoking so failures are attributable","Pre-validate existence with KettleVFS before the call","Search usages and replace during upgrades — the empty exception hides root causes"],"tags":["deprecated","file","swallowed-exception","kettle"],"backgroundTag":"deprecated-api-usage","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"}