apache/incubator-seata · error · ServiceCallException

MCP GET Call NameSpace Failed.

Error message

MCP GET Call NameSpace Failed.

What it means

getCallNameSpace wraps any RestClientException from the HTTP GET to the naming server into ServiceCallException('MCP GET Call NameSpace Failed.'). Unlike the non-2xx branch, this fires when the request never completes successfully: connection refused, read timeout, I/O error, or unresolvable host — the underlying exception is logged but not attached to the thrown one.

Source

Thrown at console/src/main/java/org/apache/seata/mcp/service/impl/ConsoleRemoteServiceImpl.java:127

        HttpEntity<String> entity = new HttpEntity<>(headers);
        String responseBody;
        try {
            ResponseEntity<String> response = executeRequest(url, HttpMethod.GET, entity);

            responseBody = response.getBody();

            if (!response.getStatusCode().is2xxSuccessful()) {
                String errorMsg = String.format(
                        "MCP GET request failed with status: %s, response: %s",
                        response.getStatusCode(), response.getBody());
                LOGGER.warn(errorMsg);
                throw new ServiceCallException(errorMsg, response.getStatusCode());
            }
            return responseBody;
        } catch (RestClientException e) {
            String errorMsg = "MCP GET Call NameSpace Failed.";
            LOGGER.error(errorMsg, e);
            throw new ServiceCallException(errorMsg);
        }
    }

    @Override
    public String getCallTC(
            NameSpaceDetail nameSpaceDetail,
            String path,
            Object objectQueryParams,
            Map<String, String> queryParams,
            HttpHeaders headers) {
        if (headers == null) {
            headers = new HttpHeaders();
        }
        if (nameSpaceDetail == null || !nameSpaceDetail.isValid()) {
            return "If you have not specified the namespace of the TC/Server, specify the namespace first";
        } else {
            setNamespaceHeaderAndQueryParam(nameSpaceDetail, headers, queryParams);
        }

View on GitHub (pinned to e01f97c6db)

Solutions

  1. Check naming server health on the configured addr (curl http://<addr>/health or the console UI)
  2. Fix naming-server.addr if stale — remember getNamingServerUrl picks randomly among the list, so one bad entry fails intermittently
  3. Increase the REST client read/connect timeout if the naming server is slow but alive
  4. Start/restart the naming server and retry the console operation
Defensive patterns

Strategy: retry

Validate before calling

for (String a : addrs) { if (ping(a)) return; } throw new IllegalStateException("all naming servers unreachable");

Try / catch

try { call(); } catch (ServiceCallException e) { if (e.getCause() == null || !hasStatus(e)) backoffAndRetryOnce(); else throw e; }

Prevention

When it happens

Trigger: Calling getCallNameSpace while the naming server is down/unreachable, the configured addr points to a wrong port, DNS fails, or the request exceeds the RestClient's read/connect timeout.

Common situations: Naming server not started or still booting when the console serves an MCP query; NamingServerProperties.addr pointing at a stale address after infrastructure changes; firewall dropping the connection; overloaded naming server causing read timeouts.

Related errors


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