{"record":{"id":"466dfe7d1628c65f","repo":"XINCGer/Unity3DTraining","slug":"inputtype-is-not-a-message-type","errorCode":null,"errorMessage":"\"InputType\" is not a message type.","messagePattern":"\"InputType\" 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":91,"sourceCode":"        {\n            this.proto = proto;\n            service = parent;\n            file.DescriptorPool.AddSymbol(this);\n        }\n\n        internal MethodDescriptorProto Proto { get { return proto; } }\n\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":73,"sourceCodeEnd":103,"githubUrl":"https://github.com/XINCGer/Unity3DTraining/blob/016f98412ea5e11756b286736f479b66ab6216d5/NetWorkAndResources/Socket_Protobuff/Assets/Plugins/Google.Protobuf/Reflection/MethodDescriptor.cs#L73-L103","documentation":"During MethodDescriptor.CrossLink, the method's declared input_type is resolved through the file's DescriptorPool. If the resolved symbol exists but is not a MessageDescriptor (e.g. an enum or package), CrossLink throws DescriptorValidationException. The .proto file is structurally inconsistent for RPC use.","triggerScenarios":"A Service method in the .proto declares an input_type that resolves to a symbol that is not a message: wrongfully naming an enum type, a typo resolving to a different symbol, or a hand-built FileDescriptorSet where input_type points at a non-message entry.","commonSituations":"Generating descriptors with protoc from a .proto where an rpc input type name collides with an enum name, or building descriptor sets programmatically (e.g. for gRPC) with incorrect type names.","solutions":["Fix the .proto: ensure the rpc input_type names an actual message type (fully qualified if nested).","Run protoc (or protogen) to regenerate the descriptor set instead of hand-editing descriptor bytes.","Rename the colliding enum/symbol so the input type name resolves to the message."],"exampleFix":"// before (.proto)\nrpc GetThing (MyEnum) returns (Thing);\n// after (.proto)\nrpc GetThing (GetThingRequest) returns (Thing);","handlingStrategy":"validation","validationCode":"var sym = file.DescriptorPool.LookupSymbol(method.Proto.InputType, method);\nif (!(sym is MessageDescriptor)) throw new Exception($\"rpc input_type '{method.Proto.InputType}' 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":["Always generate descriptor sets with protoc, never hand-edit them.","Use fully qualified type names for nested messages in rpc signatures."],"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"}