tgalal / yowsup

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

Version 3.1.0: Error with command line client #2688

Closed jowiemann closed 5 years ago

jowiemann commented 5 years ago

I 2019-04-25 13:20:16,001 yowsup.layers.network.layer - Connecting to e9.whatsapp.net:443 I 2019-04-25 13:20:23,508 yowsup.axolotl.manager - Loaded 812 unsent prekeys Exception in thread Thread-5: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner self.run() File "/usr/local/lib/python2.7/dist-packages/yowsup-3.1.0-py2.7.egg/yowsup/layers/noise/workers/handshake.py", line 36, in run self._protocol.start(self._stream, self._client_config, self._s, self._rs) File "/usr/local/lib/python2.7/dist-packages/consonance-0.1.1-py2.7.egg/consonance/protocol.py", line 82, in start result = handshake.perform(client_config, stream, s, rs) File "/usr/local/lib/python2.7/dist-packages/consonance-0.1.1-py2.7.egg/consonance/handshake.py", line 82, in perform cipherstatepair = self._switch_handshake_xxfallback(stream, dissononce_s, client_payload, ex.server_hello) File "/usr/local/lib/python2.7/dist-packages/consonance-0.1.1-py2.7.egg/consonance/handshake.py", line 221, in _switch_handshake_xxfallback self._handshakestate.read_message(server_hello.ephemeral + server_hello.static + server_hello.payload, payload_buffer) File "build/bdist.linux-armv6l/egg/dissononce/extras/processing/handshakestate_forwarder.py", line 19, in read_message return self._handshakestate.read_message(message, payload_buffer) File "build/bdist.linux-armv6l/egg/dissononce/extras/processing/handshakestate_guarded.py", line 110, in read_message result = self._handshakestate.read_message(message, payload_buffer) File "build/bdist.linux-armv6l/egg/dissononce/processing/impl/handshakestate.py", line 227, in read_message self._rs = self._dh.create_public(self._symmetricstate.decrypt_and_hash(temp)) File "build/bdist.linux-armv6l/egg/dissononce/processing/impl/symmetricstate.py", line 133, in decrypt_and_hash plaintext = self._cipherstate.decrypt_with_ad(self._h, ciphertext) File "build/bdist.linux-armv6l/egg/dissononce/processing/impl/cipherstate.py", line 73, in decrypt_with_ad result = self._cipher.decrypt(self._key, self._nonce, ad, ciphertext) File "build/bdist.linux-armv6l/egg/dissononce/cipher/aesgcm.py", line 20, in decrypt raise DecryptFailedException(reason=DecryptFailedException.REASON_INVALID_TAG) DecryptFailedException

general: Disconnected: offline:

tuliosciotta commented 5 years ago

Same issue here.

EDIT.... It worked using -E android.

yowsup-cli demos --yowsup --config config.conf -E android

And /L works like a charm.

bitnator commented 5 years ago

@tuliosciotta I can send the sms code and I can register but when I run the demos I get the errors bellow:

yowsup-cli demos --yowsup --config ~/.config/yowsup/55051XXXXXXXXX/config.json yowsup-cli v3.0.0 yowsup v3.1.0

Copyright (c) 2012-2019 Tarek Galal http://www.openwhatsapp.org

This software is provided free of charge. Copying and redistribution is encouraged.

If you appreciate this software and you would like to support future development please consider donating: http://openwhatsapp.org/yowsup/donate

Yowsup Cli client

Type /help for available commands

I 2019-04-28 19:10:44,836 yowsup.layers.network.layer - Connecting to e9.whatsapp.net:443 I 2019-04-28 19:10:45,128 yowsup.axolotl.manager - Loaded 812 unsent prekeys general: Login Failed, reason: 401 E 2019-04-28 19:10:47,685 yowsup.layers.network.dispatcher.dispatcher_socket - [Errno 9] Bad file descriptor general: Disconnected: offline: offline:

I have following the old suggestions in the past issues but here is the same problem. I think that is some kind of blocking but I can register again. Looking to your solution I think there is details on the readme tutorials that are not explained. For example, Do I need the android apk on my yowsup folder?

ignertic commented 5 years ago

@tuliosciotta hey is that the only thing you changed, im still having the issue

`os --yowsup --config config.json -E android yowsup-cli v3.0.0 yowsup v3.1.0

Copyright (c) 2012-2019 Tarek Galal http://www.openwhatsapp.org

This software is provided free of charge. Copying and redistribution is encouraged.

If you appreciate this software and you would like to support future development please consider donating: http://openwhatsapp.org/yowsup/donate

Yowsup Cli client

Type /help for available commands

I 2019-05-03 15:42:58,343 yowsup.layers.network.layer - Connecting to e11.whatsapp.net:443 I 2019-05-03 15:42:59,635 yowsup.axolotl.manager - Generating 812 prekeys I 2019-05-03 15:42:59,965 yowsup.axolotl.manager - Storing 812 prekeys I 2019-05-03 15:44:29,703 yowsup.axolotl.manager - Loaded 812 unsent prekeys general: Disconnected: offline:

I 2019-05-03 15:44:37,372 yowsup.layers.network.layer - Connecting to e11.whatsapp.net:443 I 2019-05-03 15:44:37,683 yowsup.axolotl.manager - Loaded 812 unsent prekeys Exception in thread Thread-3: Traceback (most recent call last): File "/home/supercode/.virtualenvs/chatbot/lib/python3.7/site-packages/consonance/handshake.py", line 80, in perform cipherstatepair = self._start_handshake_ik(stream, client_payload, dissononce_s, dissononce_rs) File "/home/supercode/.virtualenvs/chatbot/lib/python3.7/site-packages/consonance/handshake.py", line 190, in _start_handshake_ik raise NewRemoteStaticException(server_hello) consonance.exceptions.new_rsexception.NewRemoteStaticException: ephemeral: "\373\262\374\371i+\2006Q\247\234\2531\371\326\340\232\252\261\037\264B\003\211\265.w4\274\005\342\037" static: "F\230\000 \267~fLW.\202V?\357]\r$m\207\032\245\215\\377\177e\302dV\274\205\274\3445\343\331\375\216:/ b\300\"[,\366" payload: "\344g\027N\261z\344\201\321b\317w-!\036f^\340q\252\033\367\246^8\245\376\362\373\200%\325\304m2?\321P\010G\230V9\276\206\376\301\177\004\3263\374\246\310m\240\223p\313\345\3478\262\274v\203\321M\020\037\025gU\255\263\241 \314d\274l\\313\026x\216T\017\255XN~FN^\037\"Ko\016\335\310(\364\3546J\027\363\311F\276\353\"N\231{@\253M\372\201\027tz\207<\246(\277\341\243\311\272\256\224\326\307o7+\222HzGFk\035\256\350\005\311\'\334\352G\3437{\275R"

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/supercode/.virtualenvs/chatbot/lib/python3.7/site-packages/dissononce/cipher/aesgcm.py", line 18, in decrypt return AESGCM(key).decrypt(self.class._format_nonce(nonce), ciphertext, ad) File "/home/supercode/.virtualenvs/chatbot/lib/python3.7/site-packages/cryptography/hazmat/primitives/ciphers/aead.py", line 180, in decrypt backend, self, nonce, data, associated_data, 16 File "/home/supercode/.virtualenvs/chatbot/lib/python3.7/site-packages/cryptography/hazmat/backends/openssl/aead.py", line 159, in _decrypt raise InvalidTag cryptography.exceptions.InvalidTag

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner self.run() File "/home/supercode/.virtualenvs/chatbot/lib/python3.7/site-packages/yowsup/layers/noise/workers/handshake.py", line 36, in run self._protocol.start(self._stream, self._client_config, self._s, self._rs) File "/home/supercode/.virtualenvs/chatbot/lib/python3.7/site-packages/consonance/protocol.py", line 82, in start result = handshake.perform(client_config, stream, s, rs) File "/home/supercode/.virtualenvs/chatbot/lib/python3.7/site-packages/consonance/handshake.py", line 82, in perform cipherstatepair = self._switch_handshake_xxfallback(stream, dissononce_s, client_payload, ex.server_hello) File "/home/supercode/.virtualenvs/chatbot/lib/python3.7/site-packages/consonance/handshake.py", line 221, in _switch_handshake_xxfallback self._handshakestate.read_message(server_hello.ephemeral + server_hello.static + server_hello.payload, payload_buffer) File "/home/supercode/.virtualenvs/chatbot/lib/python3.7/site-packages/dissononce/extras/processing/handshakestate_forwarder.py", line 19, in read_message return self._handshakestate.read_message(message, payload_buffer) File "/home/supercode/.virtualenvs/chatbot/lib/python3.7/site-packages/dissononce/extras/processing/handshakestate_guarded.py", line 110, in read_message result = self._handshakestate.read_message(message, payload_buffer) File "/home/supercode/.virtualenvs/chatbot/lib/python3.7/site-packages/dissononce/processing/impl/handshakestate.py", line 227, in read_message self._rs = self._dh.create_public(self._symmetricstate.decrypt_and_hash(temp)) File "/home/supercode/.virtualenvs/chatbot/lib/python3.7/site-packages/dissononce/processing/impl/symmetricstate.py", line 133, in decrypt_and_hash plaintext = self._cipherstate.decrypt_with_ad(self._h, ciphertext) File "/home/supercode/.virtualenvs/chatbot/lib/python3.7/site-packages/dissononce/processing/impl/cipherstate.py", line 73, in decrypt_with_ad result = self._cipher.decrypt(self._key, self._nonce, ad, ciphertext) File "/home/supercode/.virtualenvs/chatbot/lib/python3.7/site-packages/dissononce/cipher/aesgcm.py", line 20, in decrypt raise DecryptFailedException(reason=DecryptFailedException.REASON_INVALID_TAG) dissononce.exceptions.decrypt.DecryptFailedException

general: Disconnected: offline: `

jowiemann commented 5 years ago

Seems to be fixed with 3.2.0

clown16 commented 4 years ago

help

Perform the yowsup installation and register my phone, but when sending a message via yowsup it throws the following error in debugging

yowsup-cli demos -c onfig.txt -s 57** "Probando WhatsApp ..." -d -E android /usr/local/lib/python2.7/site-packages/cryptography-3.0-py2.7-linux-x86_64.egg/cryptography/init.py:39: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release. CryptographyDeprecationWarning, D 2020-08-06 17:15:06,158 yowsup.env.env - Current env changed to android D 2020-08-06 17:15:06,159 yowsup.config.manager - load(path_or_profile_name=onfig.txt, profile_only=False) D 2020-08-06 17:15:06,159 yowsup.config.manager - _load_path(path=onfig.txt) D 2020-08-06 17:15:06,159 yowsup.config.manager - Trying auto detect config type by parsing D 2020-08-06 17:15:06,159 yowsup.config.manager - Trying to parse as keyval D 2020-08-06 17:15:06,159 yowsup.config.manager - onfig.txt was not parseable as keyval, reason: list index out of range D 2020-08-06 17:15:06,159 yowsup.config.manager - Trying to parse as json D 2020-08-06 17:15:06,159 yowsup.config.manager - Successfully detected json as config type for onfig.txt D 2020-08-06 17:15:06,159 yowsup.config.manager - Detected config type: json D 2020-08-06 17:15:06,159 yowsup.config.manager - Opening config for reading D 2020-08-06 17:15:06,160 yowsup.config.manager - Loading config D 2020-08-06 17:15:06,160 yowsup.config.manager - load(path_or_profile_name=57**, profile_only=True) D 2020-08-06 17:15:06,160 yowsup.config.manager - path_or_profile_name is not a path, using it as profile name D 2020-08-06 17:15:06,160 yowsup.config.manager - Detecting config for profile=57**, dir=/root/.config/yowsup/57 D 2020-08-06 17:15:06,160 yowsup.config.manager - Trying /root/.config/yowsup/57**/config.json D 2020-08-06 17:15:06,160 yowsup.config.manager - _load_path(path=/root/.config/yowsup/57*/config.json) D 2020-08-06 17:15:06,161 yowsup.config.manager - Detected config type: json D 2020-08-06 17:15:06,161 yowsup.config.manager - Opening config for reading D 2020-08-06 17:15:06,161 yowsup.config.manager - Loading config D 2020-08-06 17:15:06,161 yowsup.profile.profile - Constructed Profile(profile_name=57***) yowsup-cli v3.2.0 yowsup v3.2.3 consonance v0.1.3-1 dissononce v0.34.3 python-axolotl v0.2.2 cryptography v3.0 protobuf v4.0.0rc2

Copyright (c) 2012-2019 Tarek Galal http://www.openwhatsapp.org

This software is provided free of charge. Copying and redistribution is encouraged.

If you appreciate this software and you would like to support future development please consider donating: http://openwhatsapp.org/yowsup/donate

D 2020-08-06 17:15:06,247 yowsup.stacks.yowstack - Initializing stack D 2020-08-06 17:15:06,247 yowsup.stacks.yowstack - Constructed Network Layer D 2020-08-06 17:15:06,247 yowsup.stacks.yowstack - Constructed Noise Segments Layer D 2020-08-06 17:15:06,248 yowsup.stacks.yowstack - Constructed Noise Layer D 2020-08-06 17:15:06,249 yowsup.stacks.yowstack - Constructed Coder Layer D 2020-08-06 17:15:06,249 yowsup.stacks.yowstack - Constructed Logger Layer D 2020-08-06 17:15:06,249 yowsup.stacks.yowstack - Constructed <yowsup.layers.axolotl.layer_control.AxolotlControlLayer object at 0x7f29c572a410> D 2020-08-06 17:15:06,249 yowsup.stacks.yowstack - Constructed Axolotl Layer - <yowsup.layers.axolotl.layer_receive.AxolotlReceivelayer object at 0x7f29c60d0f90> D 2020-08-06 17:15:06,249 yowsup.stacks.yowstack - Constructed Authentication Layer - Messages Layer - Receipt Layer - Ack Layer - Presence Layer - Ib Layer - Iq Layer - notification Ib Layer - Contact Iq Layer - Chatstate Layer - call Layer - Groups Iq Layer - Media Layer - Privacy Layer - Profiles Layer D 2020-08-06 17:15:06,250 yowsup.stacks.yowstack - Constructed Interface Layer D 2020-08-06 17:15:06,250 yowsup.stacks.yowstack - setProfile(YowProfile(profile_name=57**)) D 2020-08-06 17:15:06,250 yowsup.layers.network.layer - Created asyncore dispatcher I 2020-08-06 17:15:06,250 yowsup.layers.network.layer - Connecting to e2.whatsapp.net:443 D 2020-08-06 17:15:06,250 yowsup.layers.network.dispatcher.dispatcher_asyncore - connect(('e2.whatsapp.net', 443)) D 2020-08-06 17:15:06,347 yowsup.layers.network.dispatcher.dispatcher_asyncore - handle_connect D 2020-08-06 17:15:06,347 yowsup.layers.network.layer - Connected D 2020-08-06 17:15:06,348 yowsup.axolotl.factory - get_manager(profile_name=57*, username=57**) D 2020-08-06 17:15:06,350 yowsup.axolotl.manager - Initialized AxolotlManager [username=57*****, db=/root/.config/yowsup/57*/axolotl.db] D 2020-08-06 17:15:06,350 yowsup.axolotl.manager - level_prekeys(force=False) D 2020-08-06 17:15:06,398 yowsup.axolotl.manager - len(pending_prekeys) = 812 D 2020-08-06 17:15:06,398 yowsup.axolotl.manager - load_unsent_prekeys I 2020-08-06 17:15:06,421 yowsup.axolotl.manager - Loaded 812 unsent prekeys D 2020-08-06 17:15:06,422 yowsup.layers.noise.layer - Received auth event D 2020-08-06 17:15:06,422 yowsup.layers.noise.layer - Performing handshake [username= 57*****, passive=True] D 2020-08-06 17:15:06,422 yowsup.layers.noise.layer - Starting handshake worker D 2020-08-06 17:15:06,720 yowsup.profile.profile - write_config for 573174302712 D 2020-08-06 17:15:06,721 yowsup.common.tools - writeProfileData(profile_name=57**, name=config.json, val=[omitted]) D 2020-08-06 17:15:06,721 yowsup.common.tools - Writing /root/.config/yowsup/57/config.json D 2020-08-06 17:15:09,718 yowsup.layers.logger.layer - rx:

failure reason="401" location="vll" /

D 2020-08-06 17:15:09,718 yowsup.layers.network.dispatcher.dispatcher_asyncore - disconnect D 2020-08-06 17:15:09,718 yowsup.layers.network.dispatcher.dispatcher_asyncore - handle_close D 2020-08-06 17:15:09,719 yowsup.layers.network.layer - Disconnected D 2020-08-06 17:15:09,719 yowsup.layers.axolotl.layer_control - Disconnected, reboot_connect? = False

my file config { "version": 1, "cc": "57", "client_static_keypair": "*****$ "expid": "lnZtIx*", "fdid": "34b90-****-*",# "id": "**", "login": "57*****", "mcc": "000", "mnc": "000", "phone": "57**", "sim_mcc": "000", "sim_mnc": "000" }

please help!!!!!

Mahtab-Adelzade commented 2 years ago

Hi everyone i have almost same error : Mr Tarek tgalal please guide me :(

[root@appliance yowsup-master]# python3 yowsup-cli registration -c yowsup.config -R 655-227 W 2022-01-16 13:17:27,234 yowsup.config.v1.config - Setting a password in Config is deprecated and not used anymore. client_static_keypair is used instead W 2022-01-16 13:17:27,235 yowsup.config.v1.config - Setting a password in Config is deprecated and not used anymore. client_static_keypair is used instead W 2022-01-16 13:17:27,235 yowsup.config.v1.config - Setting a password in Config is deprecated and not used anymore. client_static_keypair is used instead yowsup-cli v3.2.1 yowsup v3.3.0

W 2022-01-16 13:17:27,363 yowsup.common.http.warequest - Passing Config to WARequest is deprecated, pass a YowProfile instead I 2022-01-16 13:17:28,684 yowsup.common.http.warequest - b'{"login":"98912xxxxxxx","reason":"old_version","status":"fail"}\n' { "version": 1, "cc": "98", "client_static_keypair": "OIeJyS4FDLrGtqOGh3Y8oAPO6xjb94ISrTdydn8wEV0x2RIi3i30VS0Wwuquz9bg3E80KHgF1hg9xiXYMKwGWw==", "expid": "aUvubz1ESAi7BWDCZSgYqA==", "fdid": "e2e0835d-6f13-4f34-8d4e-ae6eeec7a815", "id": "", "login": "98912xxxxxxx", "mcc": "432", "mnc": "70", "password": "4sqLq1p5sV6", "phone": "98912xxxxxxx", "server_static_public": "qJWvSttNopqgQ2CgXYTc4jmSUKWd1Rv2QTMbQyYpKwY=", "sim_mcc": "000", "sim_mnc": "000" } status: b'fail' login: b'98912xxxxxxx'