Connection refused: connect

Sometimes, not all times, I have the following error when I use pub.client:http service : Connection refused: connect

Do you know how to fix that ?

wM 9.10.

Best regards

That error can have various reasons from network issues, memory issues, down to out of thread issues or trouble with your firewall.
What have you already checked / ruled out?

If it is a firewall problem, is it appears every time and not sometime ?


I think it’s intermittently network issue. The error actually indicating at the point the TCP connection trying to connect to the server, the server is not ready to accept it and hence refused. There is not way to fix intermittent network issue, as from client to server end, it goes through so many hops and routes before reaching the actual server. This is no way to guarantee 100% stable all the time.

Perhaps in your catch code, you can try to trap the exception and invoke pub.flow:throwExceptionForRetry to force the flow to re-execute again? Referring to page 403, it’s stated:

Usage Notes
Use the pub.flow:throwExceptionForRetry service to handle transient errors that might occur
during service execution. A transient error is an error that arises from a condition that
might be resolved quickly, such as the unavailability of a resource due to network
issues or failure to connect to a database. The service might execute successfully if
the Integration Server waits and then retries the service. If a transient error occurs,
the service can catch this error and invoke pub.flow:throwExceptionForRetry to instruct the
Integration Server to retry the service.

The pub.flow:throwExceptionForRetry service should be used for transient errors only

So maybe you can have the handling in your catch section?

Hi Mike,
Thanks, actually I thought it was a temporary issue due to the network as you guess.
So I put the http flow service in a REPEAT block which re execute on FAILURE. (I repeat two times with 5 seconds between retry)
But I have the feeling that not REPEAT. (I’m not sure because I can’t reproduce the issue).

do you know which URL it’s connecting to when the error happened?
if not, increase the logging level to have related info. captured.
Then you can decide what to do next.

Hi Tom Wang,
Actually, I know which url is attempt to be reached when the exception is thrown, this is an url on Azure Portail to get a OAuth bearer token for a connection to Microsoft Dynamics CRM website. The Azure portail expert said to me that the problem is not on Azure. The problem come from either a proxy or network problem either Integration Server itself. I thought it was an Integration Server problem (resources problem or something else) because of “” in the exception’s description. Obviously, it is Java which detect the exception.

There will be no 100% fault proof handling to this issue, the only issue is to retry the connection again when it happens. Like what you said in between of IS to Dynamics CRM to obtain the token, you’ve proxy server that mediate all the traffic out. There is still chance anything in between that caused the issue.

Unless you can further check on the proxy server log to see if there is any issue during that time, it would be rather difficult to pinpoint where the root cause is. Another thing that you can probably try out is to only see if without going through proxy but a direct connection to Azure, do you still see such exception happening over the time? If no, at least you can narrow down where the issue is.

Hi Mike,
Just to be accurate the problem appears between IS and Azure Portal (to get the token). I had never had an exception between IS and Microsoft Dynamics CRM (when the token is obtained).

I openned a ticket to our IT teams to get logs when error appears but now I have no answer.

I can not make a request without thoughing the proxy. It is not possible in our company.