Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported operand type(s) / DecodeEroor: Truncated message #1613

Closed
Aragorn1701 opened this issue May 25, 2016 · 28 comments
Closed

Unsupported operand type(s) / DecodeEroor: Truncated message #1613

Aragorn1701 opened this issue May 25, 2016 · 28 comments

Comments

@Aragorn1701
Copy link

Hello

I got the following error when receiving a message (from a single contact, group chats work):

TypeError: unsupported operand type(s) for &: 'str' and 'int'

During handling of the above exception, another exception occurred:

File "C:\Users\Thomas\AppData\Local\Programs\Python\Python35-32\lib\site-packages\protobuf-3.0.0b2-py3.5.egg\google\protobuf\internal\python_message.py", line 1097, in MergeFromString
google.protobuf.message.DecodeError: Truncated message.

I tried both protbuf 3.0.0.b2 and b3, same error.
Python version is 3.5.1
Here are my installed packages + version:

pip (8.1.2)
protobuf (3.0.0b2)
pycrypto (2.6.1)
pyreadline (2.1)
python-axolotl (0.1.35)
python-axolotl-curve25519 (0.1)
python-dateutil (2.5.3)
setuptools (18.2)
six (1.10.0)
yowsup2 (2.5.0)

Here's the full error:

Traceback (most recent call last):
DUMP:
  File "C:\Users\Thomas\AppData\Local\Programs\Python\Python35-32\lib\site-packages\protobuf-3.0.0b2-py3.5.egg\google\protobuf\internal\python_message.py", line 1091, in MergeFromString

  File "C:\Users\Thomas\AppData\Local\Programs\Python\Python35-32\lib\site-packages\protobuf-3.0.0b2-py3.5.egg\google\protobuf\internal\python_message.py", line 1113, in InternalParse
�Test
  File "C:\Users\Thomas\AppData\Local\Programs\Python\Python35-32\lib\site-packages\protobuf-3.0.0b2-py3.5.egg\google\protobuf\internal\decoder.py", line 181, in ReadTag
['\n', '\x04', 'T', 'e', 's', 't']
[10, 4, 84, 101, 115, 116]
TypeError: unsupported operand type(s) for &: 'str' and 'int'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:/Users/Thomas/IdeaProjects/YowsupTest/YowsupTest/__init__.py", line 1, in <module>
    from YowsupTest.stack import YowsupEchoStack
  File "C:\Users\Thomas\IdeaProjects\YowsupTest\YowsupTest\__init__.py", line 9, in <module>
    YowsupEchoStack.start(stack)
  File "C:\Users\Thomas\IdeaProjects\YowsupTest\YowsupTest\stack.py", line 21, in start
    self.stack.loop()
  File "C:\Users\Thomas\AppData\Local\Programs\Python\Python35-32\lib\site-packages\yowsup2-2.5.0-py3.5.egg\yowsup\stacks\yowstack.py", line 196, in loop
    asyncore.loop(*args, **kwargs)
  File "C:\Users\Thomas\AppData\Local\Programs\Python\Python35-32\lib\asyncore.py", line 203, in loop
    poll_fun(timeout, map)
  File "C:\Users\Thomas\AppData\Local\Programs\Python\Python35-32\lib\asyncore.py", line 150, in poll
    read(obj)
  File "C:\Users\Thomas\AppData\Local\Programs\Python\Python35-32\lib\asyncore.py", line 87, in read
    obj.handle_error()
  File "C:\Users\Thomas\AppData\Local\Programs\Python\Python35-32\lib\asyncore.py", line 83, in read
    obj.handle_read_event()
  File "C:\Users\Thomas\AppData\Local\Programs\Python\Python35-32\lib\asyncore.py", line 423, in handle_read_event
    self.handle_read()
  File "C:\Users\Thomas\AppData\Local\Programs\Python\Python35-32\lib\site-packages\yowsup2-2.5.0-py3.5.egg\yowsup\layers\network\layer.py", line 102, in handle_read
    self.receive(data)
  File "C:\Users\Thomas\AppData\Local\Programs\Python\Python35-32\lib\site-packages\yowsup2-2.5.0-py3.5.egg\yowsup\layers\network\layer.py", line 110, in receive
    self.toUpper(data)
  File "C:\Users\Thomas\AppData\Local\Programs\Python\Python35-32\lib\site-packages\yowsup2-2.5.0-py3.5.egg\yowsup\layers\__init__.py", line 76, in toUpper
    self.__upper.receive(data)
  File "C:\Users\Thomas\AppData\Local\Programs\Python\Python35-32\lib\site-packages\yowsup2-2.5.0-py3.5.egg\yowsup\layers\stanzaregulator\layer.py", line 29, in receive
    self.processReceived()
  File "C:\Users\Thomas\AppData\Local\Programs\Python\Python35-32\lib\site-packages\yowsup2-2.5.0-py3.5.egg\yowsup\layers\stanzaregulator\layer.py", line 49, in processReceived
    self.toUpper(oneMessageData)
  File "C:\Users\Thomas\AppData\Local\Programs\Python\Python35-32\lib\site-packages\yowsup2-2.5.0-py3.5.egg\yowsup\layers\__init__.py", line 76, in toUpper
    self.__upper.receive(data)
  File "C:\Users\Thomas\AppData\Local\Programs\Python\Python35-32\lib\site-packages\yowsup2-2.5.0-py3.5.egg\yowsup\layers\auth\layer_crypt.py", line 65, in receive
    self.toUpper(payload)
  File "C:\Users\Thomas\AppData\Local\Programs\Python\Python35-32\lib\site-packages\yowsup2-2.5.0-py3.5.egg\yowsup\layers\__init__.py", line 76, in toUpper
    self.__upper.receive(data)
  File "C:\Users\Thomas\AppData\Local\Programs\Python\Python35-32\lib\site-packages\yowsup2-2.5.0-py3.5.egg\yowsup\layers\coder\layer.py", line 35, in receive
    self.toUpper(node)
  File "C:\Users\Thomas\AppData\Local\Programs\Python\Python35-32\lib\site-packages\yowsup2-2.5.0-py3.5.egg\yowsup\layers\__init__.py", line 76, in toUpper
    self.__upper.receive(data)
  File "C:\Users\Thomas\AppData\Local\Programs\Python\Python35-32\lib\site-packages\yowsup2-2.5.0-py3.5.egg\yowsup\layers\logger\layer.py", line 14, in receive
    self.toUpper(data)
  File "C:\Users\Thomas\AppData\Local\Programs\Python\Python35-32\lib\site-packages\yowsup2-2.5.0-py3.5.egg\yowsup\layers\__init__.py", line 76, in toUpper
    self.__upper.receive(data)
  File "C:\Users\Thomas\AppData\Local\Programs\Python\Python35-32\lib\site-packages\yowsup2-2.5.0-py3.5.egg\yowsup\layers\axolotl\layer_control.py", line 44, in receive
    self.toUpper(protocolTreeNode)
  File "C:\Users\Thomas\AppData\Local\Programs\Python\Python35-32\lib\site-packages\yowsup2-2.5.0-py3.5.egg\yowsup\layers\__init__.py", line 76, in toUpper
    self.__upper.receive(data)
  File "C:\Users\Thomas\AppData\Local\Programs\Python\Python35-32\lib\site-packages\yowsup2-2.5.0-py3.5.egg\yowsup\layers\__init__.py", line 189, in receive
    s.receive(data)
  File "C:\Users\Thomas\AppData\Local\Programs\Python\Python35-32\lib\site-packages\yowsup2-2.5.0-py3.5.egg\yowsup\layers\axolotl\layer_receive.py", line 41, in receive
    self.onMessage(protocolTreeNode)
  File "C:\Users\Thomas\AppData\Local\Programs\Python\Python35-32\lib\site-packages\yowsup2-2.5.0-py3.5.egg\yowsup\layers\axolotl\layer_receive.py", line 74, in onMessage
    self.handleEncMessage(protocolTreeNode)
  File "C:\Users\Thomas\AppData\Local\Programs\Python\Python35-32\lib\site-packages\yowsup2-2.5.0-py3.5.egg\yowsup\layers\axolotl\layer_receive.py", line 88, in handleEncMessage
    self.handleWhisperMessage(node)
  File "C:\Users\Thomas\AppData\Local\Programs\Python\Python35-32\lib\site-packages\yowsup2-2.5.0-py3.5.egg\yowsup\layers\axolotl\layer_receive.py", line 144, in handleWhisperMessage
    self.parseAndHandleMessageProto(encMessageProtocolEntity, plaintext[:-padding])
  File "C:\Users\Thomas\AppData\Local\Programs\Python\Python35-32\lib\site-packages\yowsup2-2.5.0-py3.5.egg\yowsup\layers\axolotl\layer_receive.py", line 171, in parseAndHandleMessageProto
    m.ParseFromString(serializedData)
  File "C:\Users\Thomas\AppData\Local\Programs\Python\Python35-32\lib\site-packages\protobuf-3.0.0b2-py3.5.egg\google\protobuf\message.py", line 185, in ParseFromString
  File "C:\Users\Thomas\AppData\Local\Programs\Python\Python35-32\lib\site-packages\protobuf-3.0.0b2-py3.5.egg\google\protobuf\internal\python_message.py", line 1097, in MergeFromString
google.protobuf.message.DecodeError: Truncated message.

Process finished with exit code 1
@Gab0
Copy link

Gab0 commented Jun 2, 2016

I use protobuf version 3.0.0b2.post2 and it works.

@danielferrer
Copy link

Same for me, tried with protobuf 3.0.0.b2.post2, 3.0.0.beta3, 3.0.0.beta2, six-1.10.0 same ocurs. Tried with python 3.4 and 3.5 on CentOS (IUS python repo):

['\n', '\x10', 'A', 'c', 'a', ' ', 'e', 'n', ' ', 'l', 'a', ' ', 'v', 'u', 'e', 'l', 't', 'a']
[10, 16, 65, 99, 97, 32, 101, 110, 32, 108, 97, 32, 118, 117, 101, 108, 116, 97]
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/protobuf-3.0.0b2.post2-py3.4.egg/google/protobuf/internal/python_message.py", line 1091, in MergeFromString
if self._InternalParse(serialized, 0, length) != length:
File "/usr/lib/python3.4/site-packages/protobuf-3.0.0b2.post2-py3.4.egg/google/protobuf/internal/python_message.py", line 1113, in InternalParse
(tag_bytes, new_pos) = local_ReadTag(buffer, pos)
File "/usr/lib/python3.4/site-packages/protobuf-3.0.0b2.post2-py3.4.egg/google/protobuf/internal/decoder.py", line 181, in ReadTag
while six.indexbytes(buffer, pos) & 0x80:
TypeError: unsupported operand type(s) for &: 'str' and 'int'

During handling of the above exception, another exception occurred:
...
File "/usr/lib/python3.4/site-packages/protobuf-3.0.0b2.post2-py3.4.egg/google/protobuf/message.py", line 185, in ParseFromString
self.MergeFromString(serialized)
File "/usr/lib/python3.4/site-packages/protobuf-3.0.0b2.post2-py3.4.egg/google/protobuf/internal/python_message.py", line 1097, in MergeFromString
raise message_mod.DecodeError('Truncated message.')
google.protobuf.message.DecodeError: Truncated message.

@danielferrer
Copy link

By the way, it works ok in python 2.6.6 (python 2.6 from CentOS 6).
In python 3.4/3.5 it gave me the error mentioned in issue when receiving a mesage: "TypeError: unsupported operand type(s) for &: 'str' and 'int'"

@kartikgola
Copy link

Is there any workaround to this ?

Randl added a commit to Randl/python-axolotl that referenced this issue Aug 22, 2016
@tawanda
Copy link

tawanda commented Sep 17, 2016

workaround is to use my branch for now, just ignored the error. I only tested this with text messages

pip install git+https://github.com/tawanda/yowsup.git#egg=yowsup

@ricardojlrufino
Copy link

Confirmed that it works in Python 3.4

pip install git+https://github.com/tawanda/yowsup.git#egg=yowsup

I use virtual env

virtualenv -p which python3 env
. env/bin/activate
pip3.4 install git+https://github.com/tawanda/yowsup.git#egg=yowsup

NOTE: Use the shell "bash" I had problems with zsh

@ghost
Copy link

ghost commented Oct 18, 2016

@ricardojlrufino You can do
sudo pip3 install 'git+https://github.com/tawanda/yowsup.git#egg=yowsup'

@tawanda
Copy link

tawanda commented Oct 18, 2016

Dont use sudo with pip installs or you will install in the root python rather than the virtual env

On 18 Oct 2016, at 15:34, Arav K. notifications@github.com wrote:

@ricardojlrufino You can do
sudo pip3 install 'git+https://github.com/tawanda/yowsup.git#egg=yowsup'


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

@tawanda
Copy link

tawanda commented Nov 11, 2016

Sure, how can i help

On Fri, Nov 11, 2016 at 8:38 AM, Kyle Reynolds notifications@github.com
wrote:

@tawanda https://github.com/tawanda Still around? Your repo seems to be
working pretty nice than others with python 3, just need a small favor from
you


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#1613 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AG--AIlK6rcsUJdbKcYk9diyCA1jiRkqks5q9A15gaJpZM4ImobK
.

@decieved
Copy link

@tawanda It's regarding handling iq results from a nested function to use in other functions of the same class, perhaps you can email me or contact me on a live chat?

@tawanda
Copy link

tawanda commented Nov 15, 2016

I have no idea how to do that. In my fork i literally silenced the exception. Im not familiar with the source code of this library

On 15 Nov 2016, at 18:27, Kyle Reynolds notifications@github.com wrote:

@tawanda It's regarding handling iq results from a nested function to use in other functions of the same class, perhaps you can email me or contact me on a live chat?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@decieved
Copy link

@tawanda Still using yowsup? because I'm using your working version and still haven't got banned for almost 2 weeks now..

Although I've never been banned before

@tawanda
Copy link

tawanda commented Nov 15, 2016

Yes i am. So long as you stay online once in a while and put pauses between sends you should not get blocked

Sent from my iPhone

On 15 Nov 2016, at 20:40, Kyle Reynolds notifications@github.com wrote:

@tawanda Still using yowsup? because I'm using your working version and still haven't got banned for almost 2 weeks now..

Although I've never been banned before


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@decieved
Copy link

decieved commented Nov 15, 2016

@tawanda I can't seems to stay online, i keep getting disconnected for this error when i'm connected at random times

stream error: ack

This is a bit off topic, can I contact you somewhere about your repo?

@tawanda
Copy link

tawanda commented Nov 15, 2016

Leave me a message on my contact form at siegecommunications.com

On 15 Nov 2016, at 22:34, Kyle Reynolds notifications@github.com wrote:

@tawanda I can't seems to stay online, i keep getting this error when i'm connected at random times

stream error: ack

This is a bit off topic, can I contact you somewhere about it?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@decieved
Copy link

@tawanda Nice website, puzzles me a bit wondering if it was your hosting company, nice job 👍

@jlguardi
Copy link
Collaborator

@kyleJR You are missing to ack an incomming message/media/notification... If you see debug logs, you can see something like "stream error: ack missing ack 123423454" and you will find a message/notification with id 123423454.
Just ack the incomming entity to keep you online.

@decieved
Copy link

@jlguardi I've sent message delivered ack on every message, perhaps it's media or notification?

_layer.py_      [DEBUG][2016-11-16 10:50:14,627] rx:
<receipt type="retry" id="1479271147-6" from="***********-1474078490@g.us" t="1479293414" participant="***********@s.whatsapp.net">
<retry id="1479271147-6" t="1479271149" v="1" count="1">
</retry>
<registration>
l~T
HEX3:b'6c7e5406'
</registration>
</receipt>

_layer_send.py_ [DEBUG][2016-11-16 10:50:14,627] Axolotl layer does not have the message, bubbling it upwards
_layer.py_      [DEBUG][2016-11-16 10:50:14,628] tx:
<ack id="1479271147-6" type="retry" class="receipt" participant="***********@s.whatsapp.net" to="***********-1474078490@g.us">
</ack>

_layer.py_      [DEBUG][2016-11-16 10:50:14,952] rx:
<receipt type="retry" id="1479271147-6" from="***********-1474078490@g.us" t="1479293414" participant="***********@s.whatsapp.net">
<retry id="1479271147-6" t="1479271149" v="1" count="1">
</retry>
<registration>
l~T
HEX3:b'6c7e5406'
</registration>
</receipt>

_layer_send.py_ [DEBUG][2016-11-16 10:50:14,952] Axolotl layer does not have the message, bubbling it upwards
_layer.py_      [DEBUG][2016-11-16 10:50:14,952] tx:
<ack id="1479271147-6" type="retry" class="receipt" participant="***********@s.whatsapp.net" to="***********-1474078490@g.us">
</ack>

_layer.py_      [DEBUG][2016-11-16 10:50:14,953] rx:
<receipt type="retry" id="1479271147-6" from="***********-1474078490@g.us" t="1479293414" participant="***********@s.whatsapp.net">
<retry id="1479271147-6" t="1479271149" v="1" count="1">
</retry>
<registration>
l~T
HEX3:b'6c7e5406'
</registration>
</receipt>

_layer_send.py_ [DEBUG][2016-11-16 10:50:14,954] Axolotl layer does not have the message, bubbling it upwards
_layer.py_      [DEBUG][2016-11-16 10:50:14,954] tx:
<ack id="1479271147-6" type="retry" class="receipt" participant="***********@s.whatsapp.net" to="***********-1474078490@g.us">
</ack>

_layer.py_      [DEBUG][2016-11-16 10:50:15,043] rx:
<receipt type="retry" id="1479271147-6" from="***********-1474078490@g.us" t="1479293415" participant="***********@s.whatsapp.net">
<retry id="1479271147-6" t="1479271149" v="1" count="1">
</retry>
<registration>
l~T
HEX3:b'6c7e5406'
</registration>
</receipt>

_layer_send.py_ [DEBUG][2016-11-16 10:50:15,043] Axolotl layer does not have the message, bubbling it upwards
_layer.py_      [DEBUG][2016-11-16 10:50:15,044] tx:
<ack id="1479271147-6" type="retry" class="receipt" participant="***********@s.whatsapp.net" to="***********-1474078490@g.us">
</ack>

_layer.py_      [DEBUG][2016-11-16 10:50:15,172] rx:
<receipt type="retry" id="1479271147-6" from="***********-1474078490@g.us" t="1479293415" participant="***********@s.whatsapp.net">
<retry id="1479271147-6" t="1479271149" v="1" count="1">
</retry>
<registration>
l~T
HEX3:b'6c7e5406'
</registration>
</receipt>

_layer_send.py_ [DEBUG][2016-11-16 10:50:15,172] Axolotl layer does not have the message, bubbling it upwards
_layer.py_      [DEBUG][2016-11-16 10:50:15,173] tx:
<ack id="1479271147-6" type="retry" class="receipt" participant="***********@s.whatsapp.net" to="***********-1474078490@g.us">
</ack>

_layer.py_      [DEBUG][2016-11-16 10:50:15,275] rx:
<receipt type="retry" id="1479271147-6" from="***********-1474078490@g.us" t="1479293415" participant="***********@s.whatsapp.net">
<retry id="1479271147-6" t="1479271150" v="1" count="1">
</retry>
<registration>
l~T
HEX3:b'6c7e5406'
</registration>
</receipt>

_layer_send.py_ [DEBUG][2016-11-16 10:50:15,276] Axolotl layer does not have the message, bubbling it upwards
_layer.py_      [DEBUG][2016-11-16 10:50:15,276] tx:
<ack id="1479271147-6" type="retry" class="receipt" participant="***********@s.whatsapp.net" to="***********-1474078490@g.us">
</ack>

_layer.py_      [DEBUG][2016-11-16 10:50:15,398] rx:
<receipt type="retry" id="1479271147-6" from="***********-1474078490@g.us" t="1479293415" participant="***********@s.whatsapp.net">
<retry id="1479271147-6" t="1479271150" v="1" count="1">
</retry>
<registration>
l~T
HEX3:b'6c7e5406'
</registration>
</receipt>

_layer_send.py_ [DEBUG][2016-11-16 10:50:15,399] Axolotl layer does not have the message, bubbling it upwards
_layer.py_      [DEBUG][2016-11-16 10:50:15,399] tx:
<ack id="1479271147-6" type="retry" class="receipt" participant="***********@s.whatsapp.net" to="***********-1474078490@g.us">
</ack>

_layer.py_      [DEBUG][2016-11-16 10:50:16,478] rx:
<receipt id="1479271147-6" participant="***********@s.whatsapp.net" from="***********-1474078490@g.us" t="1479293416">
</receipt>

_layer_send.py_ [DEBUG][2016-11-16 10:50:16,478] Axolotl layer does not have the message, bubbling it upwards
_layer.py_      [DEBUG][2016-11-16 10:50:16,478] tx:
<ack id="1479271147-6" to="***********-1474078490@g.us" class="receipt" participant="***********@s.whatsapp.net">
</ack>

_layer.py_      [DEBUG][2016-11-16 10:50:16,485] rx:
<receipt id="1479271147-6" participant="***********@s.whatsapp.net" from="***********-1474078490@g.us" t="1479293416">
</receipt>

_layer_send.py_ [DEBUG][2016-11-16 10:50:16,485] Axolotl layer does not have the message, bubbling it upwards
_layer.py_      [DEBUG][2016-11-16 10:50:16,485] tx:
<ack id="1479271147-6" to="***********-1474078490@g.us" class="receipt" participant="***********@s.whatsapp.net">
</ack>

_layer.py_      [DEBUG][2016-11-16 10:50:16,622] rx:
<receipt id="1479271147-6" participant="***********@s.whatsapp.net" from="***********-1474078490@g.us" t="1479293416">
</receipt>

_layer_send.py_ [DEBUG][2016-11-16 10:50:16,622] Axolotl layer does not have the message, bubbling it upwards
_layer.py_      [DEBUG][2016-11-16 10:50:16,622] tx:
<ack id="1479271147-6" to="***********-1474078490@g.us" class="receipt" participant="***********@s.whatsapp.net">
</ack>

_layer.py_      [DEBUG][2016-11-16 10:50:16,624] rx:
<receipt type="retry" id="1479271147-6" from="***********-1474078490@g.us" t="1479293416" participant="***********@s.whatsapp.net">
<retry id="1479271147-6" t="1479271150" v="1" count="1">
</retry>
<registration>
l~T
HEX3:b'6c7e5406'
</registration>
</receipt>

_layer_send.py_ [DEBUG][2016-11-16 10:50:16,624] Axolotl layer does not have the message, bubbling it upwards
_layer.py_      [DEBUG][2016-11-16 10:50:16,624] tx:
<ack id="1479271147-6" type="retry" class="receipt" participant="***********@s.whatsapp.net" to="***********-1474078490@g.us">
</ack>

_layer.py_      [DEBUG][2016-11-16 10:50:16,735] rx:
<receipt id="1479271147-6" participant="***********@s.whatsapp.net" from="***********-1474078490@g.us" t="1479293416">
</receipt>

_layer_send.py_ [DEBUG][2016-11-16 10:50:16,735] Axolotl layer does not have the message, bubbling it upwards
_layer.py_      [DEBUG][2016-11-16 10:50:16,736] tx:
<ack id="1479271147-6" to="***********-1474078490@g.us" class="receipt" participant="***********@s.whatsapp.net">
</ack>

_layer.py_      [DEBUG][2016-11-16 10:50:16,900] rx:
<receipt id="1479271147-6" participant="***********@s.whatsapp.net" from="***********-1474078490@g.us" t="1479293416">
</receipt>

_layer_send.py_ [DEBUG][2016-11-16 10:50:16,901] Axolotl layer does not have the message, bubbling it upwards
_layer.py_      [DEBUG][2016-11-16 10:50:16,901] tx:
<ack id="1479271147-6" to="***********-1474078490@g.us" class="receipt" participant="***********@s.whatsapp.net">
</ack>

_layer.py_      [DEBUG][2016-11-16 10:50:17,169] rx:
<receipt type="retry" id="1479271147-6" from="***********-1474078490@g.us" t="1479293417" participant="***********@s.whatsapp.net">
<retry id="1479271147-6" t="1479271151" v="1" count="1">
</retry>
<registration>
l~T
HEX3:b'6c7e5406'
</registration>
</receipt>

_layer_send.py_ [DEBUG][2016-11-16 10:50:17,170] Axolotl layer does not have the message, bubbling it upwards
_layer.py_      [DEBUG][2016-11-16 10:50:17,170] tx:
<ack id="1479271147-6" type="retry" class="receipt" participant="***********@s.whatsapp.net" to="***********-1474078490@g.us">
</ack>

_layer.py_      [DEBUG][2016-11-16 10:50:17,171] rx:
<stream:error>
<ack id="F4E04618E3758B8C00C5EA5315AB5F">
</ack>
</stream:error>

_interface.py_  [ERROR][2016-11-16 10:50:17,171] Stream Error type: ack
{'ack': None}

_interface.py_  [INFO][2016-11-16 10:50:17,172] Initiating reconnect
_layer.py_      [DEBUG][2016-11-16 10:50:17,172] stopping ping thread
_layer.py_      [DEBUG][2016-11-16 10:50:17,172] Disconnected, reason: Requested
_interface.py_  [ERROR][2016-11-16 10:50:17,172] Stream Error type: ack
{'ack': None}

_interface.py_  [INFO][2016-11-16 10:50:17,172] Initiating reconnect
_layer.py_      [DEBUG][2016-11-16 10:50:17,173] Disconnected, reason: Requested
_layer.py_      [DEBUG][2016-11-16 10:50:17,674] Connecting to e1.whatsapp.net:443
_layer.py_      [DEBUG][2016-11-16 10:50:17,726] Connecting to e1.whatsapp.net:443
_server.py_     [ERROR][2016-11-16 10:50:17,727] Unexpected Exception: [Errno 9] Bad file descriptor
Traceback (most recent call last):
  File "server.py", line 36, in start
    self.stack.loop(timeout=0.5, discrete=0.5)
  File "/usr/local/lib/python3.5/dist-packages/yowsup/stacks/yowstack.py", line 188, in loop
    asyncore.loop(*args, **kwargs)
  File "/usr/lib/python3.5/asyncore.py", line 203, in loop
    poll_fun(timeout, map)
  File "/usr/lib/python3.5/asyncore.py", line 144, in poll
    r, w, e = select.select(r, w, e, timeout)
OSError: [Errno 9] Bad file descriptor
kyle@techs:~/fwa$
@jlguardi I've sent message delivered ack on every message, perhaps it's media or notification?

_layer.py_      [DEBUG][2016-11-16 10:50:14,627] rx:
<receipt type="retry" id="1479271147-6" from="***********-1474078490@g.us" t="1479293414" participant="***********@s.whatsapp.net">
<retry id="1479271147-6" t="1479271149" v="1" count="1">
</retry>
<registration>
l~T
HEX3:b'6c7e5406'
</registration>
</receipt>

_layer_send.py_ [DEBUG][2016-11-16 10:50:14,627] Axolotl layer does not have the message, bubbling it upwards
_layer.py_      [DEBUG][2016-11-16 10:50:14,628] tx:
<ack id="1479271147-6" type="retry" class="receipt" participant="***********@s.whatsapp.net" to="***********-1474078490@g.us">
</ack>

_layer.py_      [DEBUG][2016-11-16 10:50:14,952] rx:
<receipt type="retry" id="1479271147-6" from="***********-1474078490@g.us" t="1479293414" participant="***********@s.whatsapp.net">
<retry id="1479271147-6" t="1479271149" v="1" count="1">
</retry>
<registration>
l~T
HEX3:b'6c7e5406'
</registration>
</receipt>

_layer_send.py_ [DEBUG][2016-11-16 10:50:14,952] Axolotl layer does not have the message, bubbling it upwards
_layer.py_      [DEBUG][2016-11-16 10:50:14,952] tx:
<ack id="1479271147-6" type="retry" class="receipt" participant="***********@s.whatsapp.net" to="***********-1474078490@g.us">
</ack>

_layer.py_      [DEBUG][2016-11-16 10:50:14,953] rx:
<receipt type="retry" id="1479271147-6" from="***********-1474078490@g.us" t="1479293414" participant="***********@s.whatsapp.net">
<retry id="1479271147-6" t="1479271149" v="1" count="1">
</retry>
<registration>
l~T
HEX3:b'6c7e5406'
</registration>
</receipt>

_layer_send.py_ [DEBUG][2016-11-16 10:50:14,954] Axolotl layer does not have the message, bubbling it upwards
_layer.py_      [DEBUG][2016-11-16 10:50:14,954] tx:
<ack id="1479271147-6" type="retry" class="receipt" participant="***********@s.whatsapp.net" to="***********-1474078490@g.us">
</ack>

_layer.py_      [DEBUG][2016-11-16 10:50:15,043] rx:
<receipt type="retry" id="1479271147-6" from="***********-1474078490@g.us" t="1479293415" participant="***********@s.whatsapp.net">
<retry id="1479271147-6" t="1479271149" v="1" count="1">
</retry>
<registration>
l~T
HEX3:b'6c7e5406'
</registration>
</receipt>

_layer_send.py_ [DEBUG][2016-11-16 10:50:15,043] Axolotl layer does not have the message, bubbling it upwards
_layer.py_      [DEBUG][2016-11-16 10:50:15,044] tx:
<ack id="1479271147-6" type="retry" class="receipt" participant="***********@s.whatsapp.net" to="***********-1474078490@g.us">
</ack>

_layer.py_      [DEBUG][2016-11-16 10:50:15,172] rx:
<receipt type="retry" id="1479271147-6" from="***********-1474078490@g.us" t="1479293415" participant="***********@s.whatsapp.net">
<retry id="1479271147-6" t="1479271149" v="1" count="1">
</retry>
<registration>
l~T
HEX3:b'6c7e5406'
</registration>
</receipt>

_layer_send.py_ [DEBUG][2016-11-16 10:50:15,172] Axolotl layer does not have the message, bubbling it upwards
_layer.py_      [DEBUG][2016-11-16 10:50:15,173] tx:
<ack id="1479271147-6" type="retry" class="receipt" participant="***********@s.whatsapp.net" to="***********-1474078490@g.us">
</ack>

_layer.py_      [DEBUG][2016-11-16 10:50:15,275] rx:
<receipt type="retry" id="1479271147-6" from="***********-1474078490@g.us" t="1479293415" participant="***********@s.whatsapp.net">
<retry id="1479271147-6" t="1479271150" v="1" count="1">
</retry>
<registration>
l~T
HEX3:b'6c7e5406'
</registration>
</receipt>

_layer_send.py_ [DEBUG][2016-11-16 10:50:15,276] Axolotl layer does not have the message, bubbling it upwards
_layer.py_      [DEBUG][2016-11-16 10:50:15,276] tx:
<ack id="1479271147-6" type="retry" class="receipt" participant="***********@s.whatsapp.net" to="***********-1474078490@g.us">
</ack>

_layer.py_      [DEBUG][2016-11-16 10:50:15,398] rx:
<receipt type="retry" id="1479271147-6" from="***********-1474078490@g.us" t="1479293415" participant="***********@s.whatsapp.net">
<retry id="1479271147-6" t="1479271150" v="1" count="1">
</retry>
<registration>
l~T
HEX3:b'6c7e5406'
</registration>
</receipt>

_layer_send.py_ [DEBUG][2016-11-16 10:50:15,399] Axolotl layer does not have the message, bubbling it upwards
_layer.py_      [DEBUG][2016-11-16 10:50:15,399] tx:
<ack id="1479271147-6" type="retry" class="receipt" participant="***********@s.whatsapp.net" to="***********-1474078490@g.us">
</ack>

_layer.py_      [DEBUG][2016-11-16 10:50:16,478] rx:
<receipt id="1479271147-6" participant="***********@s.whatsapp.net" from="***********-1474078490@g.us" t="1479293416">
</receipt>

_layer_send.py_ [DEBUG][2016-11-16 10:50:16,478] Axolotl layer does not have the message, bubbling it upwards
_layer.py_      [DEBUG][2016-11-16 10:50:16,478] tx:
<ack id="1479271147-6" to="***********-1474078490@g.us" class="receipt" participant="***********@s.whatsapp.net">
</ack>

_layer.py_      [DEBUG][2016-11-16 10:50:16,485] rx:
<receipt id="1479271147-6" participant="***********@s.whatsapp.net" from="***********-1474078490@g.us" t="1479293416">
</receipt>

_layer_send.py_ [DEBUG][2016-11-16 10:50:16,485] Axolotl layer does not have the message, bubbling it upwards
_layer.py_      [DEBUG][2016-11-16 10:50:16,485] tx:
<ack id="1479271147-6" to="***********-1474078490@g.us" class="receipt" participant="***********@s.whatsapp.net">
</ack>

_layer.py_      [DEBUG][2016-11-16 10:50:16,622] rx:
<receipt id="1479271147-6" participant="***********@s.whatsapp.net" from="***********-1474078490@g.us" t="1479293416">
</receipt>

_layer_send.py_ [DEBUG][2016-11-16 10:50:16,622] Axolotl layer does not have the message, bubbling it upwards
_layer.py_      [DEBUG][2016-11-16 10:50:16,622] tx:
<ack id="1479271147-6" to="***********-1474078490@g.us" class="receipt" participant="***********@s.whatsapp.net">
</ack>

_layer.py_      [DEBUG][2016-11-16 10:50:16,624] rx:
<receipt type="retry" id="1479271147-6" from="***********-1474078490@g.us" t="1479293416" participant="***********@s.whatsapp.net">
<retry id="1479271147-6" t="1479271150" v="1" count="1">
</retry>
<registration>
l~T
HEX3:b'6c7e5406'
</registration>
</receipt>

_layer_send.py_ [DEBUG][2016-11-16 10:50:16,624] Axolotl layer does not have the message, bubbling it upwards
_layer.py_      [DEBUG][2016-11-16 10:50:16,624] tx:
<ack id="1479271147-6" type="retry" class="receipt" participant="***********@s.whatsapp.net" to="***********-1474078490@g.us">
</ack>

_layer.py_      [DEBUG][2016-11-16 10:50:16,735] rx:
<receipt id="1479271147-6" participant="***********@s.whatsapp.net" from="***********-1474078490@g.us" t="1479293416">
</receipt>

_layer_send.py_ [DEBUG][2016-11-16 10:50:16,735] Axolotl layer does not have the message, bubbling it upwards
_layer.py_      [DEBUG][2016-11-16 10:50:16,736] tx:
<ack id="1479271147-6" to="***********-1474078490@g.us" class="receipt" participant="***********@s.whatsapp.net">
</ack>

_layer.py_      [DEBUG][2016-11-16 10:50:16,900] rx:
<receipt id="1479271147-6" participant="***********@s.whatsapp.net" from="***********-1474078490@g.us" t="1479293416">
</receipt>

_layer_send.py_ [DEBUG][2016-11-16 10:50:16,901] Axolotl layer does not have the message, bubbling it upwards
_layer.py_      [DEBUG][2016-11-16 10:50:16,901] tx:
<ack id="1479271147-6" to="***********-1474078490@g.us" class="receipt" participant="***********@s.whatsapp.net">
</ack>

_layer.py_      [DEBUG][2016-11-16 10:50:17,169] rx:
<receipt type="retry" id="1479271147-6" from="***********-1474078490@g.us" t="1479293417" participant="***********@s.whatsapp.net">
<retry id="1479271147-6" t="1479271151" v="1" count="1">
</retry>
<registration>
l~T
HEX3:b'6c7e5406'
</registration>
</receipt>

_layer_send.py_ [DEBUG][2016-11-16 10:50:17,170] Axolotl layer does not have the message, bubbling it upwards
_layer.py_      [DEBUG][2016-11-16 10:50:17,170] tx:
<ack id="1479271147-6" type="retry" class="receipt" participant="***********@s.whatsapp.net" to="***********-1474078490@g.us">
</ack>

_layer.py_      [DEBUG][2016-11-16 10:50:17,171] rx:
<stream:error>
<ack id="F4E04618E3758B8C00C5EA5315AB5F">
</ack>
</stream:error>

_interface.py_  [ERROR][2016-11-16 10:50:17,171] Stream Error type: ack
{'ack': None}

_interface.py_  [INFO][2016-11-16 10:50:17,172] Initiating reconnect
_layer.py_      [DEBUG][2016-11-16 10:50:17,172] stopping ping thread
_layer.py_      [DEBUG][2016-11-16 10:50:17,172] Disconnected, reason: Requested
_interface.py_  [ERROR][2016-11-16 10:50:17,172] Stream Error type: ack
{'ack': None}

_interface.py_  [INFO][2016-11-16 10:50:17,172] Initiating reconnect
_layer.py_      [DEBUG][2016-11-16 10:50:17,173] Disconnected, reason: Requested
_layer.py_      [DEBUG][2016-11-16 10:50:17,674] Connecting to e1.whatsapp.net:443
_layer.py_      [DEBUG][2016-11-16 10:50:17,726] Connecting to e1.whatsapp.net:443
_server.py_     [ERROR][2016-11-16 10:50:17,727] Unexpected Exception: [Errno 9] Bad file descriptor
Traceback (most recent call last):
  File "server.py", line 36, in start
    self.stack.loop(timeout=0.5, discrete=0.5)
  File "/usr/local/lib/python3.5/dist-packages/yowsup/stacks/yowstack.py", line 188, in loop
    asyncore.loop(*args, **kwargs)
  File "/usr/lib/python3.5/asyncore.py", line 203, in loop
    poll_fun(timeout, map)
  File "/usr/lib/python3.5/asyncore.py", line 144, in poll
    r, w, e = select.select(r, w, e, timeout)
OSError: [Errno 9] Bad file descriptor
kyle@techs:~/fwa$

@jlguardi
Copy link
Collaborator

Search in the full log a message with id F4E04618E3758B8C00C5EA5315AB5F and manage it correctly.

@decieved
Copy link

@jlguardi
I've found the issue lol, I was having stream errors because I have two classes in different files with YowInterfaceLayer, The first file had self.toLower(message.ack()) while the other only had self.toLower(message.ack(True)) I'm not sure why I need to send recieve ticks in both classes which does basically the same thing?

Example:

#router.py

class Router(YowInterfaceLayer):

    @ProtocolEntityCallback("message")
    def onMessage(self, message):
        self.toLower(message.ack())
# commands.py

class Commands(YowInterfaceLayer):

    @ProtocolEntityCallback("message")
    def onMessage(self, message):
        self.toLower(message.ack())

Do I really need to send receive ticks twice in both classes? or I shouldn't have more than 1 message callbacks?

@decieved
Copy link

decieved commented Nov 16, 2016

@jlguardi

_layer_receive.py_      [WARNING][2016-11-16 18:31:18,239] Received a message that we've previously decrypted, goint to send the delivery receipt myself
(GROUP)[************@s.whatsapp.net]-[*************-1474078490@g.us]       Sigh😪
_sessioncipher.py_      [WARNING][2016-11-16 18:32:10,824] 'utf-8' codec can't decode byte 0xe4 in position 35: invalid continuation byte
_layer_receive.py_      [WARNING][2016-11-16 18:32:10,828] InvalidMessage or KeyId for 18763715152, going to send a retry
_sessioncipher.py_      [WARNING][2016-11-16 18:32:11,259] 'utf-8' codec can't decode byte 0xe4 in position 35: invalid continuation byte

That happen when I try to reply to messages in the group using the reply function, then crashes for the stream error due to yowsup not being able to send to blue ticks to those messages..

Received a message that we've previously decrypted, goint to send the delivery receipt myself

And when I try to reconnect, blue ticks sent after

@jlguardi
Copy link
Collaborator

Reply function? I don't remember that function but forward one. Anyway here you have an issue due to emoji and terminal (I remember I made a fix for that but I don't remember if it is applied to master) and a warning raised by axolotl layer. But the secon one is just a warning due to repeated messages from other yowsup client.

@decieved
Copy link

@jlguardi Do you still use yowsup?

@jlguardi
Copy link
Collaborator

@kyleJR Yes, I do.

@decieved
Copy link

decieved commented Nov 21, 2016

@jlguardi

Reply function? I don't remember that function but forward one. Anyway here you have an issue due to emoji and terminal (I remember I made a fix for that but I don't remember if it is applied to master) and a warning raised by axolotl layer. But the secon one is just a warning due to repeated messages from other yowsup client.

Yes, whenever someone reply (new whatsapp feature) to a text, the bot gets this error

_layer_receive.py_      [WARNING][2016-11-21 23:49:19,714] InvalidMessage or KeyId for ***********, going to send a retry
_sessioncipher.py_      [WARNING][2016-11-21 23:49:21,315] 'utf-8' codec can't decode byte 0x8a in position 37: invalid start byte

By reply function, i meant clicking on a message and quoting it, the new whatsapp feature
Due to this error, the bot failed to send a delivered tick then stream error ack, and disconnects

Debug log

_layer.py_      [DEBUG][2016-11-22 00:01:58,570] rx:
<message type="text" notify="� Her Crush ��" from="<bot-number>-*********@g.us" t="1479772918" id="F4A44182D1A3AC6B51BE396B731245" participant="<my-number>@s.whatsapp.net">
<enc type="skmsg" v="2">
�±� �X�}v£%öé(�SÌÝ .M3 ¤;S�Diâkk�e�\­�«)�¦b¯Ïµ3ra¿ûøj�·uÓá¦ÆtzØ«fÃ�BiÅqÄ!Z`W�\Ì·�N�Ç

HEX3:b'33088ab18e8c0310081a20825807947d76a325f6e91c289f700853ccdd1e202e4d3320a43b538e446912e26b046b1f9f65875cad88ab298fa662afcfb5337261bffbf86a85b775d3e1a6c6fe0874027ad8ab66c39e4269c571c4211d5a601c579d5c0205ccb7994e88c70b'
</enc>
</message>

(GROUP)[<my-number>@s.whatsapp.net]-[<bot-number>-*********@g.us]     Test
_layer.py_      [DEBUG][2016-11-22 00:01:58,577] tx:
<receipt to="<bot-number>-*********@g.us" participant="<my-number>@s.whatsapp.net" id="F4A44182D1A3AC6B51BE396B731245">
</receipt>

xterm_layer.py_ [DEBUG][2016-11-22 00:02:07,322] rx:
<message type="text" notify="� Her Crush ��" from="<bot-number>-*********@g.us" t="1479772927" id="8E8D529BEE200F49C11B4508F79283" participant="<my-number>@s.whatsapp.net">
<enc type="skmsg" v="2">
�±��    pNÁ�#Är!Î;Æ|ܪájD:4U�M���ÅîB�BïÒâ��^Ø 2öÑí`åªkØê-¦á
                                                           y�
¤nbÐ#¦",#ú«èo��£H«�'¤Íê{DYý6­þb.p[çóS´êhzi�Ö��X%ú�å¶Í�ü!º�Èÿ�ÜìÜô�«q�
HEX3:b'33088ab18e8c0310091a704ec19023c472500821ce3bc67cdcaaba7f12e11d6a443a3455864d9610838bc5ee428742efd2e21f029f9c5ed82032f6d1ed60e5aa6bd8ea2d0fa6e10b0079950af87d80dd3853ceb1619d33b4e3aee986808441db43c83d86f5cd46cb45a0cd301981100da46e62d023a6222c052310faabe86f8486a348ab8927a4cdea7b4459fd360eadfe622e705be7f353b4ea687a698dd68786581a25fa8de5b6cd82fc21ba1085c8ff97dcecdcf484ab718e04'
</enc>
</message>

_layer_receive.py_      [WARNING][2016-11-22 00:02:07,324] InvalidMessage or KeyId for <my-number>, going to send a retry
_layer.py_      [DEBUG][2016-11-22 00:02:07,325] tx:
<receipt to="<bot-number>-*********@g.us" type="retry" participant="<my-number>@s.whatsapp.net" id="8E8D529BEE200F49C11B4508F79283">
<retry v="1" t="1479772927" count="1" id="8E8D529BEE200F49C11B4508F79283">
</retry>
<registration>
b'\xfa\xd0\x83G'
HEX:b'fad08347'
</registration>
</receipt>

_layer.py_      [DEBUG][2016-11-22 00:02:07,358] rx:
<ack class="receipt" type="retry" from="<bot-number>-*********@g.us" participant="<my-number>@s.whatsapp.net" id="8E8D529BEE200F49C11B4508F79283">
</ack>

xterm_layer.py_ [DEBUG][2016-11-22 00:02:09,508] rx:
<message type="text" notify="� Her Crush ��" from="<bot-number>-*********@g.us" t="1479772929" id="8E8D529BEE200F49C11B4508F79283" participant="<my-number>@s.whatsapp.net">
<enc type="msg" v="2" count="1">
3
!9;ýò�r£Þ0E�h²uÇ Ú)CZwÒ®ºnµ¿�H~"àà<Èæû#P{®ÛXS��Ü~c��ê?ÎPF-¹C³�6É�á@^�ýE�Ñ ï¥�é��ÈLY&Sx)ÛÓ�¥Ä$Þ�Ðp�óyoíàêÞÐOÄx(úd��·VÒ§W#ZZ�³è�d+î{�F>èM6ÅöèjÐ:"àma Òã�mîm£`dêÈ%X©
2����kæ�ºÒàÇW�La����^e_Ï'ßÍ·XÃYø+³§R¥ð▒N�ã '°ì��¸âÐ#óõXú�0}Ìïúê¾8�Æ
HEX3:b'330a2105393bfdf29a72a3de3045936815b275c71ca0da29435a77d2aeba6eb5bf89487e1003180022e001e03cc8e6fb23507baedb58530f899615dc7e638492ea3fce1550462db943b38b36c9018ae1405e8efd458fd120efa588e99e8a1cc84c5926537829dbd38ba506c424de9d7f159bd0700582f3796fede0eaded04fc47828fa64929db756d2a75702235a5a9bb3e89c642bee7b9415463e07e84d1236c5f6e86ad03a22e06d6120d2e389196d1aee6da36064eac82558a90a0132978d878c6be607870fba7708d2e005c71c57974c618796969a95177f5e655fcf27dfcd0fb758c31759f82b6c7fb3a70052a5f01b884e89e3a02714b0ec9888b8e2d023f306f558fa9e307dcceffaeabe020f3887c6'
</enc>
</message>

_sessioncipher.py_      [WARNING][2016-11-22 00:02:09,514] 'utf-8' codec can't decode byte 0x8a in position 37: invalid start byte

@decieved
Copy link

Found a way to handle that, by sending the receipt tick regardless of message being handled or not and temporarily fixed it..

The way yowsup handles messages and media right now is really messed up.. I'm now ignoring media type messages and specific replies to certain texts until I'm done with the basics.

@yssoe
Copy link

yssoe commented Dec 7, 2016

Hi @kyleJR @Martmists
when does this fix will be merged into the master?

@Martmists-GH
Copy link

@yssoe the one you see by me is just me in a completely different repo, I'm just referencing this issue so they know why I made that change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants