tgalal / yowsup

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

Yowsup Freeze after multiple yowsup.layers.axolotl.layer_receive - InvalidMessage or KeyId for xxxxxxxxxx, going to send a retry #2720

Open Sharissa90 opened 5 years ago

Sharissa90 commented 5 years ago

I test try send sticker to yowsup 3.2.0 in echoclient demos mode, yowsup not crash but made multiple this


W 2019-05-06 13:26:52,881 yowsup.layers.axolotl.layer_receive - InvalidMessage or KeyId for xxxxxxxxxxxx, going to send a retry
W 2019-05-06 13:26:53,215 yowsup.layers.axolotl.layer_receive - InvalidMessage or KeyId for xxxxxxxxxxxx, going to send a retry
W 2019-05-06 13:26:53,591 yowsup.layers.axolotl.layer_receive - InvalidMessage or KeyId for xxxxxxxxxxxx, going to send a retry
W 2019-05-06 13:26:53,977 yowsup.layers.axolotl.layer_receive - InvalidMessage or KeyId for xxxxxxxxxxxx, going to send a retry
W 2019-05-06 13:26:54,301 yowsup.layers.axolotl.layer_receive - InvalidMessage or KeyId for xxxxxxxxxxxx, going to send a retry
W 2019-05-06 13:26:54,681 yowsup.layers.axolotl.layer_receive - InvalidMessage or KeyId for xxxxxxxxxxxx, going to send a retry
W 2019-05-06 13:26:55,013 yowsup.layers.axolotl.layer_receive - InvalidMessage or KeyId for xxxxxxxxxxxx, going to send a retry
W 2019-05-06 13:26:55,404 yowsup.layers.axolotl.layer_receive - InvalidMessage or KeyId for xxxxxxxxxxxx, going to send a retry
W 2019-05-06 13:26:55,807 yowsup.layers.axolotl.layer_receive - InvalidMessage or KeyId for xxxxxxxxxxxx, going to send a retry```

after that, yowsup freeze, not echoing back my text, I have delete axololtl.db, but I can send message with -S xxxxxx 'content' but if in echoclient yowsup dont echoing back my text
khaled-s commented 5 years ago

I'm getting this error for all messages now. my application was working but for some reasone I'm getting this error and I'm not able to send back any massage.

Note: I'm able to send messages from the cli but not through the layers Any suggestions?

tgalal commented 5 years ago

what does that mean "from cli but not through the the layers"? cli IS layers. Please explain the problem in more details, and include debug output, sample code, reproduceable scenario if available

khaled-s commented 5 years ago

yowsup.layers.axolotl.layer_receive - InvalidMessage or KeyId for XXXXXXX80091, going to send a retry I'm getting this error for each message I'm receiving from any number and after receiving 10 messages the application is freezing. it was working with the same code before I get this error

the onMessage function is not triggered, and for that, I'm not able to reply to incoming messages. I can send messages from the yowsup-cli

I'm using the echoclient example yowsup master repo ubuntu 18.04

khaled-s commented 5 years ago

this is a screenshot for what I'm getting Capture

Any solution to this problem?

tgalal commented 5 years ago

no solution available currently

khaled-s commented 5 years ago

I noticed that decrypting messages in the receiving layer not returning anything, manager layer raises an error causing the problem plaintext = self._get_session_cipher(senderid).decryptMsg(msg) session cipher not decrypting the messages some times it works fine for one message out of 1000 messages, I'm not able to tell why that is happening, the messages are the same nothing is different

ChiscaAlex commented 5 years ago

Hi, I have the same problem, for some reasons the loadPreKey function is called with "0" as preKeyId and the table prekeys has records starting with 1 for the prekey_id column. I'm still trying to find out why the preKeyId is 0.

apepenkov commented 5 years ago

Hi, I have the same problem, for some reasons the loadPreKey function is called with "0" as preKeyId and the table prekeys has records starting with 1 for the prekey_id column. I'm still trying to find out why the preKeyId is 0.

manager.py 98 line

    def generate_signed_prekey(self):
        logger.debug("generate_signed_prekey")
        latest_signed_prekey = self.load_latest_signed_prekey(generate=False)
        if latest_signed_prekey is not None:
            if latest_signed_prekey.getId() == self.MAX_SIGNED_PREKEY_ID:
                new_signed_prekey_id = (self.MAX_SIGNED_PREKEY_ID / 2) + 1
            else:
                new_signed_prekey_id = latest_signed_prekey.getId() + 1
        else:
            new_signed_prekey_id = 1  #  >>>>> HERE WAS 0 <<<<<
        print(new_signed_prekey_id)
        signed_prekey = KeyHelper.generateSignedPreKey(self._identity, new_signed_prekey_id)
        self._store.storeSignedPreKey(signed_prekey.getId(), signed_prekey)
        return signed_prekey

solved for me.

Gabriel712 commented 5 years ago

Hello, today i received yowsup.layers.axolotl.layer_receive - InvalidMessage

i send a message to number ... and solved...

yazinsai commented 4 years ago

@Gabriel712 That was the solution for me too -- sending a message to the erroneous number fixed it!