{"record":{"id":"24b01b77e91b73fa","repo":"pentaho/pentaho-kettle","slug":"row-errorreadingrowdata","errorCode":null,"errorMessage":"Row.ErrorReadingRowData","messagePattern":"Row\\.ErrorReadingRowData","errorType":"exception","errorClass":"KettleFileException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/compatibility/Row.java","lineNumber":489,"sourceCode":"      Value v = new Value();\n      v.readObj( dis );\n      addValue( v );\n    }\n  }\n\n  /**\n   * Read a row of Values from an input-stream.\n   *\n   * @param dis\n   *          The DataInputStream to read from\n   */\n  public Row( DataInputStream dis ) throws KettleFileException {\n    try {\n      readObj( dis );\n    } catch ( EOFException e ) {\n      throw new KettleEOFException( BaseMessages.getString( PKG, \"Row.EndOfFileReached\" ), e );\n    } catch ( Exception e ) {\n      throw new KettleFileException( BaseMessages.getString( PKG, \"Row.ErrorReadingRowData\" ), e );\n    }\n  }\n\n  /**\n   * Read a number of Values without meta-data into a row.\n   *\n   * @param dis\n   *          The DataInputStream to read from\n   * @param meta\n   *          The description (name, type, length, precision) of the values to be read (the same number of values are\n   *          read)\n   * @throws KettleFileException\n   *           if the row couldn't be created by reading from the data input stream.\n   */\n  public Row( DataInputStream dis, Row meta ) throws KettleFileException {\n    this( dis, meta.size(), meta );\n  }\n","sourceCodeStart":471,"sourceCodeEnd":507,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/compatibility/Row.java#L471-L507","documentation":"The trim scripting function wraps any exception raised while trimming (string conversion or Const.trim) into a Rhino runtime error prefixed with 'The function call trim is not valid : '. The thrown message concatenates e.getMessage(), so the trailing colon in the fixed prefix is followed by the underlying cause text. It fires only when the argument count is already correct (1) but processing fails.","triggerScenarios":"Calling trim(x) with exactly one argument whose Context.toString() conversion throws, or a non-convertible Scriptable/Java object, or an internal error in Const.trim.","commonSituations":"Passing a Java object reference or host object that cannot be coerced to a JavaScript string; passing null wrapped values from a previous step; Rhino conversion quirks with undefined-but-not-undefined wrappers.","solutions":["Coerce the argument to a string yourself before trimming: trim(String(x)).","Guard against null/undefined: if (x == null) x = ''; before calling trim.","Read the text after the colon in the thrown message to identify the underlying conversion failure.","Use native JavaScript x.trim() ( Rhino 1.7+ supports it) instead of the Kettle trim function."],"exampleFix":"// before\ntrim(someJavaObject);\n// after\nvar s = (someJavaObject == null) ? \"\" : String(someJavaObject);\ntrim(s);","handlingStrategy":"type-guard","validationCode":"if (x == null) x = \"\";\nif (typeof x === \"object\") x = String(x);","typeGuard":"function isStringable(x) { return x != null && typeof x !== \"undefined\"; }","tryCatchPattern":"var t;\ntry {\n  t = trim(String(x));\n} catch (e) {\n  t = String(x == null ? \"\" : x).replace(/^\\s+|\\s+$/g, \"\");\n}","preventionTips":["Normalize null/undefined to \"\" before trimming","Coerce Java objects with String(x) first","Prefer native JavaScript x.trim() when the Rhino version supports it"],"tags":["javascript","string-processing","scripting","type-coercion"],"backgroundTag":"invalid-argument-value","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"}