open-wa/wa-automate-nodejs

Do you want to work on this issue?

You can request for a bounty in order to promote it!

Server crashing when qrCode not scanned #3126

antipr000 posted onGitHub

Are you using the latest version of the library?

  • I have checked and am 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?

Personal account (normal)

Mode

My own code

Current Behavior

When qrCode is not scanned, the server is crashing with the following error: Error while terminating browser PID. You can just ignore this, as the process has most likely been terminated successfully already

Expected Behavior

Some way we can catch this error and log it instead of crashing the server

Steps To Reproduce

  1. Keep qrMax as 1 in config to be able to replicate faster
  2. Call create()
  3. Do not scan the qr code
  4. Once it times out it will result in server crash

create() code OR full CLI command + CONFIG

sessionId: session.id,
          sessionDataPath: './session/',
          multiDevice: true, //required to enable multiDevice support
          authTimeout: 300, //wait only 5 mins to get a connection with the host account device
          blockCrashLogs: true,
          disableSpins: true,
          headless: true,
          logConsole: false,
          qrLogSkip: true,
          popup: true,
          qrMax: 100,
          qrTimeout: 0, //0 means it will wait forever for you to scan the qr code
          chromiumArgs: [
            '--disable-gpu',
            '--disable-dev-shm-usage',
            '--disable-setuid-sandbox',
            '--no-sandbox',
          ],
          useChrome: true,

DEBUG INFO

"WA_VERSION": "2.2321.6",
  "PAGE_UA": "WhatsApp/2.2147.16 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36",
  "WA_AUTOMATE_VERSION": "4.66.0",
  "BROWSER_VERSION": "HeadlessChrome/113.0.5672.126",
  "OS": "macOS Monterey",
  "START_TS": 1684563942697,
  "RAM_INFO": "Total: 17.18 GB | Free: 0.36 GB",
  "PPTR_VERSION": "19.11.1"

Environment

- OS: macOS Monterey V 12.2.1
- Node: v16.19.0
- yarn: 1.22.19

Screenshots/Logs

You can also authenticate the session at: http://localhost:6000
- Starting
- Version: 4.66.0
- Initializing WA
- Using custom chromium args with multi device will cause issues! Please remove them: --disable-gpu,--disable-dev-shm-usage,--disable-setuid-sandbox,--no-sandbox
- Launching Browser
- MD Enabled, turning off incognito mode.
- Data dir: ./session//_IGNORE_f9f9ed64-6d19-4a31-901e-38c8a46e0fbb
- Data dir doesnt exist, creating...: ./session//_IGNORE_f9f9ed64-6d19-4a31-901e-38c8a46e0fbb

  Puppeteer old Headless deprecation warning:
    In the near feature `headless: true` will default to the new Headless mode
    for Chrome instead of the old Headless implementation. For more
    information, please see https://developer.chrome.com/articles/new-headless/.
    Consider opting in early by passing `headless: "new"` to `puppeteer.launch()`
    If you encounter any bugs, please report them to https://github.com/puppeteer/puppeteer/issues/new/choose.

- Browser launched: 156ms
Press "s" to take a screenshot. Press "Ctrl+C" to quit.
- Setting Up Page
- Loading session data
- No session data file found for session : f9f9ed64-6d19-4a31-901e-38c8a46e0fbb
- No session data detected. Opting in for MD.
- Make sure to keep the session alive for at least 5 minutes after scanning the QR code before trying to restart a session!!
- Pre page launch setup complete: 2ms
- Navigating to WA
- Page loaded in 681ms: 200
- Page loaded
- Debug info: {
  "WA_VERSION": "2.2321.6",
  "PAGE_UA": "WhatsApp/2.2147.16 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36",
  "WA_AUTOMATE_VERSION": "4.66.0",
  "BROWSER_VERSION": "HeadlessChrome/113.0.5672.126",
  "OS": "macOS Monterey",
  "START_TS": 1684563942697,
  "RAM_INFO": "Total: 17.18 GB | Free: 0.36 GB",
  "PPTR_VERSION": "19.11.1"
}
- Use this easy pre-filled link to report an issue: https://github.com/open-wa/wa-automate-nodejs/issues/new?template=bug_report.yaml&d_info=%7B%0A%20%20%22WA_VERSION%22:%20%222.2321.6%22,%0A%20%20%22WA_AUTOMATE_VERSION%22:%20%224.66.0%22,%0A%20%20%22BROWSER_VERSION%22:%20%22HeadlessChrome/113.0.5672.126%22,%0A%20%20%22START_TS%22:%201684563942697,%0A%20%20%22RAM_INFO%22:%20%22Total:%2017.18%20GB%20%7C%20Free:%200.36%20GB%22,%0A%20%20%22PPTR_VERSION%22:%20%2219.11.1%22,%0A%20%20%22LATEST_VERSION%22:%20true,%0A%20%20%22CLI%22:%20false%0A%7D&enviro=-%20OS:%20macOS%20Monterey%0A-%20Node:%2016.19.0%0A-%20npm:%208.19.3&labels=MD
- Time to injection: 963ms
- Injecting api
- Injecting scripts
- Base inject: 4ms
- WAPI inject: 96ms
- Checking session integrity
- Session integrity check failed, trying again... 2
- WAPI inject: 67ms
- Checking session integrity
- Session integrity check passed
- Launch inject: 109ms
- WAPI injected
- Authenticating
- Authenticate to continue
- First QR: 5072 ms
New QR Code generated. Not printing in console because qrLogSkip is set to true
Generated Qr code
- QR Code limit reached, exiting...
Error while terminating browser PID. You can just ignore this, as the process has most likely been terminated successfully already: kill ESRCH

Anything else?

No response


Some more logs

```WAPI injected f9f9ed64-6d19-4a31-901e-38c8a46e0fbb info: WAPI injected {"data":"WAPI injected","eventName":"STARTUP.f9f9ed64-6d19-4a31-901e-38c8a46e0fbb","eventNamespace":"STARTUP","sessionId":"f9f9ed64-6d19-4a31-901e-38c8a46e0fbb","timestamp":"2023-05-20T09:26:40.939Z"}

  • Authenticating Authenticating f9f9ed64-6d19-4a31-901e-38c8a46e0fbb info: Authenticating {"data":"Authenticating","eventName":"STARTUP.f9f9ed64-6d19-4a31-901e-38c8a46e0fbb","eventNamespace":"STARTUP","sessionId":"f9f9ed64-6d19-4a31-901e-38c8a46e0fbb","timestamp":"2023-05-20T09:26:40.939Z"} authTimeout f9f9ed64-6d19-4a31-901e-38c8a46e0fbb info: authTimeout {"data":"authTimeout","eventName":"STARTUP.f9f9ed64-6d19-4a31-901e-38c8a46e0fbb","eventNamespace":"STARTUP","sessionId":"f9f9ed64-6d19-4a31-901e-38c8a46e0fbb","timestamp":"2023-05-20T09:29:40.938Z"}
  • Authentication timed out. Shutting down. Consider increasing authTimeout config variable: https://open-wa.github.io/wa-automate-nodejs/interfaces/configobject.html#authtimeout Authentication timed out. Shutting down. Consider increasing authTimeout config variable: https://open-wa.github.io/wa-automate-nodejs/interfaces/configobject.html#authtimeout f9f9ed64-6d19-4a31-901e-38c8a46e0fbb info: Authentication timed out. Shutting down. Consider increasing authTimeout config variable: https://open-wa.github.io/wa-automate-nodejs/interfaces/configobject.html#authtimeout {"data":"Authentication timed out. Shutting down. Consider increasing authTimeout config variable: https://open-wa.github.io/wa-automate-nodejs/interfaces/configobject.html#authtimeout","eventName":"STARTUP.f9f9ed64-6d19-4a31-901e-38c8a46e0fbb","eventNamespace":"STARTUP","sessionId":"f9f9ed64-6d19-4a31-901e-38c8a46e0fbb","timestamp":"2023-05-20T09:29:40.940Z"} Error while terminating browser PID. You can just ignore this, as the process has most likely been terminated successfully already: kill ESRCH App Offline f9f9ed64-6d19-4a31-901e-38c8a46e0fbb info: App Offline {"data":"App Offline","eventName":"STARTUP.f9f9ed64-6d19-4a31-901e-38c8a46e0fbb","eventNamespace":"STARTUP","sessionId":"f9f9ed64-6d19-4a31-901e-38c8a46e0fbb","timestamp":"2023-05-20T09:29:41.097Z"} error: App Offline {"timestamp":"2023-05-20T09:29:41.097Z"} error: Error: App Offline at /Users/sohammukherjee/Documents/whatsapp-api/node_modules/@open-wa/wa-automate/dist/controllers/initializer.js:283:23 at Generator.next (<anonymous>) at fulfilled (/...[TRUNCATED]... {"timestamp":"2023-05-20T09:29:41.098Z"} Error: App Offline at /Users/sohammukherjee/Documents/whatsapp-api/node_modules/@open-wa/wa-automate/dist/controllers/initializer.js:283:23 at Generator.next (<anonymous>) at fulfilled (/Users/sohammukherjee/Documents/whatsapp-api/node_modules/@open-wa/wa-automate/dist/controllers/initializer.js:28:58) at processTicksAndRejections (node:internal/process/task_queues:96:5) Error while terminating browser PID. You can just ignore this, as the process has most likely been terminated successfully already: kill ESRCH QR code not scanned for session```
posted by antipr000 over 1 year ago

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests