{"record":{"id":"b03b3c7f62ce1f55","repo":"pentaho/pentaho-kettle","slug":"http-status-d-s-s","errorCode":null,"errorMessage":"HTTP Status %d - %s - %s","messagePattern":"HTTP Status (.+?) - (.+?) - (.+?)","errorType":"http","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/cluster/SlaveServer.java","lineNumber":938,"sourceCode":"\n      // The status code\n      if ( log.isDebug() ) {\n        log.logDebug(\n          BaseMessages.getString( PKG, \"SlaveServer.DEBUG_ResponseStatus\", Integer.toString( statusCode ) ) );\n      }\n\n      String responseBody = getResponseBodyAsString( httpResponse.getEntity().getContent() );\n\n      if ( log.isDetailed() ) {\n        log.logDetailed( BaseMessages.getString( PKG, \"SlaveServer.DETAILED_FinishedReading\", Integer\n          .toString( responseBody.getBytes().length ) ) );\n      }\n      if ( log.isDebug() ) {\n        log.logDebug( BaseMessages.getString( PKG, \"SlaveServer.DEBUG_ResponseBody\", responseBody ) );\n      }\n\n      if ( statusCode >= 400 ) {\n        throw new KettleException( String.format( \"HTTP Status %d - %s - %s\", statusCode, method.getURI().toString(),\n          statusLine.getReasonPhrase() ) );\n      }\n\n      return responseBody;\n    } finally {\n      // Release current connection to the connection pool once you are done\n      method.releaseConnection();\n      if ( log.isDetailed() ) {\n        log.logDetailed( BaseMessages.getString( PKG, \"SlaveServer.DETAILED_ExecutedService\", service, hostname ) );\n      }\n    }\n  }\n\n  // Method is defined as package-protected in order to be accessible by unit tests\n  HttpClient getHttpClient() {\n    SlaveConnectionManager connectionManager = SlaveConnectionManager.getInstance();\n    return connectionManager.createHttpClient();\n  }","sourceCodeStart":920,"sourceCodeEnd":956,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/cluster/SlaveServer.java#L920-L956","documentation":"Thrown in SlaveServer's HTTP execution path when the response status code is >= 400. Formatted as \"HTTP Status <code> - <uri> - <reason phrase>\". It reports that the slave server rejected the request and includes the exact URI so the caller can identify which service call failed.","triggerScenarios":"Any executeHttp/execute method call to a slave server where the returned status code is 400 or greater — bad request, missing servlet, auth failure, or internal slave error.","commonSituations":"Carte endpoint URL misconfigured (wrong port/path); slave servlet missing after upgrade; credentials invalid (401/403); slave threw an exception (500) processing the request.","solutions":["Verify the URI in the error points to the correct slave service and port","Check the slave server is up: hit the URI manually (curl/browser) and inspect the response","Review slave-side logs for the exception that produced the 4xx/5xx status","Fix authentication settings on the slave server definition if status is 401/403"],"exampleFix":"// before: blind call\nString xml = slaveServer.executeService(\"/kettle/status/\", \"GET\", null, null);\n// after: pre-flight reachability check\nif (slaveServer == null || !slaveServer.ping()) { throw new KettleException(\"Slave not reachable\"); }\nString xml = slaveServer.executeService(\"/kettle/status/\", \"GET\", null, null);","handlingStrategy":"try-catch","validationCode":"int code = statusCode; // from execute path\nif (code >= 400) { throw new KettleException(\"Slave will reject request (last status \" + code + \")\"); }","typeGuard":"boolean isOk(int statusCode) { return statusCode >= 200 && statusCode < 400; }","tryCatchPattern":"try { body = slaveServer.executeHttp(...); }\ncatch (KettleException e) { if (e.getMessage().startsWith(\"HTTP Status 4\")) { fixClientRequest(); }\n  else if (e.getMessage().startsWith(\"HTTP Status 5\")) { checkSlaveLogsAndRetry(); } throw e; }","preventionTips":["Validate the slave endpoint URI (scheme, host, port, context path)","Check slave credentials when 401/403 occurs","Inspect slave logs for 500s","Run curl against the same URI to reproduce and debug"],"tags":["http","network","slave-server","rest"],"backgroundTag":"http-error-response","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"}