{"record":{"id":"93e2d21fc9461cf6","repo":"pentaho/pentaho-kettle","slug":"gpload-log-exitvaluepsqlpath","errorCode":null,"errorMessage":"GPLoad.Log.ExitValuePsqlPath","messagePattern":"GPLoad\\.Log\\.ExitValuePsqlPath","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/gpload/core/src/main/java/org/pentaho/di/trans/steps/gpload/GPLoad.java","lineNumber":553,"sourceCode":"\n      gploadProcess = rt.exec( commandLine );\n\n      // any error message?\n      StreamLogger errorLogger = new StreamLogger( gploadProcess.getErrorStream(), \"ERROR\" );\n\n      // any output?\n      StreamLogger outputLogger = new StreamLogger( gploadProcess.getInputStream(), \"OUTPUT\" );\n\n      // kick them off\n      errorLogger.start();\n      outputLogger.start();\n\n      if ( wait ) {\n        // any error???\n        gpLoadExitVal = gploadProcess.waitFor();\n        logBasic( BaseMessages.getString( PKG, \"GPLoad.Log.ExitValuePsqlPath\", \"\" + gpLoadExitVal ) );\n        if ( gpLoadExitVal != -0 ) {\n          throw new KettleException( BaseMessages.getString( PKG, \"GPLoad.Log.ExitValuePsqlPath\", \"\" + gpLoadExitVal ) );\n        }\n      }\n    } catch ( KettleException ke ) {\n      throw ke;\n    } catch ( Exception ex ) {\n      // Don't throw the message upwards, the message contains the password.\n      throw new KettleException( \"Error while executing \\'\" + commandLine + \"\\'. Exit value = \" + gpLoadExitVal );\n    }\n\n    return true;\n  }\n\n  public boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException {\n    meta = (GPLoadMeta) smi;\n    data = (GPLoadData) sdi;\n\n    try {\n      Object[] r = getRow(); // Get row from input rowset & set row busy!","sourceCodeStart":535,"sourceCodeEnd":571,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/gpload/core/src/main/java/org/pentaho/di/trans/steps/gpload/GPLoad.java#L535-L571","documentation":"After execute() waits for the gpload child process, it throws a KettleException using key GPLoad.Log.ExitValuePsqlPath when the process exit value is non-zero (the code's '!= -0' test effectively means '!= 0'). The same key is used for the preceding log line, and the message includes the exit value.","triggerScenarios":"gploadProcess.waitFor() returns any value other than 0 - gpload itself failed (bad control file, connection failure, data errors) and execute() rethrows as a KettleException.","commonSituations":"Wrong gpload connection settings (host/port/db/user); errors in the generated control file; data format mismatches rejected by gpload; gpload not found by the shell (exit 127).","solutions":["Read the gpload process stdout/stderr in the step log to see gpload's own error report.","Fix the underlying gpload failure (connection params, control-file content, data formatting).","Test the identical gpload command manually from the shell as the Pentaho user.","Confirm gpload/psql binaries and GPLOAD_HOME, PATH, LD_LIBRARY_PATH for the executing account."],"exampleFix":"// before: step fails with exit value 2, control file references wrong schema\n// after (correct meta)\ndatabaseMeta.setHostname(\"gpmaster\"); databaseMeta.setDBName(\"analytics\"); // matches gpload target","handlingStrategy":"try-catch","validationCode":"ProcessBuilder pb = new ProcessBuilder(gploadPath, \"--version\");\nif (pb.start().waitFor() != 0) {\n  throw new IllegalStateException(\"gpload client not runnable on this host\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  execute();\n} catch (KettleException ke) {\n  logError(\"gpload exited non-zero; check gpload stdout/stderr in step log\", ke);\n  throw ke;\n}","preventionTips":["Test the exact gpload command manually as the Pentaho user before scheduling","Match database meta settings (host, port, db, schema, user) with gpload's target","Monitor gpload stderr capture in step logs for the root data/connection error"],"tags":["pdi","kettle","gpload","process-exit-code","greenplum"],"backgroundTag":"sql-query-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"}