joaoricardo000 / whatsapp-bot-seed

A small python framework to create a whatsapp bot, with regex-callback message routing.
727 stars 245 forks source link

Group message send : AttributeError: 'NoneType' object has no attribute 'getChild' #58

Closed alafanechere closed 8 years ago

alafanechere commented 8 years ago

When I try to send message to a groupe this error occurs and crashes the program :

  File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.4.48-py2.7.egg/yowsup/layers/axolotl/layer.py", line 121, in receive
    if not self.processIqRegistry(protocolTreeNode):
  File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.4.48-py2.7.egg/yowsup/layers/__init__.py", line 155, in processIqRegistry
    successClbk(protocolTreeNode, originalIq)
  File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.4.48-py2.7.egg/yowsup/layers/axolotl/layer.py", line 181, in <lambda>
    self._sendIq(entity, lambda a, b: self.onGetKeysResult(a, b, self.processPendingMessages), self.onGetKeysError)
  File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.4.48-py2.7.egg/yowsup/layers/axolotl/layer.py", line 345, in onGetKeysResult
    entity = ResultGetKeysIqProtocolEntity.fromProtocolTreeNode(resultNode)
  File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.4.48-py2.7.egg/yowsup/layers/axolotl/protocolentities/iq_keys_get_result.py", line 87, in fromProtocolTreeNode
    preKeyId = ResultGetKeysIqProtocolEntity._bytesToInt(preKeyNode.getChild("id").getData())
AttributeError: 'NoneType' object has no attribute 'getChild'

It just occured, I managed to send message to a group before I restarted the program... Any idea of where this is coming from?

K4CZP3R commented 8 years ago

does it crash your program?

joaoricardo000 commented 8 years ago

https://github.com/tgalal/yowsup/pull/1364/files !!

nauramutiara commented 8 years ago

I try to use https://github.com/tgalal/yowsup/pull/1364/files but still have AttributeError: 'NoneType' object has no attribute 'getChild' any sugest?? also try to reinstall yowsup with #1364. but not solved my problem..

nauramutiara commented 8 years ago

Solved... with moving whatsapp-bot-seed to virtualenv and https://github.com/tgalal/yowsup/pull/1364/files

e0xify commented 8 years ago

this solution is strange, it works for 2 -3 runtimes, then the error came back for me. changed everything to virtualenv - did the same changed, errror was gone. bot crashes and doesnt came up with the same error again. wtf?!

File "build/bdist.linux-x86_64/egg/yowsup/layers/stanzaregulator/layer.py", line 49, in processReceived
self.toUpper(oneMessageData)
File "build/bdist.linux-x86_64/egg/yowsup/layers/init.py", line 75, in toUpper
self.upper.receive(data)
File "build/bdist.linux-x86_64/egg/yowsup/layers/auth/layer_crypt.py", line 65, in receive
self.toUpper(payload)
File "build/bdist.linux-x86_64/egg/yowsup/layers/__init
.py", line 75, in toUpper
self.upper.receive(data)
File "build/bdist.linux-x86_64/egg/yowsup/layers/coder/layer.py", line 35, in receive
self.toUpper(node)
File "build/bdist.linux-x86_64/egg/yowsup/layers/__init
.py", line 75, in toUpper
self.upper.receive(data)
File "build/bdist.linux-x86_64/egg/yowsup/layers/logger/layer.py", line 14, in receive
self.toUpper(data)
File "build/bdist.linux-x86_64/egg/yowsup/layers/__init
.py", line 75, in toUpper
self.upper.receive(data)
File "build/bdist.linux-x86_64/egg/yowsup/layers/__init
.py", line 188, in receive
s.receive(data)
File "build/bdist.linux-x86_64/egg/yowsup/layers/init.py", line 124, in receive
recv(node)
File "build/bdist.linux-x86_64/egg/yowsup/layers/protocol_messages/layer.py", line 20, in recvMessageStanza
entity = TextMessageProtocolEntity.fromProtocolTreeNode(node)
File "build/bdist.linux-x86_64/egg/yowsup/layers/protocol_messages/protocolentities/message_text.py", line 38, in fromProtocolTreeNode
entity.setBody(node.getChild("body").getData())
AttributeError: 'NoneType' object has no attribute 'getData'

e0xify commented 8 years ago

strange , seems that the error still happens when u get a private message.

need to rm -rf ~/.yowsup/* then.