{"record":{"id":"bf4d394041cfa37c","repo":"alibaba/nacos","slug":"nacos-http-get-the-maximum-number-of-tolerable-s","errorCode":null,"errorMessage":"[NACOS HTTP-GET] The maximum number of tolerable server reconnection errors has been reached","messagePattern":"\\[NACOS HTTP-GET\\] The maximum number of tolerable server reconnection errors has been reached","errorType":"exception","errorClass":"ConnectException","httpStatus":null,"severity":"critical","filePath":"client/src/main/java/com/alibaba/nacos/client/config/http/ServerHttpAgent.java","lineNumber":108,"sourceCode":"                    serverListMgr.getCurrentServer(), connectException.getMessage());\n            } catch (SocketTimeoutException socketTimeoutException) {\n                LOGGER.error(\n                    \"[NACOS SocketTimeoutException httpGet] currentServerAddr:{}， err : {}\",\n                    serverListMgr.getCurrentServer(), socketTimeoutException.getMessage());\n            } catch (Exception ex) {\n                LOGGER.error(\n                    \"[NACOS Exception httpGet] currentServerAddr: \"\n                        + serverListMgr.getCurrentServer(),\n                    ex);\n                throw ex;\n            }\n            \n            if (serverListMgr.getIterator().hasNext()) {\n                currentServerAddr = serverListMgr.getIterator().next();\n            } else {\n                maxRetry--;\n                if (maxRetry < 0) {\n                    throw new ConnectException(\n                        \"[NACOS HTTP-GET] The maximum number of tolerable server reconnection errors has been reached\");\n                }\n                serverListMgr.refreshCurrentServerAddr();\n            }\n            \n        } while (System.currentTimeMillis() <= endTime);\n        \n        LOGGER.error(\"no available server\");\n        throw new ConnectException(\"no available server\");\n    }\n    \n    @Override\n    public HttpRestResult<String> httpPost(String path, Map<String, String> headers,\n        Map<String, String> paramValues,\n        String encode, long readTimeoutMs) throws Exception {\n        final long endTime = System.currentTimeMillis() + readTimeoutMs;\n        String currentServerAddr = serverListMgr.getCurrentServer();\n        int maxRetry = this.maxRetry;","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/client/src/main/java/com/alibaba/nacos/client/config/http/ServerHttpAgent.java#L90-L126","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"import java.net.*;\nboolean reachable = false;\ntry (Socket s = new Socket()) {\n    s.connect(new InetSocketAddress(host, port), 1000);\n    reachable = true;\n} catch (IOException ignored) {}","typeGuard":null,"tryCatchPattern":"try {\n    configService.getConfig(dataId, group, 5000);\n} catch (Exception e) {\n    if (e.getMessage().contains(\"maximum number of tolerable\")) {\n        // all servers failed — surface to ops, do not silently retry in a loop\n        throw new IllegalStateException(\"Nacos cluster unreachable\", e);\n    }\n    throw e;\n}","preventionTips":["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."],"tags":["network","config","http-get","client","retry-exhausted"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}