{"action":"created","issue":{"url":"https://api.github.com/repos/Parsely/pykafka/issues/196","labels_url":"https://api.github.com/repos/Parsely/pykafka/issues/196/labels{/name}","comments_url":"https://api.github.com/repos/Parsely/pykafka/issues/196/comments","events_url":"https://api.github.com/repos/Parsely/pykafka/issues/196/events","html_url":"https://github.com/Parsely/pykafka/issues/196","id":91776531,"number":196,"title":"SocketDisconectedError while trying to start balancedconsumer","user":{"login":"ziky90","id":1810839,"avatar_url":"https://avatars.githubusercontent.com/u/1810839?v=3","gravatar_id":"","url":"https://api.github.com/users/ziky90","html_url":"https://github.com/ziky90","followers_url":"https://api.github.com/users/ziky90/followers","following_url":"https://api.github.com/users/ziky90/following{/other_user}","gists_url":"https://api.github.com/users/ziky90/gists{/gist_id}","starred_url":"https://api.github.com/users/ziky90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ziky90/subscriptions","organizations_url":"https://api.github.com/users/ziky90/orgs","repos_url":"https://api.github.com/users/ziky90/repos","events_url":"https://api.github.com/users/ziky90/events{/privacy}","received_events_url":"https://api.github.com/users/ziky90/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-06-29T11:18:01Z","updated_at":"2015-06-29T15:50:51Z","closed_at":"2015-06-29T15:46:23Z","body":"I keep getting SocketDisconectedError when I am trying to use balancedconsumer. I am able to work with this particular kafka from terminal via scripts, but I am not able to connect it using pykafka. \r\n\r\nMy KafkaHandler code looks as follows:\r\n```\r\nclass KafkaHandler(threading.Thread):\r\n    daemon = True\r\n\r\n    def __init__(self, kafka_path, zookeeper, group=DEF_GROUP, consumer_topic=DEF_TOPIC):\r\n        self.kafka = KafkaClient(hosts=kafka_path)\r\n        topic = self.kafka.topics[consumer_topic]\r\n        self.consumer = topic.get_balanced_consumer(\r\n            consumer_group=group,\r\n            auto_commit_enable=True,\r\n            zookeeper_connect=zookeeper\r\n        )\r\n        self.producer = topic.get_producer()\r\n        super(KafkaHandler, self).__init__()\r\n\r\n   def run(self):\r\n        self.process_kafka_messages()\r\n```\r\n\r\nI would like to ask if I'm missing something or if there might be some problem in kafka configuration or inside of pykafka.\r\n\r\nI went through stacktrace:\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py\", line 507, in spawn_worker\r\n    worker.init_process()\r\n  File \"/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py\", line 118, in init_process\r\n    self.wsgi = self.app.wsgi()\r\n  File \"/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py\", line 67, in wsgi\r\n    self.callable = self.load()\r\n  File \"/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py\", line 65, in load\r\n    return self.load_wsgiapp()\r\n  File \"/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py\", line 52, in load_wsgiapp\r\n    return util.import_app(self.app_uri)\r\n  File \"/usr/local/lib/python2.7/dist-packages/gunicorn/util.py\", line 355, in import_app\r\n    __import__(module)\r\n  File \"/home/ubuntu/web_scraper/http_server/server.py\", line 78, in <module>\r\n    handler = kafka_pipe.KafkaHandler(config.kafka, config.zookeeper, group=config.kafka_group, consumer_topic=config.topic)\r\n  File \"/home/ubuntu/web_scraper/kafka_pipes/kafka_pipe.py\", line 41, in __init__\r\n    zookeeper_connect=zookeeper\r\n  File \"/usr/local/lib/python2.7/dist-packages/pykafka/topic.py\", line 156, in get_balanced_consumer\r\n    return BalancedConsumer(self, self._cluster, consumer_group, **kwargs)\r\n  File \"/usr/local/lib/python2.7/dist-packages/pykafka/balancedconsumer.py\", line 183, in __init__\r\n    self.start()\r\n  File \"/usr/local/lib/python2.7/dist-packages/pykafka/balancedconsumer.py\", line 213, in start\r\n    self._rebalance()\r\n  File \"/usr/local/lib/python2.7/dist-packages/pykafka/balancedconsumer.py\", line 407, in _rebalance\r\n    self._setup_internal_consumer()\r\n  File \"/usr/local/lib/python2.7/dist-packages/pykafka/balancedconsumer.py\", line 268, in _setup_internal_consumer\r\n    reset_offset_on_start=reset_offset_on_start\r\n  File \"/usr/local/lib/python2.7/dist-packages/pykafka/simpleconsumer.py\", line 156, in __init__\r\n    self._discover_offset_manager()\r\n  File \"/usr/local/lib/python2.7/dist-packages/pykafka/simpleconsumer.py\", line 230, in _discover_offset_manager\r\n    self._offset_manager = self._cluster.get_offset_manager(self._consumer_group)\r\n  File \"/usr/local/lib/python2.7/dist-packages/pykafka/cluster.py\", line 252, in get_offset_manager\r\n    res = future.get(ConsumerMetadataResponse)\r\n  File \"/usr/local/lib/python2.7/dist-packages/pykafka/handlers.py\", line 55, in get\r\n    raise self.error\r\nSocketDisconnectedError\r\n```\r\n\r\nIt seems to me that problem is somewhere inside comunication with kafka."},"comment":{"url":"https://api.github.com/repos/Parsely/pykafka/issues/comments/116739063","html_url":"https://github.com/Parsely/pykafka/issues/196#issuecomment-116739063","issue_url":"https://api.github.com/repos/Parsely/pykafka/issues/196","id":116739063,"user":{"login":"kbourgoin","id":136574,"avatar_url":"https://avatars.githubusercontent.com/u/136574?v=3","gravatar_id":"","url":"https://api.github.com/users/kbourgoin","html_url":"https://github.com/kbourgoin","followers_url":"https://api.github.com/users/kbourgoin/followers","following_url":"https://api.github.com/users/kbourgoin/following{/other_user}","gists_url":"https://api.github.com/users/kbourgoin/gists{/gist_id}","starred_url":"https://api.github.com/users/kbourgoin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbourgoin/subscriptions","organizations_url":"https://api.github.com/users/kbourgoin/orgs","repos_url":"https://api.github.com/users/kbourgoin/repos","events_url":"https://api.github.com/users/kbourgoin/events{/privacy}","received_events_url":"https://api.github.com/users/kbourgoin/received_events","type":"User","site_admin":false},"created_at":"2015-06-29T15:50:51Z","updated_at":"2015-06-29T15:50:51Z","body":"PyKafka is currently the only python driver with a balance consumer implementation, so unfortunately you'd have to upgrade in order to be able to use it."}}