apache/incubator-seata · error · IllegalStateException

No naming servers addr configured

Error message

No naming servers addr configured

What it means

NamingServerProperties.getNamingServerUrl() throws IllegalStateException when the configured naming-server address list is null or empty. The console's remote service uses this URL to reach the seata naming server for TC/namespace lookups; with no address there is no endpoint to call, so it fails fast on first remote call.

Source

Thrown at console/src/main/java/org/apache/seata/mcp/core/props/NamingServerProperties.java:39

import java.util.Collections;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;

@ConfigurationProperties(prefix = "console.namingserver")
@Component
public class NamingServerProperties {

    /**
     * http, https
     */
    private String protocol = "http";

    private List<String> addr = Collections.singletonList("127.0.0.1:8081");

    public String getNamingServerUrl() {
        if (addr == null || addr.isEmpty()) {
            throw new IllegalStateException("No naming servers addr configured");
        }
        int index = ThreadLocalRandom.current().nextInt(addr.size());
        return protocol + "://" + addr.get(index);
    }

    public void setAddr(List<String> addr) {
        this.addr = addr;
    }

    public void setProtocol(String protocol) {
        this.protocol = protocol;
    }
}

View on GitHub (pinned to e01f97c6db)

Solutions

  1. Set at least one address: `seata.mcp.naming-server.addr: 127.0.0.1:8081` (or your naming-server host:port)
  2. Remove the addr key entirely to fall back to the 127.0.0.1:8081 default if that is acceptable
  3. If deploying without a naming server, avoid code paths that call getCallNameSpace/getCallTC remote lookups
  4. Ensure the value parses as a list — a blank string may bind to an empty list rather than null

Example fix

# before
seata:
  mcp:
    naming-server:
      addr:   # binds empty -> throws on use

# after
seata:
  mcp:
    naming-server:
      addr: 10.0.0.5:8081,10.0.0.6:8081
Defensive patterns

Strategy: validation

Validate before calling

if (addr == null || addr.isEmpty()) throw new IllegalStateException("naming-server addr must list at least one host:port");

Type guard

boolean hasNamingServerAddr(List<String> addr) { return addr != null && !addr.isEmpty(); }

Try / catch

try { url = props.getNamingServerUrl(); } catch (IllegalStateException e) { url = "http://127.0.0.1:8081"; log.warn("no naming addr, using default", e); }

Prevention

When it happens

Trigger: Setting seata.console or MCP naming-server properties with an explicitly empty list (`naming-server.addr: []` / `=` with no value) — the default is 127.0.0.1:8081, so this only fires when the property is set to empty or the setter is called with an empty/null list programmatically.

Common situations: Template-based deployments that render an empty addr placeholder; YAML `addr:` key with a blank value binding to an empty list; disabling the naming server by clearing its address instead of removing the property.

Related errors


AI-assisted analysis of apache/incubator-seata@e01f97c6db (2026-08-14). Data as JSON: /api/errors/954c116d1ae99946. Report an issue: GitHub.