TCP/IP errors

The software returns the SQL30081N message (-30081) when a TCP/IP specific communications error is detected. The TCP/IP error that is encountered by the communication subsystem is returned in the list of error tokens for the SQL30081N message.

TCP/IP

The following table lists the common TCP/IP error symbols (errnos) on Linux®, UNIX and Windows operating systems. The complete list of the TCP/IP errors for UNIX operating systems can be found in the /usr/include/sys/errno.h file. For Linux operating systems, the complete list of the TCP/IP errors are found in the /usr/include/asm/errno.h file. For Windows operating systems, see Windows Sockets Error Codes.

Table 1. TCP/IP error numbers
Error code AIX® error number Linux error number Windows error number Description
EINTR 4 4   The function specified was interrupted by a signal.
EBADF 9 9   Bad socket. The socket might have been corrupted.
EAGAIN 11 11   Resource temporarily unavailable.
EFAULT 14 14   Bad address.

On connect, bad address.

On receive, the data was directed to be received into a nonexistent or protected part of the process address space. The buffer is not valid.

EBUSY 16 16   Resource busy.
EINVAL 22 22   Invalid argument that is passed to the specified function or the socket is closed. The EINVAL error can be returned if there was a memory overwrite, or buffer overflow problem.
ENFILE 23 23   Too many open files in the system.
EMFILE 24 24   The per-process file descriptor table is full. Number of file descriptors/sockets for the process is exceeded.
ENOSPC 28 28   No space is left on a device or system table.
EPIPE 32 32   Broken pipe.
EWOULDBLOCK 54 11   On the connect function, the range that is allocated for TCP/UDP ephemeral ports is exhausted. (Some operating systems return the same error as EAGAIN.)
ENOTSOCK 57 88   Socket operation on a non-socket.
ENOPROTOOPT 61 92   Option is unknown.
EADDRINUSE 67 98 10048 The specified address is already in use. Perhaps the previous process that established the connection was terminated abnormally or was not cleaned up properly.
EADDRNOTAVAIL 68 99   The specified host name or IP address is not available from the local system.
ENETDOWN 69 100   The network is down.
ENETUNREACH 70 101   No route to the network or host is available.
ENETRESET 71 102   The network dropped the connection on reset.
ECONNRESET 73 104 10054 Connection was reset by the partner.
ENOBUFS 74 105 10055 Insufficient memory or resources were available in the system to complete the call.
EISCONN 75 106   The socket is already connected.
ENOTCONN 76 107   The socket is not connected.
ETIMEDOUT 78 110 10060 The connection was timed out.
ECONNREFUSED 79 111 10061 The connection was refused. If you are trying to connect to the database, check that the database manager and TCP/IP protocol support at the server were started successfully.

If you specified the SOCKS protocol support, you must also ensure that the TCP/IP protocol support at the SOCKS server was started successfully.

EHOSTDOWN 80 112   The host is down.
EHOSTUNREACH 81 113   No route to the host is available.
SOCECONNABORTED 72   10053

Software closed connection

If error is reported on client application that uses ODBC/CLI to connect to DB2 UDB server, disable the Db2 CLI timeout:
  1. Add
    QUERYTIMEOUTINTERVAL=0
    to the db2cli.ini file on the client's side.
  2. Check if applications have any timeout. For example, ADO timeout, VB timeout
  3. Check the value of the idlethreadtimeout parameter (IDTHTOIN), if the application connects to an OS390 server.
    Note: The idlethreadtimeout parameter sets the active thread timeout limit on OS390 servers.
WSAEINTR     10004 Connection closed by client. For Db2 z systems, see the tech note SQL30081n
WSAEHOSTUNREACH 81 113 10065 No route to host

For Windows clients trying to connect to a Linux server, unset the firewall on the Linux server to allow connections to go through from clients.

Note: The complete list of the TCP/IP errors in Windows operating system can be found in the winsock2.h file. The winsock2.h file is not installed on your system if you do not have a development environment installed.