{"action":"created","issue":{"url":"https://api.github.com/repos/tgalal/yowsup/issues/700","labels_url":"https://api.github.com/repos/tgalal/yowsup/issues/700/labels{/name}","comments_url":"https://api.github.com/repos/tgalal/yowsup/issues/700/comments","events_url":"https://api.github.com/repos/tgalal/yowsup/issues/700/events","html_url":"https://github.com/tgalal/yowsup/issues/700","id":66260379,"number":700,"title":"Yosup printing iq to=\"s.whatsapp.net\" xmlns=\"encrypt\" type=\"get\" in a loop","user":{"login":"anuraguniyal","id":918588,"avatar_url":"https://avatars.githubusercontent.com/u/918588?v=3","gravatar_id":"","url":"https://api.github.com/users/anuraguniyal","html_url":"https://github.com/anuraguniyal","followers_url":"https://api.github.com/users/anuraguniyal/followers","following_url":"https://api.github.com/users/anuraguniyal/following{/other_user}","gists_url":"https://api.github.com/users/anuraguniyal/gists{/gist_id}","starred_url":"https://api.github.com/users/anuraguniyal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anuraguniyal/subscriptions","organizations_url":"https://api.github.com/users/anuraguniyal/orgs","repos_url":"https://api.github.com/users/anuraguniyal/repos","events_url":"https://api.github.com/users/anuraguniyal/events{/privacy}","received_events_url":"https://api.github.com/users/anuraguniyal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-04T01:23:33Z","updated_at":"2015-04-18T12:33:06Z","closed_at":null,"body":"When I tried to send a message yowsup goes into some infinite loop and started printing messages like\r\n```\r\n<iq to=\"s.whatsapp.net\" xmlns=\"encrypt\" type=\"get\" id=\"4\">\r\n<key>\r\n<user jid=\"xxx@s.whatsapp.net\">\r\n</user>\r\n</key>\r\n</iq>\r\n```\r\n\r\nGood thing is it was not sending or recieving these on network as I disconnected my network at that point, but what would trigger this?\r\n\r\n```\r\n<success status=\"active\" kind=\"free\" creation=\"1427930481\" expiration=\"1459466481\" props=\"4\" t=\"1428109742\">\r\nGһ&65????.?Qt???8\r\nHEX:471cd2bb2636353f8bcbde2eeb511e749ab58938\r\n</success>\r\n\r\n2015-04-03 18:09:02,288 DEBUG: rx:\r\n<ib from=\"s.whatsapp.net\">\r\n<offline count=\"0\">\r\n</offline>\r\n</ib>\r\n\r\n2015-04-03 18:10:15,143 DEBUG: tx:\r\n<iq to=\"s.whatsapp.net\" xmlns=\"encrypt\" type=\"get\" id=\"4\">\r\n<key>\r\n<user jid=\"xxx@s.whatsapp.net\">\r\n</user>\r\n</key>\r\n</iq>\r\n\r\n2015-04-03 18:10:15,276 DEBUG: rx:\r\n<iq type=\"result\" from=\"s.whatsapp.net\" id=\"4\">\r\n<list>\r\n<user jid=\"xxx@s.whatsapp.net\">\r\n<registration>\r\n|?gP\r\nHEX:7ccd6750\r\n</registration>\r\n<type>\r\n\r\nHEX:05\r\n</type>\r\n<identity>\r\n{??????k?3?c)Ҫ???RջU?=&>\r\nHEX:7bccfe9f10d7eceea66be01d33f26329d2aa82ea178f52d5bb55ec3d0126063e\r\n</identity>\r\n<skey>\r\n<id>\r\n\r\nHEX:000000\r\n</id>\r\n<value>\r\n֎}T??T?\r\n(?i-?'o?$)?=???b.t\r\nHEX:1cd68e1e7d54b5c00654960a2801bb692d9527026f8f2429fa3d9be6c9622e74\r\n</value>\r\n<signature>\r\n????;F?,xs???h??o??C;4֩??A\r\nHEX:527600f728718f12a3f3156619dac673a5cd328626e0e675801d34d6a9a6ec410d3c26f9f68646b32c7873bee21eba6885fa6fdd10a9433b0dd5f8efcb193b07\r\n</signature>\r\n</skey>\r\n<key>\r\n<id>\r\n??<\r\nHEX:82b13c\r\n</id>\r\n<value>\r\n?9?K?????)3+Β,h?EpaW?-??neh\r\nHEX:f139f3bc014b899e88b3d229332bce922c016807e545706157e62df5d06e6568\r\n</value>\r\n</key>\r\n</user>\r\n</list>\r\n</iq>\r\n\r\n2015-04-03 18:10:15,292 DEBUG: tx:\r\n<iq to=\"s.whatsapp.net\" xmlns=\"encrypt\" type=\"get\" id=\"5\">\r\n<key>\r\n<user jid=\"xxx@s.whatsapp.net\">\r\n</user>\r\n</key>\r\n</iq>\r\n\r\n...\r\n...\r\nlong long list\r\n...\r\n...\r\n\r\n2015-04-03 18:10:58,489 DEBUG: tx:\r\n<iq to=\"s.whatsapp.net\" xmlns=\"encrypt\" type=\"get\" id=\"41937\">\r\n<key>\r\n<user jid=\"xxx@s.whatsapp.net\">\r\n</user>\r\n</key>\r\n</iq>\r\n\r\n2015-04-03 18:10:58,491 DEBUG: tx:\r\n<iq to=\"s.whatsapp.net\" xmlns=\"encrypt\" type=\"get\" id=\"41938\">\r\n<key>\r\n<user jid=\"xxx@s.whatsapp.net\">\r\n</user>\r\n</key>\r\n</iq>\r\n\r\nTraceback (most recent call last):\r\n File \"yowsup_server/run.py\", line 90, in <module>\r\n    stack.loop()\r\n  File \"/mnt/hgfs/auniyal/src/yowsup_heroku/venv/lib/python2.7/site-packages/yowsup/stacks/yowstack.py\", line 170, in loop\r\n    asyncore.loop(*args, **kwargs)\r\n  File \"/usr/local/lib/python2.7/asyncore.py\", line 216, in loop\r\n    poll_fun(timeout, map)\r\n  File \"/usr/local/lib/python2.7/asyncore.py\", line 156, in poll\r\n    read(obj)\r\n  File \"/usr/local/lib/python2.7/asyncore.py\", line 83, in read\r\n    obj.handle_read_event()\r\n  File \"/usr/local/lib/python2.7/asyncore.py\", line 444, in handle_read_event\r\n    self.handle_read()\r\n  File \"/mnt/hgfs/auniyal/src/yowsup_heroku/venv/lib/python2.7/site-packages/yowsup/layers/network/layer.py\", line 48, in handle_read\r\n    self.receive(data)\r\n  File \"/mnt/hgfs/auniyal/src/yowsup_heroku/venv/lib/python2.7/site-packages/yowsup/layers/network/layer.py\", line 55, in receive\r\n    self.toUpper(data)\r\n  File \"/mnt/hgfs/auniyal/src/yowsup_heroku/venv/lib/python2.7/site-packages/yowsup/layers/__init__.py\", line 55, in toUpper\r\n    self.__upper.receive(data)\r\n  File \"/mnt/hgfs/auniyal/src/yowsup_heroku/venv/lib/python2.7/site-packages/yowsup/layers/stanzaregulator/layer.py\", line 28, in receive\r\n    self.processReceived()\r\n  File \"/mnt/hgfs/auniyal/src/yowsup_heroku/venv/lib/python2.7/site-packages/yowsup/layers/stanzaregulator/layer.py\", line 48, in processReceived\r\n    self.toUpper(oneMessageData)\r\n  File \"/mnt/hgfs/auniyal/src/yowsup_heroku/venv/lib/python2.7/site-packages/yowsup/layers/__init__.py\", line 55, in toUpper\r\n    self.__upper.receive(data)\r\n  File \"/mnt/hgfs/auniyal/src/yowsup_heroku/venv/lib/python2.7/site-packages/yowsup/layers/auth/layer_crypt.py\", line 63, in receive\r\n    self.toUpper(payload)\r\n  File \"/mnt/hgfs/auniyal/src/yowsup_heroku/venv/lib/python2.7/site-packages/yowsup/layers/__init__.py\", line 55, in toUpper\r\n    self.__upper.receive(data)\r\n  File \"/mnt/hgfs/auniyal/src/yowsup_heroku/venv/lib/python2.7/site-packages/yowsup/layers/coder/layer.py\", line 35, in receive\r\n    self.toUpper(node)\r\n  File \"/mnt/hgfs/auniyal/src/yowsup_heroku/venv/lib/python2.7/site-packages/yowsup/layers/__init__.py\", line 55, in toUpper\r\n    self.__upper.receive(data)\r\n  File \"/mnt/hgfs/auniyal/src/yowsup_heroku/venv/lib/python2.7/site-packages/yowsup/layers/logger/layer.py\", line 14, in receive\r\n    self.toUpper(data)\r\n  File \"/mnt/hgfs/auniyal/src/yowsup_heroku/venv/lib/python2.7/site-packages/yowsup/layers/__init__.py\", line 55, in toUpper\r\n    self.__upper.receive(data)\r\n  File \"/mnt/hgfs/auniyal/src/yowsup_heroku/venv/lib/python2.7/site-packages/yowsup/layers/axolotl/layer.py\", line 97, in receive\r\n    if not self.processIqRegistry(protocolTreeNode):\r\n  File \"/mnt/hgfs/auniyal/src/yowsup_heroku/venv/lib/python2.7/site-packages/yowsup/layers/__init__.py\", line 132, in processIqRegistry\r\n    successClbk(protocolTreeNode, originalIq)\r\n  File \"/mnt/hgfs/auniyal/src/yowsup_heroku/venv/lib/python2.7/site-packages/yowsup/layers/axolotl/layer.py\", line 265, in onGetKeysResult\r\n    self.processPendingMessages(jid)\r\n  File \"/mnt/hgfs/auniyal/src/yowsup_heroku/venv/lib/python2.7/site-packages/yowsup/layers/axolotl/layer.py\", line 129, in processPendingMessages\r\n    self.handlePlaintextNode(messageNode)\r\n  File \"/mnt/hgfs/auniyal/src/yowsup_heroku/venv/lib/python2.7/site-packages/yowsup/layers/axolotl/layer.py\", line 146, in handlePlaintextNode\r\n    self._sendIq(entity, self.onGetKeysResult, self.onGetKeysError)\r\n  File \"/mnt/hgfs/auniyal/src/yowsup_heroku/venv/lib/python2.7/site-packages/yowsup/layers/__init__.py\", line 122, in _sendIq\r\n    self.toLower(iqEntity.toProtocolTreeNode())\r\n  File \"/mnt/hgfs/auniyal/src/yowsup_heroku/venv/lib/python2.7/site-packages/yowsup/layers/__init__.py\", line 59, in toLower\r\n    self.__lower.send(data)\r\n  File \"/mnt/hgfs/auniyal/src/yowsup_heroku/venv/lib/python2.7/site-packages/yowsup/layers/logger/layer.py\", line 9, in send\r\n    self.toLower(data)\r\n  File \"/mnt/hgfs/auniyal/src/yowsup_heroku/venv/lib/python2.7/site-packages/yowsup/layers/__init__.py\", line 59, in toLower\r\n    self.__lower.send(data)\r\n  File \"/mnt/hgfs/auniyal/src/yowsup_heroku/venv/lib/python2.7/site-packages/yowsup/layers/coder/layer.py\", line 30, in send\r\n    self.write(self.writer.protocolTreeNodeToBytes(data))\r\n  File \"/mnt/hgfs/auniyal/src/yowsup_heroku/venv/lib/python2.7/site-packages/yowsup/layers/coder/layer.py\", line 39, in write\r\n    self.toLower(bytearray(i))\r\n  File \"/mnt/hgfs/auniyal/src/yowsup_heroku/venv/lib/python2.7/site-packages/yowsup/layers/__init__.py\", line 59, in toLower\r\n    self.__lower.send(data)\r\n  File \"/mnt/hgfs/auniyal/src/yowsup_heroku/venv/lib/python2.7/site-packages/yowsup/layers/auth/layer_crypt.py\", line 46, in send\r\n    self.toLower(bytearray(data))\r\n  File \"/mnt/hgfs/auniyal/src/yowsup_heroku/venv/lib/python2.7/site-packages/yowsup/layers/__init__.py\", line 59, in toLower\r\n    self.__lower.send(data)\r\n  File \"/mnt/hgfs/auniyal/src/yowsup_heroku/venv/lib/python2.7/site-packages/yowsup/layers/stanzaregulator/layer.py\", line 23, in send\r\n    self.toLower(data)\r\n  File \"/mnt/hgfs/auniyal/src/yowsup_heroku/venv/lib/python2.7/site-packages/yowsup/layers/__init__.py\", line 59, in toLower\r\n    self.__lower.send(data)\r\n  File \"/mnt/hgfs/auniyal/src/yowsup_heroku/venv/lib/python2.7/site-packages/yowsup/layers/network/layer.py\", line 51, in send\r\n    self.out_buffer = self.out_buffer + data\r\nKeyboardInterrupt\r\n```\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/10441172-yosup-printing-iq-to-s-whatsapp-net-xmlns-encrypt-type-get-in-a-loop?utm_campaign=plugin&utm_content=tracker%2F298781&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F298781&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/tgalal/yowsup/issues/comments/94162648","html_url":"https://github.com/tgalal/yowsup/issues/700#issuecomment-94162648","issue_url":"https://api.github.com/repos/tgalal/yowsup/issues/700","id":94162648,"user":{"login":"jlguardi","id":10707343,"avatar_url":"https://avatars.githubusercontent.com/u/10707343?v=3","gravatar_id":"","url":"https://api.github.com/users/jlguardi","html_url":"https://github.com/jlguardi","followers_url":"https://api.github.com/users/jlguardi/followers","following_url":"https://api.github.com/users/jlguardi/following{/other_user}","gists_url":"https://api.github.com/users/jlguardi/gists{/gist_id}","starred_url":"https://api.github.com/users/jlguardi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlguardi/subscriptions","organizations_url":"https://api.github.com/users/jlguardi/orgs","repos_url":"https://api.github.com/users/jlguardi/repos","events_url":"https://api.github.com/users/jlguardi/events{/privacy}","received_events_url":"https://api.github.com/users/jlguardi/received_events","type":"User","site_admin":false},"created_at":"2015-04-18T12:33:06Z","updated_at":"2015-04-18T12:33:06Z","body":"I think this is an expected result. You are getting encryption Keys on first boot. It spends long time (1 minute) and stores keys in local data base. \r\nTry to run yowsup-cli with encryption for firts time and wait until all keys are downloaded. This app has console output indicating current state. "}}