alibaba/nacos · critical · ConnectException
[NACOS HTTP-GET] The maximum number of tolerable server reco
Error message
[NACOS HTTP-GET] The maximum number of tolerable server reconnection errors has been reached
What it means
Thrown by ServerHttpAgent.httpGet when every server in the list has been tried and the retry budget (maxRetry) is exhausted while the read-timeout window is still open. Each time the server iterator wraps with no next server, maxRetry decrements; once it drops below zero the client gives up rather than looping forever. It means the cluster was reachable enough to enumerate but every GET attempt returned a failure code (5xx/404) or threw a connection/timeout exception.
Source
Thrown at client/src/main/java/com/alibaba/nacos/client/config/http/ServerHttpAgent.java:108
serverListMgr.getCurrentServer(), connectException.getMessage());
} catch (SocketTimeoutException socketTimeoutException) {
LOGGER.error(
"[NACOS SocketTimeoutException httpGet] currentServerAddr:{}, err : {}",
serverListMgr.getCurrentServer(), socketTimeoutException.getMessage());
} catch (Exception ex) {
LOGGER.error(
"[NACOS Exception httpGet] currentServerAddr: "
+ serverListMgr.getCurrentServer(),
ex);
throw ex;
}
if (serverListMgr.getIterator().hasNext()) {
currentServerAddr = serverListMgr.getIterator().next();
} else {
maxRetry--;
if (maxRetry < 0) {
throw new ConnectException(
"[NACOS HTTP-GET] The maximum number of tolerable server reconnection errors has been reached");
}
serverListMgr.refreshCurrentServerAddr();
}
} while (System.currentTimeMillis() <= endTime);
LOGGER.error("no available server");
throw new ConnectException("no available server");
}
@Override
public HttpRestResult<String> httpPost(String path, Map<String, String> headers,
Map<String, String> paramValues,
String encode, long readTimeoutMs) throws Exception {
final long endTime = System.currentTimeMillis() + readTimeoutMs;
String currentServerAddr = serverListMgr.getCurrentServer();
int maxRetry = this.maxRetry;View on GitHub (pinned to 9b989acdf1)
Solutions
- Check Nacos server health (curl the /v1/console/server/state or status endpoint) and restart unhealthy nodes.
- Verify serverAddr is correct (host:port) and reachable from the client host (telnet/netcat the port).
- Increase the read timeout / maxRetry via client config if the failure is transient and you want more resilience.
- Inspect client logs for the per-server ConnectException/SocketTimeoutException messages that preceded this terminal error.
Defensive patterns
Strategy: retry
Validate before calling
import java.net.*;
boolean reachable = false;
try (Socket s = new Socket()) {
s.connect(new InetSocketAddress(host, port), 1000);
reachable = true;
} catch (IOException ignored) {} Try / catch
try {
configService.getConfig(dataId, group, 5000);
} catch (Exception e) {
if (e.getMessage().contains("maximum number of tolerable")) {
// all servers failed — surface to ops, do not silently retry in a loop
throw new IllegalStateException("Nacos cluster unreachable", e);
}
throw e;
} Prevention
- Monitor Nacos server health and alert on 5xx rates.
- Keep the server list fresh and accurate in serverListMgr.
- Distinguish retry-exhausted (642) from timeout (643) via the message.
When it happens
Trigger: All Nacos server nodes return HTTP 500/502/503/404 (isFail true) on a config GET, or each throws ConnectException/SocketTimeoutException, with no remaining retry budget before endTime.
Common situations: Nacos server cluster is down or unhealthy behind a load balancer returning 502/503, firewall blocking the config port, wrong serverAddr scheme/port, or a transient full-cluster outage during a config read.
Related errors
- no available server
- [NACOS HTTP-POST] The maximum number of tolerable server rec
- [NACOS HTTP-DELETE] The maximum number of tolerable server r
- no available server, currentServerAddr : {currentServerAddr}
- request timeout after {timeout} milliseconds, requestId={req
AI-assisted analysis of alibaba/nacos@9b989acdf1 (2026-08-14).
Data as JSON: /api/errors/bf4d394041cfa37c.
Report an issue: GitHub.