devalexanderdaza / yowsapp-framework

Yowsaapp Framework
15 stars 2 forks source link

Assertion Error in Asyncore Layer Integration #4

Closed devalexanderdaza closed 5 years ago

devalexanderdaza commented 5 years ago

Hi guys... this is a current error after ./start.sh

D 2019-05-07 17:52:35,144 yowsup.config.manager - load_path(path=/Users/alexanderdaza/Library/Application Support/yowsup/573114946690/config.json) DEBUG:yowsup.config.manager:load_path(path=/Users/alexanderdaza/Library/Application Support/yowsup/573114946690/config.json) D 2019-05-07 17:52:35,144 yowsup.config.manager - Detected config type: json DEBUG:yowsup.config.manager:Detected config type: json D 2019-05-07 17:52:35,144 yowsup.config.manager - Opening config for reading DEBUG:yowsup.config.manager:Opening config for reading D 2019-05-07 17:52:35,156 yowsup.config.manager - Loading config DEBUG:yowsup.config.manager:Loading config E 2019-05-07 17:52:35,228 yowsup.layers.network.dispatcher.dispatcher_asyncore - Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncore.py", line 91, in write obj.handle_write_event() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncore.py", line 441, in handle_write_event self.handle_connect_event() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncore.py", line 429, in handle_connect_event self.handle_connect() File "/Users/alexanderdaza/Desktop/yowsapp-framework/venv/lib/python3.6/site-packages/yowsup/layers/network/dispatcher/dispatcher_asyncore.py", line 34, in handle_connect self.connectionCallbacks.onConnected() File "/Users/alexanderdaza/Desktop/yowsapp-framework/venv/lib/python3.6/site-packages/yowsup/layers/network/layer.py", line 53, in onConnected self.emitEvent(YowLayerEvent(YowNetworkLayer.EVENT_STATE_CONNECTED)) File "/Users/alexanderdaza/Desktop/yowsapp-framework/venv/lib/python3.6/site-packages/yowsup/layers/__init__.py", line 94, in emitEvent self.__upper.emitEvent(yowLayerEvent) File "/Users/alexanderdaza/Desktop/yowsapp-framework/venv/lib/python3.6/site-packages/yowsup/layers/__init__.py", line 94, in emitEvent self.__upper.emitEvent(yowLayerEvent) File "/Users/alexanderdaza/Desktop/yowsapp-framework/venv/lib/python3.6/site-packages/yowsup/layers/__init__.py", line 94, in emitEvent self.__upper.emitEvent(yowLayerEvent) [Previous line repeated 3 more times] File "/Users/alexanderdaza/Desktop/yowsapp-framework/venv/lib/python3.6/site-packages/yowsup/layers/__init__.py", line 88, in emitEvent if self.__upper and not self.__upper.onEvent(yowLayerEvent): File "/Users/alexanderdaza/Desktop/yowsapp-framework/venv/lib/python3.6/site-packages/yowsup/layers/__init__.py", line 212, in onEvent stopEvent = stopEvent or s.onEvent(yowLayerEvent) File "/Users/alexanderdaza/Desktop/yowsapp-framework/venv/lib/python3.6/site-packages/yowsup/layers/__init__.py", line 109, in onEvent return self.event_callbacks[eventName](yowLayerEvent) File "/Users/alexanderdaza/Desktop/yowsapp-framework/venv/lib/python3.6/site-packages/yowsup/layers/auth/layer_authentication.py", line 36, in on_connected passive=self.getProp(self.PROP_PASSIVE, False) File "/Users/alexanderdaza/Desktop/yowsapp-framework/venv/lib/python3.6/site-packages/yowsup/layers/__init__.py", line 202, in subBroadcastEvent self.broadcastEvent(yowLayerEvent) File "/Users/alexanderdaza/Desktop/yowsapp-framework/venv/lib/python3.6/site-packages/yowsup/layers/__init__.py", line 103, in broadcastEvent self.__lower.broadcastEvent(yowLayerEvent) File "/Users/alexanderdaza/Desktop/yowsapp-framework/venv/lib/python3.6/site-packages/yowsup/layers/__init__.py", line 103, in broadcastEvent self.__lower.broadcastEvent(yowLayerEvent) File "/Users/alexanderdaza/Desktop/yowsapp-framework/venv/lib/python3.6/site-packages/yowsup/layers/__init__.py", line 103, in broadcastEvent self.__lower.broadcastEvent(yowLayerEvent) [Previous line repeated 1 more time] File "/Users/alexanderdaza/Desktop/yowsapp-framework/venv/lib/python3.6/site-packages/yowsup/layers/__init__.py", line 98, in broadcastEvent if self.__lower and not self.__lower.onEvent(yowLayerEvent): File "/Users/alexanderdaza/Desktop/yowsapp-framework/venv/lib/python3.6/site-packages/yowsup/layers/__init__.py", line 109, in onEvent return self.event_callbacks[eventName](yowLayerEvent) File "/Users/alexanderdaza/Desktop/yowsapp-framework/venv/lib/python3.6/site-packages/yowsup/layers/noise/layer.py", line 63, in on_auth assert type(local_static) is KeyPair AssertionError

markdueck commented 5 years ago

same error here. It worked to register a new number, and it synced something, but then gave the same assertionerror

devalexanderdaza commented 5 years ago

It is correct, I am reviewing each of the components of the framework to find the error. We need more people who can help us. We hope to have more community soon.

markdueck commented 5 years ago

I've done some programming, but this is a bit above my level I feel -- overwhelming.

devalexanderdaza commented 5 years ago

Do not worry, let's go step by step to solve this problem. I do not have much time but I try to work a couple of hours a day on the project. As soon as I have more news, I will publish them in the repository.

Sharissa90 commented 5 years ago

update yowsup to 3.2.3 it will fix the issue...

devalexanderdaza commented 5 years ago

update yowsup to 3.2.3 it will fix the issue...

I will update yowsup and check if this update solves the problem. Thank you @Sharissa90

devalexanderdaza commented 5 years ago

After upgrade, ./start.sh generate news errors. New issue created in #5

gabrieru commented 5 years ago

same issue, how can i update yowsup?

devalexanderdaza commented 5 years ago

I have been updating yowsup every time a new version is released. I already consult @tgalal and I am waiting for your answer, because this same error occurs when I created the example echo application exposed on your wiki

devalexanderdaza commented 5 years ago

Hi! This error has defined in https://github.com/tgalal/yowsup/milestone/2 with the name Asyncore Error Awaiting the response from the creator.

Sharissa90 commented 5 years ago

I believe this issue about yowsup cant read config file, if you look your config file it have "client_static_keypair": this issue raise when yowsup cant access or cant get this client static keypair...

devalexanderdaza commented 5 years ago

That's right, but Yowsup in version 3 already has the necessary connections to get to the phone's configuration file. If you notice, in the debugging of the application by console, it indicates that it connects correctly to the whatsapp socket, however the connection and death is not maintained.

Sharissa90 commented 5 years ago

open /Users/alexanderdaza/Desktop/yowsapp-framework/venv/lib/python3.6/site-packages/yowsup/layers/noise/layer.py

find

if type(local_static) is bytes:
      local_static = KeyPair.from_bytes(local_static)

and change to

if type(local_static) is bytes:
      local_static = KeyPair.from_bytes(local_static)
else:
      local_static = KeyPair.from_bytes(local_static.encode())

I hope it will quick dirty fix for now...