{"record":{"id":"b9f0d7405a02b81c","repo":"alibaba/nacos","slug":"nacos-http-post-the-maximum-number-of-tolerable","errorCode":null,"errorMessage":"[NACOS HTTP-POST] The maximum number of tolerable server reconnection errors has been reached","messagePattern":"\\[NACOS HTTP-POST\\] 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":170,"sourceCode":"                LOGGER.error(\"[NACOS ConnectException httpPost] currentServerAddr: {}, err : {}\",\n                    currentServerAddr,\n                    connectException.getMessage());\n            } catch (SocketTimeoutException socketTimeoutException) {\n                LOGGER.error(\n                    \"[NACOS SocketTimeoutException httpPost] currentServerAddr: {}， err : {}\",\n                    currentServerAddr, socketTimeoutException.getMessage());\n            } catch (Exception ex) {\n                LOGGER.error(\"[NACOS Exception httpPost] currentServerAddr: \" + currentServerAddr,\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-POST] 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, currentServerAddr : {}\", currentServerAddr);\n        throw new ConnectException(\"no available server, currentServerAddr : \" + currentServerAddr);\n    }\n    \n    @Override\n    public HttpRestResult<String> httpDelete(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":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/client/src/main/java/com/alibaba/nacos/client/config/http/ServerHttpAgent.java#L152-L188","documentation":"Thrown by ServerHttpAgent.httpPost when the retry budget is exhausted (maxRetry < 0) during a POST (config publish/remove). Identical control flow to the GET variant: each failing server decrements maxRetry once the iterator wraps, and once below zero the client stops. POSTs are typically config writes, so this surfaces during publish/delete operations against an unavailable cluster.","triggerScenarios":"Calling configService.publishConfig or removeConfig while every server returns a failure HTTP code or throws on the POST attempt, exhausting maxRetry before endTime.","commonSituations":"Cluster-wide outage during a config write, all nodes behind a gateway returning 502/503, or network partition blocking the POST path specifically.","solutions":["Verify all Nacos server nodes are up and the config endpoint accepts POSTs.","Check for a reverse proxy/load balancer in front returning 5xx and bypass or fix it.","Review client logs for the preceding per-server errors to identify the root transport failure.","Raise maxRetry / readTimeout for write operations that need higher resilience."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// before write, confirm at least one server is healthy\nboolean anyHealthy = serverAddrs.stream().anyMatch(a -> ping(a));\nif (!anyHealthy) throw new IllegalStateException(\"no healthy server for write\");","typeGuard":null,"tryCatchPattern":"try {\n    configService.publishConfig(dataId, group, content);\n} catch (Exception e) {\n    if (e.getMessage().contains(\"HTTP-POST\")) {\n        // write failed across all servers — queue/retry with backoff, alert ops\n        scheduleRetryWithBackoff();\n    }\n}","preventionTips":["Health-check the cluster before issuing config writes.","Use backoff for write retries, not tight loops.","Audit the preceding per-server errors in client logs."],"tags":["network","config","http-post","client","retry-exhausted"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}