{"record":{"id":"72a8e9ca2040329e","repo":"alibaba/nacos","slug":"no-available-server","errorCode":null,"errorMessage":"no available server","messagePattern":"no available server","errorType":"exception","errorClass":"ConnectException","httpStatus":null,"severity":"critical","filePath":"client/src/main/java/com/alibaba/nacos/client/config/http/ServerHttpAgent.java","lineNumber":117,"sourceCode":"                    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;\n        HttpClientConfig httpConfig = HttpClientConfig.builder()\n            .setReadTimeOutMillis(Long.valueOf(readTimeoutMs).intValue())\n            .setConTimeOutMillis(\n                ConfigHttpClientManager.getInstance().getConnectTimeoutOrDefault(3000))\n            .build();\n        do {\n            try {\n                Header newHeaders = Header.newInstance();\n                if (headers != null) {","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/client/src/main/java/com/alibaba/nacos/client/config/http/ServerHttpAgent.java#L99-L135","documentation":"Thrown by ServerHttpAgent.httpGet when the do-while retry loop exits because the current time exceeded endTime (now > start + readTimeoutMs) before maxRetry ran out, and no server returned a success response. Unlike the max-retry variant, the budget was still available but the time window elapsed — the client was still attempting servers when the deadline hit.","triggerScenarios":"Each server attempt consumes enough wall-clock (slow connects, read timeouts near the per-request limit) that endTime passes before retries are exhausted; the loop condition (System.currentTimeMillis() <= endTime) becomes false.","commonSituations":"A very short readTimeoutMs combined with slow/unresponsive servers, network latency spikes, or DNS resolution delays consuming the whole window on a single attempt.","solutions":["Increase readTimeoutMs on the config client (e.g. PropertyKeyConst.CONFIG_LONG_POLL_TIMEOUT or the readTimeoutMs param).","Diagnose network latency between client and server (ping, traceroute) and resolve the slow path.","Confirm server load/CPU is not saturating response times.","If using a small timeout intentionally, ensure the server list is small and fast to fail."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"long readTimeoutMs = 10_000; // ensure > expected per-request latency * server count\n// pass readTimeoutMs when constructing the client / calling the API","typeGuard":null,"tryCatchPattern":"try {\n    configService.getConfig(dataId, group, readTimeoutMs);\n} catch (Exception e) {\n    if (e.getMessage().contains(\"no available server\")) {\n        log.error(\"read window expired before any server responded\");\n    }\n    throw e;\n}","preventionTips":["Size readTimeoutMs larger than (per-server timeout * server count).","Resolve network latency between client and cluster.","Avoid pointing the client at dead/slow nodes in the list."],"tags":["network","config","http-get","client","timeout"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}