{"action":"created","issue":{"url":"https://api.github.com/repos/grpc/grpc/issues/1551","labels_url":"https://api.github.com/repos/grpc/grpc/issues/1551/labels{/name}","comments_url":"https://api.github.com/repos/grpc/grpc/issues/1551/comments","events_url":"https://api.github.com/repos/grpc/grpc/issues/1551/events","html_url":"https://github.com/grpc/grpc/issues/1551","id":75374916,"number":1551,"title":"Node RPC server cannot recover from malformed requests","user":{"login":"vgatto","id":32080,"avatar_url":"https://avatars.githubusercontent.com/u/32080?v=3","gravatar_id":"","url":"https://api.github.com/users/vgatto","html_url":"https://github.com/vgatto","followers_url":"https://api.github.com/users/vgatto/followers","following_url":"https://api.github.com/users/vgatto/following{/other_user}","gists_url":"https://api.github.com/users/vgatto/gists{/gist_id}","starred_url":"https://api.github.com/users/vgatto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vgatto/subscriptions","organizations_url":"https://api.github.com/users/vgatto/orgs","repos_url":"https://api.github.com/users/vgatto/repos","events_url":"https://api.github.com/users/vgatto/events{/privacy}","received_events_url":"https://api.github.com/users/vgatto/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/grpc/grpc/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/grpc/grpc/labels/node","name":"node","color":"bfe5bf"},{"url":"https://api.github.com/repos/grpc/grpc/labels/wrapped%20languages","name":"wrapped languages","color":"103dff"}],"state":"open","locked":false,"assignee":{"login":"murgatroid99","id":961599,"avatar_url":"https://avatars.githubusercontent.com/u/961599?v=3","gravatar_id":"","url":"https://api.github.com/users/murgatroid99","html_url":"https://github.com/murgatroid99","followers_url":"https://api.github.com/users/murgatroid99/followers","following_url":"https://api.github.com/users/murgatroid99/following{/other_user}","gists_url":"https://api.github.com/users/murgatroid99/gists{/gist_id}","starred_url":"https://api.github.com/users/murgatroid99/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/murgatroid99/subscriptions","organizations_url":"https://api.github.com/users/murgatroid99/orgs","repos_url":"https://api.github.com/users/murgatroid99/repos","events_url":"https://api.github.com/users/murgatroid99/events{/privacy}","received_events_url":"https://api.github.com/users/murgatroid99/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-05-11T22:09:34Z","updated_at":"2015-05-15T11:35:24Z","closed_at":null,"body":"In testing my Swift client against a node server, I started by sending an empty request (i.e. no serialized proto, NOT just an empty well-formed serialized message) to verify that it hit the server. As expected, the server was unable to deserialize the empty request and failed with an exception thrown from within bytebuffer. This renders the server unresponsive to any further requests.\r\n\r\nThe stack trace looks like:\r\n```\r\n/Users/vgatto/dev/springful/springful/backend/node_modules/protobufjs/node_modules/bytebuffer/dist/ByteBufferNB.js:322\r\n            throw TypeError(\"Illegal buffer\");\r\n                  ^\r\nTypeError: Illegal buffer\r\n    at TypeError (native)\r\n    at Function.module.exports.ByteBuffer.wrap (/Users/vgatto/dev/springful/springful/backend/node_modules/protobufjs/node_modules/bytebuffer/dist/ByteBufferNB.js:322:19)\r\n    at Function.Message.decode (/Users/vgatto/dev/springful/springful/backend/node_modules/protobufjs/dist/ProtoBuf.js:2223:85)\r\n    at Object.deserialize (/Users/vgatto/dev/springful/springful/backend/node_modules/grpc/src/common.js:53:16)\r\n    at /Users/vgatto/dev/springful/springful/backend/node_modules/grpc/src/server.js:357:31\r\n```\r\n\r\nWrapping the call to `handler.deserialize` in `server.js` and making the appropriate call to `handleError` fixes this, but I'm not certain if this is the best place for such error handling.\r\n"},"comment":{"url":"https://api.github.com/repos/grpc/grpc/issues/comments/102374814","html_url":"https://github.com/grpc/grpc/issues/1551#issuecomment-102374814","issue_url":"https://api.github.com/repos/grpc/grpc/issues/1551","id":102374814,"user":{"login":"mustafamamun","id":8222890,"avatar_url":"https://avatars.githubusercontent.com/u/8222890?v=3","gravatar_id":"","url":"https://api.github.com/users/mustafamamun","html_url":"https://github.com/mustafamamun","followers_url":"https://api.github.com/users/mustafamamun/followers","following_url":"https://api.github.com/users/mustafamamun/following{/other_user}","gists_url":"https://api.github.com/users/mustafamamun/gists{/gist_id}","starred_url":"https://api.github.com/users/mustafamamun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mustafamamun/subscriptions","organizations_url":"https://api.github.com/users/mustafamamun/orgs","repos_url":"https://api.github.com/users/mustafamamun/repos","events_url":"https://api.github.com/users/mustafamamun/events{/privacy}","received_events_url":"https://api.github.com/users/mustafamamun/received_events","type":"User","site_admin":false},"created_at":"2015-05-15T11:35:23Z","updated_at":"2015-05-15T11:35:23Z","body":"Hi, I am having the same problem even though I am pushing protobuf encoded data to kafka. I am having this problem when I am trying to read it from other side. can u guide me  some suggestion. "}}