open-wa/wa-automate-docker

Incremental Memory #21

NSOPORTEDESARROLLO posted onGitHub

Hi ,

I have some issues about memory, for example I have a VPS (4GB ram, 2 CPU cores), when I run a docker or local process memory ram starts about 400 mb, but after 5 days it is around 2GB. When memory reaches 100% api disconnects <img width="1235" alt="Captura de Pantalla 2021-11-03 a la(s) 4 46 14 p m" src="https://user-images.githubusercontent.com/47125165/140220013-79b474f5-2831-4c93-9f64-c7796338cbc8.png"> <img width="793" alt="Captura de Pantalla 2021-11-03 a la(s) 4 48 06 p m" src="https://user-images.githubusercontent.com/47125165/140220134-20ef2cb8-de67-42c6-a103-89ebdbbb8c93.png"> s


@NSOPORTEDESARROLLO try calling the /refresh endpoint to reduce ram usage from the browsers end. Please report back if that works for u

posted by smashah over 3 years ago

I'm trying some like : curl -X POST http://localhost:8080/refresh, but I got:

{"success":false,"error":{"name":"Error","message":"Evaluation failed: TypeError: Cannot read properties of undefined (reading 'sendMessage')\n at puppeteer_evaluation_script:1:110364\n at puppeteer_evaluation_script:1:424734"}}

posted by NSOPORTEDESARROLLO over 3 years ago

@smashah I am also getting same error when I tried to use /refresh end point,

After 1-2 days docker container consuming 1.5 to 2 GB RAM

After restarting docker image, it uses around 400-500MB, but after 1-2 days it started consuming more memories.

{ "success": false, "error": { "name": "Error", "message": "Evaluation failed: TypeError: Cannot read properties of undefined (reading 'sendMessage')\n at puppeteer_evaluation_script:1:115974\n at puppeteer_evaluation_script:1:449680" } }

Can you please help us to fix the issue?

posted by manojsitapara about 3 years ago

I'm going to need to see all of your launch logs and config in order to replicate this error upon calling refresh.

posted by smashah about 3 years ago

Here is my logs

  • QR code scanned. Loading session...
  • QR code scanned. Loading session...
  • Reinjecting api
  • WAPI Reinjected
  • Checking if session is valid
  • Downloading patches from https://cdn.openwa.dev/patches.json
  • Client is ready
  • Generating patch hash
  • Downloaded patches in 0.86s
  • Installing patches
  • Patches Installed: 80ece
  • Client loaded for normal account with 3085 contacts, 32 chats & 299 messages in 28.788s
  • Finalizing web session...
  • Finalizing client...
  • 🚀 @OPEN-WA ready for account: 3722
  • session_STARTUP
  • Setting Up API Explorer
  • API Explorer set up successfully
  • ...waiting for port 8080 to be free
  • Port 8080 is now free.
  •   API Explorer (​http://localhost:8080/api-docs/ ​)
  • • Listening on port 8080!
  • • Listening on port 8080!
  • session_REFRESH
  • • Listening on port 8080!
  • Refreshing session
  • • Listening on port 8080!
  • Opening session in new tab
  • • Listening on port 8080!
  • Waiting for conflict to close stale tab...
  • • Listening on port 8080!
  • Checking if fresh session is authenticated...
  • • Listening on port 8080!
  • Injected new session...
  • • Listening on port 8080!
  • Downloading patches from https://cdn.openwa.dev/patches.json
  • • Listening on port 8080!
  • Generating patch hash
  • • Listening on port 8080!
  • Downloaded patches in 0.117s
  • • Listening on port 8080!
  • Installing patches middleware -> error Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'sendMessage') at puppeteer_evaluation_script:1:115974 at puppeteer_evaluation_script:1:449680 at ExecutionContext._evaluateInternal (/usr/src/app/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:175:23) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async ExecutionContext.evaluate (/usr/src/app/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16) at async Promise.all (index 0) root@instance-1:/home/onlineshambhumate# Page down
posted by manojsitapara about 3 years ago

@manojsitapara there is critical context in the logs at the beginning. Please share all of it not just after you scanned the qr code

posted by smashah about 3 years ago

@manojsitapara refresh is fixed in the :latest or :4.23.17

posted by smashah about 3 years ago

@NSOPORTEDESARROLLO

@manojsitapara refresh is fixed in the :latest or :4.23.17

posted by smashah about 3 years ago

Thanks @smashah it is working now

posted by manojsitapara about 3 years ago

Fund this Issue

$0.00
Funded

Pull requests