We could observe that
Client to Gateway request consists of the "Content-Length: 125
And Gateway to Backend Content-Length header has not sent.
instead "Transfer-Encoding: chunked has sent
Backend to Gateway has responded with Content-Length: 0 with no content-type
This has resulted in a NullPointerException in the gateway and has responded to client with a HTTP 500 error.
Description:
API synapse xml Response caching enabled and chunking disabled as follows.
Wirelog:
TID: [-1] [] [2019-05-29 16:49:29,356] DEBUG {org.apache.synapse.transport.http.wire} - HTTP-Sender I/O dispatcher-2 >> "HTTP/1.1 200 [\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2019-05-29 16:49:29,356] DEBUG {org.apache.synapse.transport.http.wire} - HTTP-Sender I/O dispatcher-2 >> "Server: nginx/1.13.12[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2019-05-29 16:49:29,356] DEBUG {org.apache.synapse.transport.http.wire} - HTTP-Sender I/O dispatcher-2 >> "Date: Wed, 29 May 2019 14:49:29 GMT[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2019-05-29 16:49:29,356] DEBUG {org.apache.synapse.transport.http.wire} - HTTP-Sender I/O dispatcher-2 >> "Content-Length: 0[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2019-05-29 16:49:29,356] DEBUG {org.apache.synapse.transport.http.wire} - HTTP-Sender I/O dispatcher-2 >> "Connection: keep-alive[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2019-05-29 16:49:29,357] DEBUG {org.apache.synapse.transport.http.wire} - HTTP-Sender I/O dispatcher-2 >> "cpaas-transaction-id: test777108[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2019-05-29 16:49:29,357] DEBUG {org.apache.synapse.transport.http.wire} - HTTP-Sender I/O dispatcher-2 >> "[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2019-05-29 16:49:29,357] DEBUG {org.apache.synapse.transport.http.headers} - http-outgoing-10473 << HTTP/1.1 200 {org.apache.synapse.transport.http.headers} TID: [-1] [] [2019-05-29 16:49:29,357] DEBUG {org.apache.synapse.transport.http.headers} - http-outgoing-10473 << Server: nginx/1.13.12 {org.apache.synapse.transport.http.headers} TID: [-1] [] [2019-05-29 16:49:29,357] DEBUG {org.apache.synapse.transport.http.headers} - http-outgoing-10473 << Date: Wed, 29 May 2019 14:49:29 GMT {org.apache.synapse.transport.http.headers} TID: [-1] [] [2019-05-29 16:49:29,357] DEBUG {org.apache.synapse.transport.http.headers} - http-outgoing-10473 << Content-Length: 0 {org.apache.synapse.transport.http.headers} TID: [-1] [] [2019-05-29 16:49:29,357] DEBUG {org.apache.synapse.transport.http.headers} - http-outgoing-10473 << Connection: keep-alive {org.apache.synapse.transport.http.headers} TID: [-1] [] [2019-05-29 16:49:29,357] DEBUG {org.apache.synapse.transport.http.headers} - http-outgoing-10473 << cpaas-transaction-id: test777108 {org.apache.synapse.transport.http.headers} TID: [1535030458] [] [2019-05-29 16:49:29,358] @cpaas.dcpp [1535030458] [AM]ERROR {org.apache.synapse.mediators.base.SequenceMediator} - Runtime error occurred while mediating the message {org.apache.synapse.mediators.base.SequenceMediator} java.lang.NullPointerException TID: [1535030458] [] [2019-05-29 16:49:29,358] @cpaas.dcpp [1535030458] [AM]ERROR {API_LOGGER.admindcpp-AT-cpaas.dcpp--DeviceCommand} - Runtime error occurred while mediating the message {API_LOGGER.admindcpp-AT-cpaas.dcpp--DeviceCommand} java.lang.NullPointerException TID: [1535030458] [] [2019-05-29 16:49:29,359] @cpaas.dcpp [1535030458] [AM] INFO {org.apache.synapse.mediators.builtin.LogMediator} - STATUS = Executing default 'fault' sequence, ERROR_CODE = 0, ERROR_MESSAGE = Runtime error occurred while mediating the message {org.apache.synapse.mediators.builtin.LogMediator}
We could observe that Client to Gateway request consists of the "Content-Length: 125 And Gateway to Backend Content-Length header has not sent. instead "Transfer-Encoding: chunked has sent
Backend to Gateway has responded with Content-Length: 0 with no content-type This has resulted in a NullPointerException in the gateway and has responded to client with a HTTP 500 error.