tgalal / yowsup

The WhatsApp lib
GNU General Public License v3.0
7.08k stars 2.23k forks source link

TypeError: __new__() got an unexpected keyword argument 'serialized_options' #2694

Closed DennisGaida closed 5 years ago

DennisGaida commented 5 years ago
yowsup-cli v3.0.0 
Using yowsup v3.1.0

(in your README.md you state we are on yowsup-cli version: 3.1.0 - this is not in the code: __version__ = "3.0.0")

I set up yowsup anew. Registration worked. A config file was created. I'm now trying to send a first test message but get the following exception:

D 2019-04-26 19:42:29,520 yowsup.config.manager - Detecting config for username=<number>, dir=/opt/.config/yowsup/<number>/
D 2019-04-26 19:42:29,520 yowsup.config.manager - Trying /opt/.config/yowsup/<number>/config.json
D 2019-04-26 19:42:29,521 yowsup.config.manager - load_path(path=/opt/.config/yowsup/<number>/config.json)
D 2019-04-26 19:42:29,521 yowsup.config.manager - Detected config type: json
D 2019-04-26 19:42:29,521 yowsup.config.manager - Opening config for reading
D 2019-04-26 19:42:29,522 yowsup.config.manager - Loading config
Traceback (most recent call last):
  File "/opt/yowsup/yowsup-cli", line 547, in <module>
    if not parser.process():
  File "/opt/yowsup/yowsup-cli", line 454, in process
    self.startSendClient()
  File "/opt/yowsup/yowsup-cli", line 491, in startSendClient
    from yowsup.demos import sendclient
  File "/opt/yowsup/yowsup/demos/sendclient/__init__.py", line 1, in <module>
    from .stack import YowsupSendStack
  File "/opt/yowsup/yowsup/demos/sendclient/stack.py", line 1, in <module>
    from yowsup.stacks import  YowStackBuilder
  File "/opt/yowsup/yowsup/stacks/__init__.py", line 1, in <module>
    from .yowstack import YowStack, YowStackBuilder
  File "/opt/yowsup/yowsup/stacks/yowstack.py", line 4, in <module>
    from yowsup.layers.noise.layer import YowNoiseLayer
  File "/opt/yowsup/yowsup/layers/noise/layer.py", line 1, in <module>
    from yowsup.layers.noise.workers.handshake import WANoiseProtocolHandshakeWorker
  File "/opt/yowsup/yowsup/layers/noise/workers/handshake.py", line 1, in <module>
    from consonance.protocol import WANoiseProtocol
  File "/usr/local/lib/python2.7/dist-packages/consonance/protocol.py", line 2, in <module>
    from .handshake import WAHandshake
  File "/usr/local/lib/python2.7/dist-packages/consonance/handshake.py", line 20, in <module>
    from .proto import wa20_pb2
  File "/usr/local/lib/python2.7/dist-packages/consonance/proto/wa20_pb2.py", line 22, in <module>
    XT_1\x10\x01\x12\t\n\x05\x45XT_2\x10\x02\"\xea\x02\n\x10HandshakeMessage\x12\x33\n\x0c\x63lient_hello\x18\x02 \x01(\x0b\x32\x1d.HandshakeMessage.ClientHello\x12\x33\n\x0cserver_hello\x18\x03 \x01(\x0b\x32\x1d.HandshakeMessage.ServerHello\x12\x35\n\rclient_finish\x18\x04 \x01(\x0b\x32\x1e.HandshakeMessage.ClientFinish\x1a\x41\n\x0b\x43lientHello\x12\x11\n\tephemeral\x18\x01 \x01(\x0c\x12\x0e\n\x06static\x18\x02 \x01(\x0c\x12\x0f\n\x07payload\x18\x03 \x01(\x0c\x1a\x41\n\x0bServerHello\x12\x11\n\tephemeral\x18\x01 \x01(\x0c\x12\x0e\n\x06static\x18\x02 \x01(\x0c\x12\x0f\n\x07payload\x18\x03 \x01(\x0c\x1a/\n\x0c\x43lientFinish\x12\x0e\n\x06static\x18\x01 \x01(\x0c\x12\x0f\n\x07payload\x18\x02 \x01(\x0c\"\x90\x01\n\x10NoiseCertificate\x12\x0f\n\x07\x64\x65tails\x18\x01 \x01(\x0c\x12\x11\n\tsignature\x18\x02 \x01(\x0c\x1aX\n\x07\x44\x65tails\x12\x0e\n\x06serial\x18\x01 \x01(\r\x12\x0e\n\x06issuer\x18\x02 \x01(\t\x12\x0f\n\x07\x65xpires\x18\x03 \x01(\x04\x12\x0f\n\x07subject\x18\x04 \x01(\t\x12\x0b\n\x03key\x18\x05 \x01(\x0c')
TypeError: __new__() got an unexpected keyword argument 'serialized_options'

The config.json looks like the following (anonymized of course):

{
    "__version__": 1,
    "cc": "<cc>",
    "client_static_keypair": "<keypair>",
    "edge_routing_info": "<routinginfo>",
    "expid": "<expid>",
    "fdid": "<fdid>",
    "id": "<id>",
    "mcc": "000",
    "mnc": "000",
    "phone": "<phone>",
    "sim_mcc": "000",
    "sim_mnc": "000"
}
tgalal commented 5 years ago

can you tell which python2 protobuf version do you have? This might be the reason

DennisGaida commented 5 years ago
Name: protobuf
Version: 3.0.0
tgalal commented 5 years ago

can you please upgrade protobuf to a newer version and post the result?

DennisGaida commented 5 years ago

Updated to Version 3.7.1 and it is working now! Great work, man! Maybe add a dependency on the protobuf version?

tgalal commented 5 years ago

I will, thanks for the help!