{"record":{"id":"6ab4873de2bb1634","repo":"alibaba/nacos","slug":"500","errorCode":"500","errorMessage":"Naming ServiceStorage returned no Runtime Endpoint data","messagePattern":"Naming ServiceStorage returned no Runtime Endpoint data","errorType":"error_code","errorClass":"NacosRuntimeException","httpStatus":500,"severity":"critical","filePath":"ai/src/main/java/com/alibaba/nacos/ai/service/agent/runtime/AgentRuntimeRegistryService.java","lineNumber":281,"sourceCode":"            if (current == null) {\n                current = copyEndpoint(endpoint);\n                current.setHealthy(contribution.getHealthy());\n                current.setBindings(matchingBindings);\n                result.put(key, current);\n            } else {\n                current.setHealthy(current.getHealthy() || contribution.getHealthy());\n                current.setBindings(mergeBindings(current.getBindings(), matchingBindings));\n            }\n        }\n        validateCapacity(payloads.size());\n        return new ArrayList<AgentDiscoveryEndpoint>(result.values());\n    }\n    \n    private ServiceInfo getServiceInfo(String namespaceId, String agentName, String protocol) {\n        ServiceInfo result =\n            serviceStorage.getData(composeService(namespaceId, agentName, protocol));\n        if (result == null) {\n            throw new NacosRuntimeException(NacosException.SERVER_ERROR,\n                \"Naming ServiceStorage returned no Runtime Endpoint data\");\n        }\n        return result;\n    }\n    \n    private RuntimeEndpointSnapshotItem mapInstance(Instance instance, long lastUpdatedTime) {\n        try {\n            return AgentRuntimeEndpointMapper.fromInstance(instance, lastUpdatedTime);\n        } catch (IllegalArgumentException e) {\n            throw new NacosRuntimeException(NacosException.SERVER_ERROR,\n                \"Invalid Agent Runtime Endpoint in Naming ServiceStorage\", e);\n        }\n    }\n    \n    private List<RuntimeVersionBinding> matchingBindings(\n        List<RuntimeVersionBinding> bindings, String version) {\n        List<RuntimeVersionBinding> result = new ArrayList<RuntimeVersionBinding>();\n        for (RuntimeVersionBinding binding : bindings) {","sourceCodeStart":263,"sourceCodeEnd":299,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/ai/src/main/java/com/alibaba/nacos/ai/service/agent/runtime/AgentRuntimeRegistryService.java#L263-L299","documentation":"The Naming ServiceStorage returned null for the Agent endpoint service, meaning no indexed data exists for the requested namespace/agentName/protocol combination. The AgentRuntimeRegistryService.getServiceInfo method (line 280) throws this NacosRuntimeException (HTTP 500) because it cannot build a Runtime Endpoint snapshot or EndpointSet from absent Naming state. This is typically a server-side issue indicating the service has never been registered or the index has not converged.","triggerScenarios":"Calling getRuntimeEndpointSnapshot or getRuntimeEndpointSet for a namespace/agentName/protocol tuple that has no registered instances, or before AP Distro convergence has propagated the service info to this server.","commonSituations":"Querying discovery before any registration has occurred; querying immediately after registration before Distro converges; querying on a fresh server node that hasn't received the service data; namespace mismatch between registration and discovery.","solutions":["Verify that at least one Agent endpoint has been registered for the exact namespace, agentName, and protocol.","If using a cluster, wait a few seconds for Distro AP convergence and retry.","Ensure the querying server is part of the same cluster and has received the service data.","Consider returning an empty result instead of an error if 'no endpoints' is a valid state for your use case — discuss with maintainers if the contract should change."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Before calling discovery, verify the service exists\nServiceInfo info = serviceStorage.getData(service);\nif (info == null) {\n    return Collections.emptyList(); // or throw a domain-specific 'not registered' exception\n}","typeGuard":"public static boolean isServiceAvailable(ServiceStorage storage, Service service) {\n    return storage.getData(service) != null;\n}","tryCatchPattern":"try {\n    return registry.getRuntimeEndpointSet(ns, name, proto, version);\n} catch (NacosRuntimeException e) {\n    if (e.getErrCode() == NacosException.SERVER_ERROR\n        && e.getMessage().contains(\"no Runtime Endpoint data\")) {\n        // return empty or retry after Distro convergence\n        return EndpointSet.empty();\n    }\n    throw e;\n}","preventionTips":["Verify the agent is registered before querying discovery.","In a cluster, allow time for Distro AP convergence after registration before querying.","Handle this server error gracefully by returning an empty endpoint set or prompting the user to register."],"tags":["ai-agent","runtime-discovery","naming","server-error","distro"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}