{"record":{"id":"3988174d209f6a70","repo":"alibaba/nacos","slug":"20004-398817","errorCode":"20004","errorMessage":"Client id %s not exist.","messagePattern":"Client id (.+?) not exist\\.","errorType":"validation","errorClass":"NacosApiException","httpStatus":404,"severity":"error","filePath":"naming/src/main/java/com/alibaba/nacos/naming/core/ClientServiceImpl.java","lineNumber":82,"sourceCode":"    @Resource\n    private ConnectionManager connectionManager;\n    \n    @Resource\n    private ClientServiceIndexesManager clientServiceIndexesManager;\n    \n    @Resource\n    private DistroMapper distroMapper;\n    \n    @Override\n    public List<String> getClientList() {\n        return new ArrayList<>(clientManager.allClientId());\n    }\n    \n    @Override\n    public ClientSummaryInfo getClientDetail(String clientId) throws NacosApiException {\n        Client client = clientManager.getClient(clientId);\n        if (null == client) {\n            throw new NacosApiException(NacosException.NOT_FOUND, ErrorCode.RESOURCE_NOT_FOUND,\n                String.format(\"Client id %s not exist.\", clientId));\n        }\n        ClientSummaryInfo result = new ClientSummaryInfo();\n        result.setClientId(client.getClientId());\n        result.setEphemeral(client.isEphemeral());\n        result.setLastUpdatedTime(client.getLastUpdatedTime());\n        result.setClientType(\"ipPort\");\n        if (client instanceof ConnectionBasedClient) {\n            // upper 2.x client\n            result.setClientType(\"connection\");\n            Connection connection = connectionManager.getConnection(clientId);\n            ConnectionMeta connectionMetaInfo = connection.getMetaInfo();\n            result.setConnectType(connectionMetaInfo.getConnectType());\n            result.setAppName(connectionMetaInfo.getAppName());\n            result.setVersion(connectionMetaInfo.getVersion());\n            result.setClientIp(connectionMetaInfo.getClientIp());\n            result.setClientPort(connectionMetaInfo.getRemotePort());\n        }","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/naming/src/main/java/com/alibaba/nacos/naming/core/ClientServiceImpl.java#L64-L100","documentation":"Thrown by ClientServiceImpl.getClientDetail when clientManager.getClient(clientId) returns null. Error code NOT_FOUND=404 with ErrorCode.RESOURCE_NOT_FOUND=20004. The client (gRPC connection-based or IP-port-based) is not currently registered on this server node.","triggerScenarios":"Calling the client-service getClientDetail(clientId) admin operation with a clientId that does not map to an active Client in the ClientManager. This happens when the connection has closed or the client never connected to this node.","commonSituations":"Client disconnected (connection timeout, client shutdown, network drop). Querying a client connected to a different server node. Stale clientId from a previous session. Client heartbeat expired and the client was evicted.","solutions":["Verify the clientId is active by listing all clients (getClientList) first.","Route the query to the Nacos server node that owns the client (check the /distro responsible-server endpoint).","Confirm the client application is running and its gRPC connection to Nacos is active.","Re-establish the client connection if it was unintentionally dropped."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"List<String> clientIds = clientService.getClientList();\nif (!clientIds.contains(clientId)) {\n    // client may be on another node or disconnected\n    log.warn(\"clientId {} not found on this node\", clientId);\n}","typeGuard":null,"tryCatchPattern":"try {\n    ClientSummaryInfo info = clientService.getClientDetail(clientId);\n} catch (NacosApiException e) {\n    if (ErrorCode.RESOURCE_NOT_FOUND.getCode() == e.getErrCode()\n            || e.getErrCode() == NacosException.NOT_FOUND) {\n        // client gone; refresh the client list or route to owning node\n    } else { throw e; }\n}","preventionTips":["Confirm the clientId is active by listing clients before detail queries.","Check the responsible server via /distro if the client is not on the current node.","Treat clientId queries as time-sensitive since connections can drop at any moment."],"tags":["naming","client-management","not-found","admin-api","connection"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}