{"record":{"id":"c1d6a8e11db52a66","repo":"pentaho/pentaho-kettle","slug":"row-endoffilereached","errorCode":null,"errorMessage":"Row.EndOfFileReached","messagePattern":"Row\\.EndOfFileReached","errorType":"exception","errorClass":"KettleEOFException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/compatibility/Row.java","lineNumber":487,"sourceCode":"    // get all values in the row\n    for ( int i = 0; i < size; i++ ) {\n      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 );","sourceCodeStart":469,"sourceCodeEnd":505,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/compatibility/Row.java#L469-L505","documentation":"getEnvironmentVar returns the value of a JVM system property from within JavaScript, and it requires exactly 1 argument (the property name). When ArgList.length != 1 the function throws this Rhino runtime error at ScriptValuesAddedFunctions.java:1629 instead of returning a value. Note the function returns an empty string (not an error) if the property lookup itself fails.","triggerScenarios":"Calling getEnvironmentVar() with zero arguments, or with 2+ arguments such as getEnvironmentVar('A', 'B'), from JavaScript in the Script Values step.","commonSituations":"Passing a fallback default as a second argument (assuming an API that does not exist); accidentally passing an extra separator or option argument; calling with no arguments after refactoring.","solutions":["Call with exactly one string argument: getEnvironmentVar('MY_KEY').","Handle the empty-string return for missing properties yourself: var v = getEnvironmentVar('K'); if (v == '') v = 'default'.","Remove any extra/default arguments from the call."],"exampleFix":"// before\nvar v = getEnvironmentVar(\"MY_KEY\", \"default\");\n// after\nvar v = getEnvironmentVar(\"MY_KEY\");\nif (v == \"\") v = \"default\";","handlingStrategy":"validation","validationCode":"if (arguments.length !== 1) throw new Error(\"getEnvironmentVar takes exactly one property name\");","typeGuard":"null","tryCatchPattern":"var v;\ntry {\n  v = getEnvironmentVar(\"MY_KEY\");\n} catch (e) {\n  v = \"\"; // treat as missing\n}\nif (v == \"\") v = \"default\";","preventionTips":["Remember there is no default-value parameter - implement fallbacks yourself","Missing properties return \"\", not an error - check for that","Keep exactly one string argument"],"tags":["javascript","argument-count","scripting","environment"],"backgroundTag":"missing-required-argument","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"}