open-wa / wa-automate-nodejs

💬 🤖 The most reliable tool for chatbots with advanced features. Be sure to 🌟 this repository for updates!
https://docs.openwa.dev/
Other
3.14k stars 600 forks source link

Error: Evaluation failed: Error: update chat table failed #3042

Open tmsbrasil opened 1 year ago

tmsbrasil commented 1 year ago

Are you using the latest version of the library?

What type of session are you experiencing this issue on?

Multi-device and I have set multiDevice to true in my config OR am using the --multi-device flag

What type of host account are you experiencing this issue on?

Business account

Mode

My own code

Current Behavior

When I send a message in sequence to more than one contact, the error appears:

Erro ao enviar mensagem para: 551231231231231@c.us erro: Error: Evaluation failed: Error: update chat table failed

Expected Behavior

send the message successfully

Steps To Reproduce

                        await client.sendText(chat.id, message)
                        .then(async(MessageId) => {
                          //SAVE LOG OF MESSAGE SENT
                          const log = {
                              broadcastMessageId: broadMessage.id,
                              leadId: leadId,
                              waChatId: chat.id,
                              waMessageId: MessageId,
                              logType: "SENT"
                          }

                          const logSaved = await saveLog(log, chat, sess, sessionWPPName);

                        })
                        .catch(err => console.log('Erro ao enviar mensagem para: ' + chat.id + ' erro: ' + err))

create() code OR full CLI command + CONFIG

info: Waiting for internal QR renderer to load {"timestamp":"2023-02-09T17:00:50.591Z"}
info: Internal QR renderer loaded in 12 ms {"timestamp":"2023-02-09T17:00:50.603Z"}
info: AUTH.session  {"data":true,"eventName":"AUTH.session","eventNamespace":"AUTH","sessionId":"session","timestamp":"2023-02-09T17:01:22.527Z"}
info: AUTH.session  {"data":true,"eventName":"AUTH.session","eventNamespace":"AUTH","sessionId":"session","timestamp":"2023-02-09T17:01:22.530Z"}
info: AUTH.session  {"data":true,"eventName":"AUTH.session","eventNamespace":"AUTH","sessionId":"session","timestamp":"2023-02-09T17:01:22.531Z"}
info: AUTH.session  {"data":true,"eventName":"AUTH.session","eventNamespace":"AUTH","sessionId":"session","timestamp":"2023-02-09T17:01:22.534Z"}

DEBUG INFO

{
  "WA_VERSION": "2.2305.7",
  "WA_AUTOMATE_VERSION": "4.55.2",
  "BROWSER_VERSION": "HeadlessChrome/109.0.5414.74",
  "START_TS": 1675961268115,
  "RAM_INFO": "Total: 4.14 GB | Free: 2.30 GB",
  "PPTR_VERSION": "19.6.2",
  "LATEST_VERSION": true,
  "CLI": false,
  "PATCH_HASH": "1c74d",
  "LAUNCH_TIME_MS": 78587,
  "ACC_TYPE": "BUSINESS",
  "chats": 1013,
  "messages": 1175,
  "contacts": 21963,
  "isBiz": true,
  "isMd": true,
  "INSTANCE_ID": "9e349711-3f30-42ae-9661-b1be02c87468"
}

Environment

- OS: Linux 4.15
- Node: 16.18.1
- npm: 8.19.2

Screenshots/Logs

No response

Anything else?

No response

CarlosAurelioMRF commented 1 year ago

I have faced the same error

smashah commented 1 year ago

@CarlosAurelioMRF do you have any more context on how to reproduce this?

CarlosAurelioMRF commented 1 year ago

@CarlosAurelioMRF do you have any more context on how to reproduce this?

I dont have more info just that my app has been running for 4 days now, I usually see this error after 2 days without stop. I send/receive huge number of messages and some numbers work as expected, this error happens for new chats (less than 24 hours). Even if I stop my app and run again I can't send messages to those numbers..

smashah commented 1 year ago

@CarlosAurelioMRF if you have high throughput you will get the odd internal wa web error and that's what this is. Something is going wrong internally and it cannot update the internal db chat table. It's actually not got anything to do with open-wa.

What I can suggest is: