ECONNRESET error over an IBM MQ MQI client channel connection
You are receiving message AMQ9208 or AMQ9209 intermittently from TCP/IP on an IBM® MQ MQI client channel connection to a local server, which is an ECONNRESET error.
An ECONNRESET TCP/IP error is caused by a connection reset by peer. This occurs when an established connection is shut down for some reason by the remote computer.
Symptom
The most common scenario shows the error:
- AMQ9208I:
- Error on receive from host <hostname>.
- Explanation
- An error occurred receiving data from <hostname> over TCP/IP. This might be due to a communications failure.
- Action
- The return code from the TCP/IP recv() call was <
xxxxx>. Record these values and tell the systems administrator.
You might receive a different message, for example:
- AMQ9209I
- Connection to host <hostname> for channel <channelname> closed.
The following table shows the return codes for different operating systems for the error
ECONNRESET Connection Reset by Peer:
| Operating system | Decimal | Hexadecimal |
|---|---|---|
| AIX® | 73 | x49 |
| IBM i | 3426 | xD62 |
| Linux® | 104 | x68 |
| Windows | 10054 | x2746 |
| z/OS® | 1121 | x461 |
Diagnosing the problem
An ECONNRESET error usually indicates a problem in the TCP/IP network.
There are numerous reasons TCP/IP sends a reset:
- A connection termination that is not orderly, such as a rebooting the client box, can cause a reset.
- An application request a connect to a port and IP address for which no server is listening.
- An application closes a socket with data still in the application receive buffer. The connection is reset to allow the remote partner to know that the data was not delivered.
- Any data that arrives for a connection that has been closed can cause a reset.
- An application closes a socket and sets the linger socket option to zero. This notifies TCP/IP
that the connection should not linger.Note: IBM MQ does not code the linger socket option, therefore IBM MQ does not cause a reset.
- A TCP segment that is not valid arrives for a connection, for example, a bad acknowledge or sequence number can cause a reset.
- The connect request times out. TCP gives up trying to connect to an particular port and IP address and resets the connection.
- A firewall can reset connections if the packet does not adhere to the firewall rules and policies. For example, a source or destination port, or IP address does not match the firewall rule or policy.
- The retransmit timer expires. TCP gives up trying to retransmit a packet and resets the connection.
- A bad hardware device can cause resets
Diagnostic hints and tips:
For z/OS, see :
Consult with your network administrator, who can use TCP/IP packet and a sniffer traces to determine why the reset occurred.
For z/OS, see :- Instructions for setting a SLIP on an IBM MQ error message and including TCP/IP CTRACE and TCP/IP PACKET trace
- z/OS UNIX reason codes for the last two bytes of the reason code found in the CSQX208E error message.
Resolving the problem
These types of errors are not generated by IBM MQ.
IBM MQis simply informing you that the network is having
a problem.
Important: This problem is beyond the scope of IBM MQ Support and there is nothing that can be done from the
IBM MQ perspective to resolve this network problem. You
need to work with your network support team.
See Automatic client reconnection for more information, which could be useful for your development team to use in IBM MQ MQI client applications.