ResourceAccessException: I/O error on POST request for .. read timed out ERROR

Viewed 5707

When I call the rest end point (Rest Template http client) "myservice..com/rest/api/" i get the below error sometime .What can be the cause of this error? And is this client or server error?

org.springframework.web.client.ResourceAccessException: I/O error on POST request for "myservice..com/rest/api/": read timed out;
  exception is java.net.SocketTimeoutException: read timed out 
1 Answers

Well, the exception is declarative in nature. That exception signals that a timeout has occurred on a socket read or accept, as per Java API describes. In shorter words, there is a network connectivity issue that has nothing to do with your code.

A couple of questions that you may want to figure out first:

  • Is the service myservice..com/rest/api/ up? Is it visible from you computer/host?
  • Can you hit it an status endpoint to check if it is alive?
  • Can you make a different HTTP request to the API GET, DELETE?
  • What happens if you query the endpoint with cURL or Postman?
Related