{"record":{"id":"b308a5d81a3ac465","repo":"pentaho/pentaho-kettle","slug":"request-could-not-be-processed","errorCode":null,"errorMessage":"Request could not be processed","messagePattern":"Request could not be processed","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/rest/core/src/main/java/org/pentaho/di/trans/steps/rest/Rest.java","lineNumber":285,"sourceCode":"   * @throws KettleException in case the request could not be processed\n   */\n  private Response getResponse( Invocation.Builder invocationBuilder, String contentType, String entityString )\n    throws KettleException {\n    Response response;\n    try {\n      switch ( data.method ) {\n        case RestMeta.HTTP_METHOD_GET -> response = invocationBuilder.get( Response.class );\n        case RestMeta.HTTP_METHOD_POST -> response = invocationBuilder.post( getEntity( contentType, entityString ) );\n        case RestMeta.HTTP_METHOD_PUT -> response = invocationBuilder.put( getEntity( contentType, entityString ) );\n        case RestMeta.HTTP_METHOD_DELETE -> response = invocationBuilder.delete();\n        case RestMeta.HTTP_METHOD_HEAD -> response = invocationBuilder.head();\n        case RestMeta.HTTP_METHOD_OPTIONS -> response = invocationBuilder.options();\n        case RestMeta.HTTP_METHOD_PATCH ->\n          response = invocationBuilder.method( RestMeta.HTTP_METHOD_PATCH, getEntity( contentType, entityString ) );\n        default -> throw new KettleException( BaseMessages.getString( PKG, \"Rest.Error.UnknownMethod\", data.method ) );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( \"Request could not be processed\", e );\n    }\n    return response;\n  }\n\n  /**\n   * Get entity for request using the given content type or the default one\n   *\n   * @param contentType  the content type\n   * @param entityString the entity string\n   * @return the request entity built using the given content type or the default media type\n   */\n  private Entity<?> getEntity( String contentType, String entityString ) {\n    Entity<?> entity;\n\n    if ( null != contentType ) {\n      entity = Entity.entity( entityString, contentType );\n    } else {\n      entity = Entity.entity( entityString, data.mediaType );","sourceCodeStart":267,"sourceCodeEnd":303,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/rest/core/src/main/java/org/pentaho/di/trans/steps/rest/Rest.java#L267-L303","documentation":"Rest.getResponse catches any Exception thrown while executing the JAX-RS request (after method dispatch) and rethrows it as a KettleException with the literal message 'Request could not be processed', preserving the cause. It means request execution itself failed — not an HTTP error status from the server, but a client-side processing failure.","triggerScenarios":"Exceptions from invocationBuilder.put/post/delete/head/options/method calls: connection I/O errors, SSL handshake failures, timeouts, invalid entity/body for the content type, or client-state problems.","commonSituations":"Connection reset or timeout to a slow endpoint; SSL certificate not trusted (handshake failure during execution); sending an entity with GET/DELETE where the client rejects it; RESTEasy/Jersey runtime errors.","solutions":["Inspect the cause exception for the real problem (SocketTimeoutException, SSLHandshakeException, ProcessingException, etc.)","Increase the connection/read timeout if the cause is a timeout","Fix the trust store or enable the 'ignore SSL' option for certificate issues","Verify the body/content-type combination is valid for the chosen method","Check network connectivity and proxy configuration on the host running the transformation"],"exampleFix":"// before\nresponse = invocationBuilder.post( getEntity( contentType, entityString ) );\n// after\nEntity<?> entity = getEntity( contentType, entityString );\nif ( entity == null && ( entityString != null && !entityString.isEmpty() ) ) {\n  throw new KettleException( \"Cannot build entity for content type \" + contentType );\n}\nresponse = invocationBuilder.post( entity );","handlingStrategy":"try-catch","validationCode":"// sanity-check inputs before invoking the request\nif ( entityString != null && contentType == null ) {\n  throw new KettleException( \"Body provided without a content type\" );\n}\nif ( data.realUrl == null || data.realUrl.isEmpty() ) {\n  throw new KettleException( \"Request URL is empty\" );\n}","typeGuard":null,"tryCatchPattern":"try {\n  Response r = step.getResponse( target, row, contentType, entity );\n} catch ( KettleException e ) {\n  if ( \"Request could not be processed\".equals( e.getMessage() ) ) {\n    Throwable cause = e.getCause();\n    if ( cause instanceof java.net.SocketTimeoutException ) { /* retry with longer timeout */ }\n    else if ( cause instanceof javax.net.ssl.SSLHandshakeException ) { /* fix trust store / ignore SSL */ }\n    log.error( \"REST request execution failed\", e );\n  }\n}","preventionTips":["Always inspect the wrapped cause — the message is generic by design","Set generous connection/read timeouts in the step configuration","Fix SSL trust store settings or enable 'ignore SSL' for self-signed certs in test environments","Ensure body/content-type combos match the HTTP method semantics"],"tags":["http","kettle","network"],"backgroundTag":"http-request-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"}