{"record":{"id":"39767b009a4f3898","repo":"alibaba/nacos","slug":"error-39767b","errorCode":"{}","errorMessage":"{}","messagePattern":"\\{\\}","errorType":"exception","errorClass":"NacosException","httpStatus":null,"severity":"error","filePath":"common/src/main/java/com/alibaba/nacos/common/remote/client/grpc/GrpcConnection.java","lineNumber":104,"sourceCode":"    \n    @Override\n    public RequestFuture requestFuture(Request request) throws NacosException {\n        Payload grpcRequest = GrpcUtils.convert(request);\n        \n        final ListenableFuture<Payload> requestFuture = grpcFutureServiceStub.request(grpcRequest);\n        return new RequestFuture() {\n            \n            @Override\n            public boolean isDone() {\n                return requestFuture.isDone();\n            }\n            \n            @Override\n            public Response get() throws Exception {\n                Payload grpcResponse = requestFuture.get();\n                Response response = (Response) GrpcUtils.parse(grpcResponse);\n                if (response instanceof ErrorResponse) {\n                    throw new NacosException(response.getErrorCode(), response.getMessage());\n                }\n                return response;\n            }\n            \n            @Override\n            public Response get(long timeout) throws Exception {\n                Payload grpcResponse = requestFuture.get(timeout, TimeUnit.MILLISECONDS);\n                Response response = (Response) GrpcUtils.parse(grpcResponse);\n                if (response instanceof ErrorResponse) {\n                    throw new NacosException(response.getErrorCode(), response.getMessage());\n                }\n                return response;\n            }\n        };\n    }\n    \n    public void sendResponse(Response response) {\n        Payload convert = GrpcUtils.convert(response);","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/common/src/main/java/com/alibaba/nacos/common/remote/client/grpc/GrpcConnection.java#L86-L122","documentation":"Thrown by GrpcConnection.RequestFuture.get() when the gRPC server returns an ErrorResponse payload instead of a normal Response. The error code and message are taken verbatim from the server-side response (response.getErrorCode(), response.getMessage()), so the '{}' placeholders are filled at runtime. This is the synchronous (non-timed) path of a client-side gRPC request: the call completed on the wire, but the server deliberately reported a logical failure.","triggerScenarios":"Calling connection.request(req).get() (the no-arg blocking get) on a GrpcConnection where the server responds with a payload whose deserialized type extends ErrorResponse. This happens for any server-rejected request: unsupported server capability, invalid parameters caught server-side, resource-not-found, over-capacity, or auth denial surfaced as an ErrorResponse.","commonSituations":"Client/server Nacos version mismatch where the server no longer understands a request type; sending a request to a namespace or resource the caller lacks permission for; server-side validation rejecting malformed request fields; server overloaded returning a pushed-back ErrorResponse.","solutions":["Inspect NacosException.getErrCode() and getMessage() in the catch block — the real cause is server-supplied, not the placeholder '{}' literal.","Verify client and server run compatible Nacos versions (same major, ideally same minor); a version skew is the most common source of unexpected ErrorResponse values.","Check server logs for the matching request handling error to identify whether it is auth, validation, or capacity.","If the request targets a specific namespace/group/dataId, confirm the resource exists and the credentials used have the required permission."],"exampleFix":"// before\nRequestFuture future = connection.request(request);\nResponse resp = future.get(); // raw, uncaught NacosException\n\n// after\nRequestFuture future = connection.request(request);\ntry {\n    Response resp = future.get();\n} catch (NacosException e) {\n    log.warn(\"gRPC request failed errCode={} msg={}\", e.getErrCode(), e.getErrorMsg());\n    // route to caller as a typed domain error\n    throw e;\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"RequestFuture future = connection.request(request);\ntry {\n    Response resp = future.get();\n} catch (NacosException e) {\n    // errCode + message come from the server ErrorResponse\n    log.warn(\"request rejected by server: code={}, msg={}\", e.getErrCode(), e.getErrorMsg());\n    throw e;\n}","preventionTips":["Always wrap RequestFuture.get() in a try-catch for NacosException; the server-side code is the actionable signal.","Keep client and server Nacos versions aligned to avoid unexpected ErrorResponse types.","Log both errCode and message — the placeholder '{}' in source is filled at runtime."],"tags":["grpc","client","remote","error-response","server-side"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}