{"record":{"id":"773acb7eb7d21d44","repo":"pentaho/pentaho-kettle","slug":"ex-getmessage","errorCode":null,"errorMessage":"ex.getMessage()","messagePattern":"ex\\.getMessage\\(\\)","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/gpload/core/src/main/java/org/pentaho/di/trans/steps/gpload/GPLoad.java","lineNumber":418,"sourceCode":"    String filename = meta.getControlFile();\n    if ( Utils.isEmpty( filename ) ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"GPLoad.Exception.NoControlFileSpecified\" ) );\n    } else {\n      filename = environmentSubstitute( filename ).trim();\n      if ( Utils.isEmpty( filename ) ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"GPLoad.Exception.NoControlFileSpecified\" ) );\n      }\n    }\n\n    File controlFile = new File( filename );\n    FileWriter fw = null;\n\n    try {\n      controlFile.createNewFile();\n      fw = new FileWriter( controlFile );\n      fw.write( getControlFileContents( meta, getInputRowMeta() ) );\n    } catch ( IOException ex ) {\n      throw new KettleException( ex.getMessage(), ex );\n    } finally {\n      try {\n        if ( fw != null ) {\n          fw.close();\n        }\n      } catch ( Exception ignored ) {\n        // Ignore error\n      }\n    }\n  }\n\n  /**\n   * Returns the path to the pathToFile. It should be the same as what was passed but this method will check the file\n   * system to see if the path is valid.\n   *\n   * @param pathToFile\n   *          Path to the file to verify.\n   * @param exceptionMessage","sourceCodeStart":400,"sourceCodeEnd":436,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/gpload/core/src/main/java/org/pentaho/di/trans/steps/gpload/GPLoad.java#L400-L436","documentation":"createControlFile wraps control-file creation and writing in try/catch; when the JVM throws an IOException (createNewFile, FileWriter, or write fail), it is rethrown as a KettleException whose message is the IOException's message and which keeps the original as the cause. Typical underlying causes are filesystem problems, not configuration.","triggerScenarios":"controlFile.createNewFile(), new FileWriter(controlFile), or fw.write(...) throws IOException — e.g. the target directory does not exist, permission is denied, disk is full, or the path is a directory.","commonSituations":"Control-file path points to a read-only or nonexistent directory; the user running Pentaho lacks write permission; disk full on the PDI server; path is actually a directory; SELinux/container mount restrictions.","solutions":["Check the exception's cause chain (KettleException.getCause()) for the exact IOException.","Verify the parent directory of the control-file path exists and is writable by the PDI process user.","Create missing directories or correct the control-file path in the step dialog.","Check free disk space and mount/permission policies (chmod, SELinux, container volumes)."],"exampleFix":"// before: writing to a directory that does not exist -> IOException\nmeta.setControlFile(\"/nonexistent/dir/load.ctl\");\n// after\nnew File(\"/data/gpload\").mkdirs(); // ensure directory exists & is writable\nmeta.setControlFile(\"/data/gpload/load.ctl\");","handlingStrategy":"try-catch","validationCode":"File ctl = new File(meta.getControlFile().trim());\nFile parent = ctl.getAbsoluteFile().getParentFile();\nif (parent == null || !parent.isDirectory() || !parent.canWrite()) {\n  throw new IllegalArgumentException(\"Control file directory missing or not writable: \" + parent);\n}","typeGuard":null,"tryCatchPattern":"try {\n  step.createControlFile(meta);\n} catch (KettleException e) {\n  Throwable cause = e.getCause();\n  if (cause instanceof java.io.IOException) {\n    // inspect cause.getMessage() for permission/disk/path issues, then retry or abort\n  } else throw e;\n}","preventionTips":["Ensure the control-file directory exists (mkdirs) before the transformation runs.","Run PDI as a user with write permission on the target directory.","Monitor disk space on servers executing GPLoad steps.","Unwrap KettleException.getCause() when logging to see the real IOException."],"tags":["kettle","gpload","io","filesystem","file-write"],"backgroundTag":"file-write-failed","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"}