0

Can any one suggest the reason for getting NoHttpResponseException?? My application is constantly recieving this exception from a service. Is this a client side issue or server side?

How to debug with these kinds of Issues?

Following is the stacktrace for the same

[Thread-2] INFO (com.amazonaws.http.AmazonHttpClient executeHelper:581) - Unable to execute HTTP request: sqs.ap-southeast-1.amazonaws.com:443 failed to respond org.apache.http.NoHttpResponseException: sqs.ap-southeast-1.amazonaws.com:443 failed to respond at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:143) at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:57) at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:261) at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:283) at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:259) at org.apache.http.impl.conn.ManagedClientConnectionImpl.receiveResponseHeader(ManagedClientConnectionImpl.java:209) at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:272) at com.amazonaws.http.protocol.SdkHttpRequestExecutor.doReceiveResponse(SdkHttpRequestExecutor.java:66) at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:124) at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:686) at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:488) at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:884) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55) at com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:819) at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:574) at com.amazonaws.http.AmazonHttpClient.doExecute(AmazonHttpClient.java:362) at com.amazonaws.http.AmazonHttpClient.executeWithTimer(AmazonHttpClient.java:328) at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:307) at com.amazonaws.services.sqs.AmazonSQSClient.invoke(AmazonSQSClient.java:2419) at com.amazonaws.services.sqs.AmazonSQSClient.deleteMessage(AmazonSQSClient.java:1472) at com.micromax.datasets.queue.SQSPoller.pullJsonFromQueue(SQSPoller.java:142) at com.micromax.datasets.scheduler.MultiQueuePull.run(MultiQueuePull.java:28) at java.lang.Thread.run(Thread.java:745)

Don Jose
  • 1,448
  • 2
  • 13
  • 27

2 Answers2

0

As defined in https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html :

Client Error 4xx

The 4xx class of status code is intended for cases in which the client seems to have erred. Except when responding to a HEAD request, the server SHOULD include an entity containing an explanation of the error situation, and whether it is a temporary or permanent condition. These status codes are applicable to any request method. User agents SHOULD display any included entity to the user.

If the client is sending data, a server implementation using TCP SHOULD be careful to ensure that the client acknowledges receipt of the packet(s) containing the response, before the server closes the input connection. If the client continues sending data to the server after the close, the server's TCP stack will send a reset packet to the client, which may erase the client's unacknowledged input buffers before they can be read and interpreted by the HTTP application. 

Basically, it means that every 4xx are errors from the client side. But the 443 is not defined in the HTTP standard, so you should search in the service's documentation if it's available

T. Garcin
  • 147
  • 5
  • 3
    **443** seen in the logs is not an HTTP status code, but [***port number***](https://www.grc.com/port_443.htm) for HTTPS. – informatik01 Aug 14 '18 at 12:55
0

From the Apache docs:

In some circumstances, usually when under heavy load, the web server may be able to receive requests but unable to process them. A lack of sufficient resources like worker threads is a good example. This may cause the server to drop the connection to the client without giving any response. HttpClient throws NoHttpResponseException when it encounters such a condition.

Most likely, this problem is caused by the service, not the client. You could try to confirm this by contacting the service another way, such as by visiting its url in your browser or using the curl tool in your terminal.

Kalinda Pride
  • 315
  • 5
  • 9