{"record":{"id":"eef77b747f68930b","repo":"pentaho/pentaho-kettle","slug":"gpload-exception-datafilemissing-gploaddataoutput","errorCode":null,"errorMessage":"GPload.Exception.DataFileMissing","messagePattern":"GPload\\.Exception\\.DataFileMissing","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/gpload/core/src/main/java/org/pentaho/di/trans/steps/gpload/GPLoadDataOutput.java","lineNumber":86,"sourceCode":"    log = new LogChannel( this );\n    log.setLogLevel( logLevel );\n  }\n\n  public void open( VariableSpace space, Process sqlldrProcess ) throws KettleException {\n    // String loadMethod = meta.getLoadMethod();\n    try {\n      OutputStream os = null;\n\n      // if ( GPLoadMeta.METHOD_AUTO_CONCURRENT.equals(loadMethod)) {\n      // String dataFile = meta.getControlFile();\n      // dataFile = StringUtil.environmentSubstitute(dataFile);\n      // os = new FileOutputStream(dataFile, true);\n      // } else {\n      // Else open the data file filled in.\n\n      String dataFile = meta.getDataFile();\n      if ( Utils.isEmpty( dataFile ) ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"GPload.Exception.DataFileMissing\" ) );\n      }\n\n      dataFile = space.environmentSubstitute( dataFile );\n      if ( Utils.isEmpty( dataFile ) ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"GPload.Exception.DataFileMissing\" ) );\n      }\n\n      log.logDetailed( \"Creating temporary load file \" + dataFile );\n      os = new FileOutputStream( dataFile, false );\n      //\n\n      String encoding = meta.getEncoding();\n      if ( Utils.isEmpty( encoding ) ) {\n        // Use the default encoding.\n        output = new PrintWriter( new BufferedWriter( new OutputStreamWriter( os ) ) );\n      } else {\n        // Use the specified encoding\n        output = new PrintWriter( new BufferedWriter( new OutputStreamWriter( os, encoding ) ) );","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/gpload/core/src/main/java/org/pentaho/di/trans/steps/gpload/GPLoadDataOutput.java#L68-L104","documentation":"GPLoadDataOutput.open() validates the data file path from the step metadata before creating the load file. It throws this KettleException when the configured 'data file' is empty or null (both before and after variable substitution). The GPload step needs a file to buffer rows before invoking the gpload utility.","triggerScenarios":"open() is called (from getFields/getOutputFields/check/readFile paths) while meta.getDataFile() returns null/empty, or after space.environmentSubstitute() the substituted value resolves to empty (e.g. a variable like ${DATAFILE} that is undefined).","commonSituations":"Step saved without filling the 'Data file' field; ${DATAFILE} environment variable/parameter undefined at runtime; XML or repository metadata lost the datafile attribute after a migration or hand-edited ktr.","solutions":["Open the GPload step dialog and set the 'Data file' field to a valid absolute path","Define the variable used in the data file path (set it in kettle.properties or as a transformation parameter) so environmentSubstitute() resolves it non-empty","Inspect the saved .ktr XML for an empty <data_file> element and fix the metadata","Check the repository-saved step attributes and re-save the step with a data file"],"exampleFix":"// before (kettle.xml snippet)\n<data_file/>\n// after\n<data_file>/tmp/gpload_data.txt</data_file>","handlingStrategy":"validation","validationCode":"String dataFile = meta.getDataFile();\nif (dataFile == null || dataFile.trim().isEmpty()\n    || dataFile.trim().replace(\"${\", \"\").equals(dataFile) == false && dataFile.contains(\"${\") ) {\n  throw new IllegalStateException(\"GPload data file must be set to a concrete path or resolvable variable\");\n}","typeGuard":"boolean hasDataFile(GPLoadMeta m) { String d = m.getDataFile(); return d != null && !d.trim().isEmpty(); }","tryCatchPattern":"try { gpLoad.init(...); } catch (KettleException e) { if (e.getMessage().contains(\"DataFileMissing\")) { /* prompt user / set default path and retry */ } else throw e; }","preventionTips":["Always fill the 'Data file' field in the GPload dialog before saving","Prefer absolute paths over bare variables in shared/cluster environments","Add a validation step that checks variables used in file paths resolve non-empty","Review saved .ktr XML for empty data_file elements before deployment"],"tags":["kettle","gplonot-a-typo","pdi","configuration","missing-path"],"backgroundTag":"empty-required-field","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"}