Informix Error -57
-57 Socket is not connected.
An operating-system error code with the meaning shown was unexpectedly returned to the database server. If the error recurs, note all circumstances and contact IBM Informix Technical Support.
Oninit® Troubleshooting Guidance
This is an operating-system error number, not an Informix diagnosis.
The same errno is returned by many different operations, so on its own it says what the operating system refused, not what Informix was trying to do. Informix will usually have reported a more specific error alongside it — in the message log, in the SQL or ISAM error pair, or in the accompanying assert failure — and that error normally defines the real cause far more precisely than the errno does. Find it before diagnosing from this number alone.
This matters less than it used to. Later versions of the engine trap many of these conditions and report them as specific Informix errors naming the operation, the object and the context, so a bare errno in this range is increasingly a sign of an older version, an unusual code path, or a failure early in startup before the better reporting is available. If you are seeing one on a current version, the more specific error is worth looking for even harder.
Important platform note. Error codes in this range represent operating-system
errnovalues whose meanings vary between Unix platforms and versions. Confirm the nativeerrnodefinition on the server where the Informix error occurred before diagnosing the problem from the number alone.
Determine the Native Error Meaning
| Value | Symbol | |
|---|---|---|
| Catalogue text — Socket is not connected | 57 | ENOTCONN on BSD |
| The same condition on Linux | 107 | ENOTCONN — Transport endpoint is not connected |
| Errno 57 on Linux | 57 | EBADSLT — Invalid slot, STREAMS-era |
The BSD socket block runs from -42 to -61 and each member sits 50 higher on Linux.
python3 -c 'import os; print(57, os.strerror(57)); print(107, os.strerror(107))'
What ENOTCONN Actually Tells You
An operation that requires a connection was performed on a socket that does not have one. send(), recv(), getpeername() and shutdown() all report it.
In most cases this is a consequence rather than a cause, and that is the single most useful thing to know about it. The connection did not fail here — it failed earlier, and this is the next operation discovering the socket is no longer usable.
The sequence in a log usually runs:
1. ECONNRESET the peer aborted <- the real event (-54)
2. ENOTCONN the next read or write <- this error (-57)
3. ENOTCONN everything after that
So a -57 is often the second error, and the first one is the one worth finding. Code that reports every failure identically produces a log full of -57 with the causal ECONNRESET or ETIMEDOUT buried at the top.
The exception is the genuinely unconnected case: an operation performed on a socket that was created but never successfully connected. That is a defect in the calling code, and it pairs with -56 — where the same code, having failed to check whether its connect succeeded, gets told the socket is connected.
What This Means in Informix
Where a -57 reaches the database server, it is nearly always downstream of a connection that has already gone:
- A session whose client disappeared. The reset or timeout is the event; subsequent operations on that socket report this.
- A connection pool handing out a socket that was already torn down, because the pool tracks its own state rather than the socket's.
- A replication link after the partner was lost — the same pattern, with HDR, RSS or ER in place of a client.
- Client code sending without confirming the connect completed, which is the mirror of the -56 defect and produced by the same missing check.
- A retry loop reusing a socket that should have been closed and reopened.
The practical consequence: count the distinct errors before counting the occurrences. Two hundred -57s and one -54 is a single event, not two hundred.
Common Causes
- A connection already lost — reset, timeout or orderly close — with this reported by the next operation.
- A connection pool reusing a socket whose peer has gone.
- Code that sends without checking whether its connect succeeded — see -56.
- A retry loop reusing a socket rather than reopening one.
shutdown()orgetpeername()on a socket that was never connected.
Diagnostic Checks
Confirm the symbol, since errno 57 on Linux is a STREAMS value and unrelated:
python3 -c 'import os; print(57, os.strerror(57)); print(107, os.strerror(107))'
Look earlier in the log, not at this error. This is the step that matters, and it is the one most often skipped:
tail -500 "$INFORMIXDIR/tmp/online.log"
grep -n -iE 'reset|timed out|refused|closed|disconnect|errno' "$INFORMIXDIR/tmp/online.log" | tail -40
Count distinct errors rather than total occurrences:
grep -oiE 'system error = [0-9]+' "$INFORMIXDIR/tmp/online.log" | sort | uniq -c | sort -rn
A large count against this code and a small one against -54 or -60 tells you which is the event and which is the echo.
Check the session and connection state:
onstat -g ses
onstat -g ntu
ss -antp | grep -w <port> | awk '{print $1}' | sort | uniq -c
Trace, where the unconnected-socket case is suspected:
strace -f -e trace=connect,send,sendto,recv,recvfrom,getpeername,shutdown -p <pid> 2>&1 | grep -iE 'ENOTCONN|EISCONN|EINPROGRESS'
A send() returning ENOTCONN with no preceding successful connect() is the defect rather than a lost connection.
# Solaris / AIX
truss -f -t connect,send,recv -p <pid>
For replication, establish whether the partner went first:
onstat -g dri
onstat -g rss 2>/dev/null
Solutions / Resolution
- Find the first error, not this one. A -57 is usually the echo. The reset, timeout or refusal that preceded it is the event to investigate, and everything on -54, -60 or -32 may apply instead.
- Do not tune anything on the strength of a -57 count. The count measures how many operations were attempted after the connection went, which is a property of the retry logic rather than of the network.
- Fix pools that track their own state. A pool that hands out a socket without checking it is still connected turns one lost connection into a stream of failures. Validating on checkout, or closing on any error, removes the pattern.
- Close and reopen rather than retrying on the same socket. Once a connection is gone the socket cannot be recovered; a retry loop that reuses it will produce this indefinitely.
- Where it is the unconnected case, fix the connect check — see -56. The same missing
SO_ERRORcheck produces both errors depending on timing. - For replication, check the partner before the network. An HDR or ER link reporting this after the partner failed is describing the consequence.
Example
Two hundred errors, one event
$ grep -oiE 'system error = [0-9]+' "$INFORMIXDIR/tmp/online.log" | sort | uniq -c | sort -rn
213 system error = 107
1 system error = 104
One ECONNRESET and 213 subsequent operations on the dead socket. The single event is at the top of the log; everything after it is the application continuing to use a connection that no longer exists.
Investigating the 213 leads nowhere. The one is -54, and the retry loop that produced the rest is a second, separate defect worth fixing on its own.
Platform Note
| Platform | This condition | Errno 57 there means |
|---|---|---|
| Linux | errno 107 | EBADSLT — STREAMS-era, unrelated |
| Solaris, AIX, HP-UX | confirm on the host | confirm on the host |
| BSD, Darwin | errno 57 | this condition |
Linux words it Transport endpoint is not connected, so searching for the catalogue's phrasing on a Linux host will not match.
| Task | Linux | Solaris | AIX |
|---|---|---|---|
| Socket states | ss -antp |
netstat -an, pfiles |
netstat -Aan |
| Trace | strace -f |
truss -f |
truss -f |
Related Errors / Related Topics
- -56 — Socket is already connected. The mirror image, and the other half of the same missing-check defect in connect handling.
- -54 — Connection reset by peer. The most common cause of the connection having gone in the first place, and usually the error to investigate instead of this one.
- -32 — Broken pipe. The other error a write to a dead connection produces; which of the two you get depends on the operation and the platform.
Where -57 appears in volume, look above it in the log. The useful error is the first one, and this code is generally the sound of an application that has not noticed yet.