{"record":{"id":"487d6340a345ef86","repo":"egametang/ET","slug":"rpc-error-actorid-actorid-request-response","errorCode":null,"errorMessage":"Rpc error: actorId: {actorId} {request}, response: {response}","messagePattern":"Rpc error: actorId: (.+?) (.+?), response: (.+?)","errorType":"exception","errorClass":"RpcException","httpStatus":null,"severity":"error","filePath":"Packages/cn.etetet.netinner/Scripts/Hotfix/Server/MessageSenderSystem.cs","lineNumber":72,"sourceCode":"            {\n                // 发给NetInner纤程\n                A2NetInner_Request a2NetInner_Request = A2NetInner_Request.Create();\n                a2NetInner_Request.ActorId = actorId;\n                a2NetInner_Request.MessageObject = request;\n\n                FiberInstanceId netInnerFiberInstanceId = self.GetSingleton<ProcessFiberAddressSingleton>().Get(SceneType.NetInner);\n                using A2NetInner_Response a2NetInnerResponse = await self.ProcessInnerSender.Call(\n                    netInnerFiberInstanceId, a2NetInner_Request, timeout) as A2NetInner_Response;\n                response = a2NetInnerResponse.MessageObject;\n            }\n\n            if (response.Error == ErrorCode.ERR_MessageTimeout)\n            {\n                throw new RpcException(response.Error, $\"Rpc error: request, 注意Actor消息超时，请注意查看是否死锁或者没有reply: actorId: {actorId} {request}, response: {response}\");\n            }\n            if (needException && ErrorCode.IsRpcNeedThrowException(response.Error))\n            {\n                throw new RpcException(response.Error, $\"Rpc error: actorId: {actorId} {request}, response: {response}\");\n            }\n            return response;\n        }\n    }\n}\n","sourceCodeStart":54,"sourceCodeEnd":78,"githubUrl":"https://github.com/egametang/ET/blob/5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f/Packages/cn.etetet.netinner/Scripts/Hotfix/Server/MessageSenderSystem.cs#L54-L78","documentation":"A generic RPC failure: the response carried a non-zero error code that ErrorCode.IsRpcNeedThrowException considers fatal, and needException was true (the default). Unlike the timeout case (241) this covers all other serious RPC error codes — the response came back but reported an error the framework treats as unrecoverable. The message includes the actorId, request, and response for diagnosis.","triggerScenarios":"The remote handler explicitly set a non-zero error on the response (e.g. entity not found, permission denied, internal error); the inner transport returned a transport-level error code; the target fiber threw an exception that was serialized into the response error code.","commonSituations":"Calling a scene/fiber whose handler logic returns an error for the given input (invalid id, missing config); version mismatch where the request/response contract changed; the caller passed needException=true (default) for a call that is expected to fail occasionally and should have used needException=false.","solutions":["Inspect response.Error in the exception message to identify the specific error code, then look up its meaning in ErrorCode.","If the failure is an expected/optional outcome, pass needException: false and check response.Error yourself.","Fix the remote handler that is producing the error code (check its logs for the original exception).","Verify request/response message definitions match between caller and handler assemblies (no stale generated code)."],"exampleFix":"// before — default throws on any serious error\nvar resp = await MessageSender.Instance.Call(actorId, request);\n\n// after — tolerate expected errors for optional lookups\nvar resp = await MessageSender.Instance.Call(actorId, request, needException: false);\nif (resp.Error != ErrorCode.ERR_OK)\n{\n    // handle gracefully\n    return default;\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"var resp = await sender.Call(actorId, request, needException: false);\nif (resp.Error != ErrorCode.ERR_OK) { /* handle expected failure */ }","preventionTips":["Pass needException: false for calls where failure is an expected outcome.","Always inspect response.Error and map known codes to user-facing behavior.","Keep request/response message definitions in sync across assemblies."],"tags":["et-framework","actor-rpc","error-handling","network"],"backgroundTag":null,"analyzedSha":"5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f","analyzedAt":"2026-08-13T21:10:40.377Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}