{"action":"created","issue":{"url":"https://api.github.com/repos/tgalal/yowsup/issues/978","labels_url":"https://api.github.com/repos/tgalal/yowsup/issues/978/labels{/name}","comments_url":"https://api.github.com/repos/tgalal/yowsup/issues/978/comments","events_url":"https://api.github.com/repos/tgalal/yowsup/issues/978/events","html_url":"https://github.com/tgalal/yowsup/issues/978","id":98481019,"number":978,"title":"Axolotl: DuplicateMessageException","user":{"login":"geversoncarvalho","id":4966608,"avatar_url":"https://avatars.githubusercontent.com/u/4966608?v=3","gravatar_id":"","url":"https://api.github.com/users/geversoncarvalho","html_url":"https://github.com/geversoncarvalho","followers_url":"https://api.github.com/users/geversoncarvalho/followers","following_url":"https://api.github.com/users/geversoncarvalho/following{/other_user}","gists_url":"https://api.github.com/users/geversoncarvalho/gists{/gist_id}","starred_url":"https://api.github.com/users/geversoncarvalho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geversoncarvalho/subscriptions","organizations_url":"https://api.github.com/users/geversoncarvalho/orgs","repos_url":"https://api.github.com/users/geversoncarvalho/repos","events_url":"https://api.github.com/users/geversoncarvalho/events{/privacy}","received_events_url":"https://api.github.com/users/geversoncarvalho/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-31T22:17:03Z","updated_at":"2015-08-10T00:29:00Z","closed_at":null,"body":"Hello guys,\r\n\r\nIn the last days we have experienced some problems that forced us to use Axolotl, but it was working until today's afternoon. We are using the develop branch as it is the most updated version.\r\n\r\nWhat is happening when running any custom application or even the yowsup-cli is:\r\n\r\n./yowsup-cli demos -l 55XXXXXXX:XXXXXXXXXXXX= -e --moxie\r\n\r\nTraceback (most recent call last):\r\n  File \"./yowsup-cli\", line 327, in <module>\r\n    if not parser.process():\r\n  File \"./yowsup-cli\", line 233, in process\r\n    self.startEcho()\r\n  File \"./yowsup-cli\", line 269, in startEcho\r\n    stack.start()\r\n  File \"/home/geverson.carvalho.dev/yowsup/yowsup/demos/echoclient/stack.py\", line 49, in start\r\n    self.stack.loop()\r\n  File \"/home/geverson.carvalho.dev/yowsup/yowsup/stacks/yowstack.py\", line 175, in loop\r\n    asyncore.loop(*args, **kwargs)\r\n  File \"/usr/lib/python2.7/asyncore.py\", line 216, in loop\r\n    poll_fun(timeout, map)\r\n  File \"/usr/lib/python2.7/asyncore.py\", line 156, in poll\r\n    read(obj)\r\n  File \"/usr/lib/python2.7/asyncore.py\", line 87, in read\r\n    obj.handle_error()\r\n  File \"/usr/lib/python2.7/asyncore.py\", line 83, in read\r\n    obj.handle_read_event()\r\n  File \"/usr/lib/python2.7/asyncore.py\", line 449, in handle_read_event\r\n    self.handle_read()\r\n  File \"/home/geverson.carvalho.dev/yowsup/yowsup/layers/network/layer.py\", line 73, in handle_read\r\n    self.receive(data)\r\n  File \"/home/geverson.carvalho.dev/yowsup/yowsup/layers/network/layer.py\", line 80, in receive\r\n    self.toUpper(data)\r\n  File \"/home/geverson.carvalho.dev/yowsup/yowsup/layers/__init__.py\", line 55, in toUpper\r\n    self.__upper.receive(data)\r\n  File \"/home/geverson.carvalho.dev/yowsup/yowsup/layers/stanzaregulator/layer.py\", line 28, in receive\r\n    self.processReceived()\r\n  File \"/home/geverson.carvalho.dev/yowsup/yowsup/layers/stanzaregulator/layer.py\", line 48, in processReceived\r\n    self.toUpper(oneMessageData)\r\n  File \"/home/geverson.carvalho.dev/yowsup/yowsup/layers/__init__.py\", line 55, in toUpper\r\n    self.__upper.receive(data)\r\n  File \"/home/geverson.carvalho.dev/yowsup/yowsup/layers/auth/layer_crypt.py\", line 63, in receive\r\n    self.toUpper(payload)\r\n  File \"/home/geverson.carvalho.dev/yowsup/yowsup/layers/__init__.py\", line 55, in toUpper\r\n    self.__upper.receive(data)\r\n  File \"/home/geverson.carvalho.dev/yowsup/yowsup/layers/coder/layer.py\", line 35, in receive\r\n    self.toUpper(node)\r\n  File \"/home/geverson.carvalho.dev/yowsup/yowsup/layers/__init__.py\", line 55, in toUpper\r\n    self.__upper.receive(data)\r\n  File \"/home/geverson.carvalho.dev/yowsup/yowsup/layers/logger/layer.py\", line 14, in receive\r\n    self.toUpper(data)\r\n  File \"/home/geverson.carvalho.dev/yowsup/yowsup/layers/__init__.py\", line 55, in toUpper\r\n    self.__upper.receive(data)\r\n  File \"/home/geverson.carvalho.dev/yowsup/yowsup/layers/axolotl/layer.py\", line 103, in receive\r\n    self.onMessage(protocolTreeNode)\r\n  File \"/home/geverson.carvalho.dev/yowsup/yowsup/layers/axolotl/layer.py\", line 125, in onMessage\r\n    self.handleEncMessage(protocolTreeNode)\r\n  File \"/home/geverson.carvalho.dev/yowsup/yowsup/layers/axolotl/layer.py\", line 210, in handleEncMessage\r\n    self.handleWhisperMessage(node)\r\n  File \"/home/geverson.carvalho.dev/yowsup/yowsup/layers/axolotl/layer.py\", line 254, in handleWhisperMessage\r\n    plaintext = sessionCipher.decryptMsg(whisperMessage)\r\n  File \"/storage/projetos/proj/venv/lib/python2.7/site-packages/axolotl/sessioncipher.py\", line 74, in decryptMsg\r\n    plaintext = self.decryptWithSessionRecord(sessionRecord, ciphertext)\r\n  File \"/storage/projetos/proj/venv/lib/python2.7/site-packages/axolotl/sessioncipher.py\", line 111, in decryptWithSessionRecord\r\n    plaintext = self.decryptWithSessionState(sessionState, cipherText)\r\n  File \"/storage/projetos/proj/venv/lib/python2.7/site-packages/axolotl/sessioncipher.py\", line 145, in decryptWithSessionState\r\n    chainKey, counter)\r\n  File \"/storage/projetos/proj/venv/lib/python2.7/site-packages/axolotl/sessioncipher.py\", line 182, in getOrCreateMessageKeys\r\n    \"with old counter: %s, %s\" % (chainKey.getIndex(), counter))\r\naxolotl.duplicatemessagexception.DuplicateMessageException: Received message with old counter: 2, 1\r\n\r\nIs Whatsapp changing its encode/encryption?\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/25233175-axolotl-duplicatemessageexception?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/129263669","html_url":"https://github.com/tgalal/yowsup/issues/978#issuecomment-129263669","issue_url":"https://api.github.com/repos/tgalal/yowsup/issues/978","id":129263669,"user":{"login":"devilankur18","id":431165,"avatar_url":"https://avatars.githubusercontent.com/u/431165?v=3","gravatar_id":"","url":"https://api.github.com/users/devilankur18","html_url":"https://github.com/devilankur18","followers_url":"https://api.github.com/users/devilankur18/followers","following_url":"https://api.github.com/users/devilankur18/following{/other_user}","gists_url":"https://api.github.com/users/devilankur18/gists{/gist_id}","starred_url":"https://api.github.com/users/devilankur18/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devilankur18/subscriptions","organizations_url":"https://api.github.com/users/devilankur18/orgs","repos_url":"https://api.github.com/users/devilankur18/repos","events_url":"https://api.github.com/users/devilankur18/events{/privacy}","received_events_url":"https://api.github.com/users/devilankur18/received_events","type":"User","site_admin":false},"created_at":"2015-08-10T00:29:00Z","updated_at":"2015-08-10T00:29:00Z","body":"@tgalal To reproduce this, receive a message but dont sent the receipt and break the connection.\r\n\r\nNow on again connect/reconnect, the same message is receive as no receipt is sent, causing duplicates key exception. "}}