{"record":{"id":"3ef12fdc8002fe65","repo":"XINCGer/Unity3DTraining","slug":"outputtype-is-not-a-message-type","errorCode":null,"errorMessage":"\"OutputType\" is not a message type.","messagePattern":"\"OutputType\" is not a message type\\.","errorType":"validation","errorClass":"DescriptorValidationException","httpStatus":null,"severity":"error","filePath":"NetWorkAndResources/Socket_Protobuff/Assets/Plugins/Google.Protobuf/Reflection/MethodDescriptor.cs","lineNumber":98,"sourceCode":"\n        /// <summary>\n        /// The brief name of the descriptor's target.\n        /// </summary>\n        public override string Name { get { return proto.Name; } }\n\n        internal void CrossLink()\n        {\n            IDescriptor lookup = File.DescriptorPool.LookupSymbol(Proto.InputType, this);\n            if (!(lookup is MessageDescriptor))\n            {\n                throw new DescriptorValidationException(this, \"\\\"\" + Proto.InputType + \"\\\" is not a message type.\");\n            }\n            inputType = (MessageDescriptor) lookup;\n\n            lookup = File.DescriptorPool.LookupSymbol(Proto.OutputType, this);\n            if (!(lookup is MessageDescriptor))\n            {\n                throw new DescriptorValidationException(this, \"\\\"\" + Proto.OutputType + \"\\\" is not a message type.\");\n            }\n            outputType = (MessageDescriptor) lookup;\n        }\n    }\n}","sourceCodeStart":80,"sourceCodeEnd":103,"githubUrl":"https://github.com/XINCGer/Unity3DTraining/blob/016f98412ea5e11756b286736f479b66ab6216d5/NetWorkAndResources/Socket_Protobuff/Assets/Plugins/Google.Protobuf/Reflection/MethodDescriptor.cs#L80-L103","documentation":"The output_type counterpart of the CrossLink check: after resolving Proto.OutputType via the DescriptorPool, the result must be a MessageDescriptor; otherwise MethodDescriptor.CrossLink throws DescriptorValidationException. Same cause as the input-type check but for the method's return type.","triggerScenarios":"A Service method's output_type resolves to a non-message symbol (enum, typo'd name resolving to another kind, or a programmatically built descriptor set with a wrong output_type).","commonSituations":"Typing an enum as the rpc return type in a .proto, or descriptor sets generated/edited by tooling that mis-resolves the response type name.","solutions":["Fix the .proto output_type to name a real message type (use fully qualified names for nested messages).","Regenerate the descriptor set with protoc after fixing the .proto.","Check for symbol name collisions between the return type name and an enum/package name."],"exampleFix":"// before (.proto)\nrpc GetThing (GetThingRequest) returns (Status);\n// after (.proto)\nrpc GetThing (GetThingRequest) returns (GetThingResponse);","handlingStrategy":"validation","validationCode":"var sym = file.DescriptorPool.LookupSymbol(method.Proto.OutputType, method);\nif (!(sym is MessageDescriptor)) throw new Exception($\"rpc output_type '{method.Proto.OutputType}' must be a message\");","typeGuard":"bool IsMessageType(IDescriptor d) => d is MessageDescriptor;","tryCatchPattern":"try { BuildFileDescriptor(set); } catch (DescriptorValidationException ex) { log.Error($\"Invalid service descriptor: {ex.Message}\"); throw; }","preventionTips":["Lint .proto files so every rpc output_type names a real message type.","Rename colliding enums/packages that shadow rpc return type names."],"tags":["protobuf","descriptor-validation","grpc"],"backgroundTag":"schema-validation-failed","analyzedSha":"016f98412ea5e11756b286736f479b66ab6216d5","analyzedAt":"2026-09-12T01:08:58.711Z","contentChangedAt":"2026-09-12T01:08:58.711Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}