alibaba/nacos · critical · ConnectException

no available server, currentServerAddr

Error message

no available server, currentServerAddr : {currentServerAddr}

What it means

Thrown by ServerHttpAgent.httpPost when the time window (readTimeoutMs) expires before a successful POST and before retry exhaustion. The loop condition currentTimeMillis() <= endTime became false while still iterating servers. The message includes currentServerAddr to show which node was last attempted.

Solutions

  1. Increase the POST readTimeoutMs for config write calls.
  2. Investigate server-side latency (GC logs, disk I/O, thread dumps) on currentServerAddr.
  3. Reduce network hops/latency between client and the cluster.
  4. If the address is stale/wrong, ensure serverListMgr has the correct, current server list.
Defensive patterns

Strategy: retry

Validate before calling

// set a generous write timeout
long writeTimeoutMs = Math.max(readTimeoutMs, 10_000);

Try / catch

try {
    configService.publishConfig(dataId, group, content);
} catch (Exception e) {
    if (e.getMessage().startsWith("no available server, currentServerAddr")) {
        log.error("write timed out against {}", e.getMessage());
    }
}

Prevention

When it happens

Trigger: POST attempts each take long enough (slow TLS handshakes, read timeouts) that the cumulative wall-clock exceeds endTime; the deadline elapses mid-retry.

Common situations: Short write timeout, high-latency network, or a server that accepts connections but responds very slowly (e.g. GC stall, disk contention on the server).

Related errors


AI-assisted analysis of alibaba/nacos@9b989acdf1 (2026-08-14). Data as JSON: /api/errors/f963793b1306f17b. Report an issue: GitHub.

Appendix: source

Thrown at client/src/main/java/com/alibaba/nacos/client/config/http/ServerHttpAgent.java:179

                    ex);
                throw ex;
            }
            
            if (serverListMgr.getIterator().hasNext()) {
                currentServerAddr = serverListMgr.getIterator().next();
            } else {
                maxRetry--;
                if (maxRetry < 0) {
                    throw new ConnectException(
                        "[NACOS HTTP-POST] The maximum number of tolerable server reconnection errors has been reached");
                }
                serverListMgr.refreshCurrentServerAddr();
            }
            
        } while (System.currentTimeMillis() <= endTime);
        
        LOGGER.error("no available server, currentServerAddr : {}", currentServerAddr);
        throw new ConnectException("no available server, currentServerAddr : " + currentServerAddr);
    }
    
    @Override
    public HttpRestResult<String> httpDelete(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;
        HttpClientConfig httpConfig = HttpClientConfig.builder()
            .setReadTimeOutMillis(Long.valueOf(readTimeoutMs).intValue())
            .setConTimeOutMillis(
                ConfigHttpClientManager.getInstance().getConnectTimeoutOrDefault(100))
            .build();
        do {
            try {
                Header newHeaders = Header.newInstance();
                if (headers != null) {

View on GitHub (pinned to 9b989acdf1)