{"action":"opened","issue":{"url":"https://api.github.com/repos/zendesk/ruby-kafka/issues/696","repository_url":"https://api.github.com/repos/zendesk/ruby-kafka","labels_url":"https://api.github.com/repos/zendesk/ruby-kafka/issues/696/labels{/name}","comments_url":"https://api.github.com/repos/zendesk/ruby-kafka/issues/696/comments","events_url":"https://api.github.com/repos/zendesk/ruby-kafka/issues/696/events","html_url":"https://github.com/zendesk/ruby-kafka/issues/696","id":387834647,"node_id":"MDU6SXNzdWUzODc4MzQ2NDc=","number":696,"title":"Invalid magic byte: 2 when updating kafka client protocol to 0.11","user":{"login":"Kwisatx","id":1901676,"node_id":"MDQ6VXNlcjE5MDE2NzY=","avatar_url":"https://avatars1.githubusercontent.com/u/1901676?v=4","gravatar_id":"","url":"https://api.github.com/users/Kwisatx","html_url":"https://github.com/Kwisatx","followers_url":"https://api.github.com/users/Kwisatx/followers","following_url":"https://api.github.com/users/Kwisatx/following{/other_user}","gists_url":"https://api.github.com/users/Kwisatx/gists{/gist_id}","starred_url":"https://api.github.com/users/Kwisatx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kwisatx/subscriptions","organizations_url":"https://api.github.com/users/Kwisatx/orgs","repos_url":"https://api.github.com/users/Kwisatx/repos","events_url":"https://api.github.com/users/Kwisatx/events{/privacy}","received_events_url":"https://api.github.com/users/Kwisatx/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-05T16:19:39Z","updated_at":"2018-12-05T16:19:39Z","closed_at":null,"author_association":"NONE","body":"* Version of Ruby: 2.5.1\r\n* Version of Kafka: 1.0.2\r\n* Version of ruby-kafka: 0.7.4\r\n\r\nWe updated to ruby-kafka 0.7.4 recently to allow us to upgrade the kafka client protocol to 0.11 (we had been running in 0.10 for a while).\r\n\r\nWhen we updated the client protocol, however, we encountered crashes on one of our partitions with: `Kafka::Error: Invalid magic byte: 2` [magic_byte_crash.txt](https://github.com/zendesk/ruby-kafka/files/2648317/magic_byte_crash.txt)\r\n\r\nAfter adding some debug logs, we were able to determine that we had a magic byte equal to 1 in the message set at [fetch_response.rb](https://github.com/zendesk/ruby-kafka/blob/master/lib/kafka/protocol/fetch_response.rb#L96), but that we were getting a magic byte equal to 2 in one of the messages of the message set at [message.rb](https://github.com/zendesk/ruby-kafka/blob/master/lib/kafka/protocol/message.rb#L77) (in our case the fifth message of the set).\r\n\r\nWhat's particularly strange is that according to [the protocol](https://cwiki.apache.org/confluence/display/KAFKA/A+Guide+To+The+Kafka+Protocol#AGuideToTheKafkaProtocol-Messagesets) records don't even have the magic byte like messages in the previous versions, but I suppose we might have ended up reading a byte by chance that decoded to 2.\r\n\r\nWe had to drop the kafka packet to keep treating data, and have not encountered the problem since.\r\n\r\nHas anyone encountered something similar? Do you think this is just an issue that occurred while switching protocols that we hopefully won't see again?\r\n\r\nThanks!\r\nJeremy\r\n"}}
{"actor":{"display_login":"Kwisatx"}}