Closed gnadelwartz closed 2 years ago
The fact that you can easily read the error means that the patches code has not been injected. Please always share your logs from the start of launch until the error. A lot of context is missing due to truncated logs.
Also, use advanced logging https://github.com/open-wa/wa-automate-nodejs/discussions/2673
I've added logging options to my code and will share output here ...
thats what I get with debug enabled. now seems it a diffent error message. Good new is that I can catch the error without with try and think have already found the source of it.
May be the original problem was temporary or is already fixed in patches ...
[[33mβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ^[[39m
^[[33mβ^[[39m ^[[33mβ^[[39m
^[[33mβ^[[39m @open-wa/wa-automate ^[[33mβ^[[39m
^[[33mβ^[[39m π¬ π€ The most reliable NodeJS whatsapp library for chatbots with advanced features. ^[[33mβ^[[39m
^[[33mβ^[[39m Version: 4.36.5 ^[[33mβ^[[39m
^[[33mβ^[[39m Check out the latest changes: https://github.com/open-wa/wa-automate-nodejs#latest-changes ^[[33mβ^[[39m
^[[33mβ^[[39m ^[[33mβ^[[39m
^[[33mβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ^[[39m
- Starting
- Version: 4.36.5
- Initializing WA
- It is recommended to set useChrome: true or use the --use-chrome flag if you are experiencing issues with Multi device support
- Launching Browser
- MD Enabled, turning off incognito mode.
- Data dir: ./_IGNORE_session
- Browser launched: 579ms
- Setting Up Page
- Loading session data
- Found session data file: /usr/local/telegram/dealwaecho/session.data.json
- multi-device enabled. Session data skipped...
- Existing session data injected
- Pre page launch setup complete: 12ms
- Navigating to WA
- Page loaded in 4872ms: 200
- Page loaded
- Debug info: {
"WA_VERSION": "2.2218.8",
"PAGE_UA": "WhatsApp/2.2147.16 Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36",
"WA_AUTOMATE_VERSION": "4.36.5",
"BROWSER_VERSION": "HeadlessChrome/102.0.5002.0",
"OS": "Linux 5.3",
"START_TS": 1653372545157,
"RAM_INFO": "Total: 6.22 GB | Free: 0.79 GB",
"PPTR_VERSION": "13.7.0"
}
- 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.2218.8%22,%0A%20%20%22WA_AUTOMATE_VERSION%22:%20%224.36.5%22,%0A%20%20%22BROWSER_VERSION%22:%20%22HeadlessChrome/102.0.5002.0%22,%0A%20%20%22START_TS%22:%201653372545157,%0A%20%20%22RAM_INFO%22:%20%22Total:%206.22%20GB%20%7C%20Free:%200.79%20GB%22,%0A%20%20%22PPTR_VERSION%22:%20%2213.7.0%22,%0A%20%20%22LATEST_VERSION%22:%20true,%0A%20%20%22CLI%22:%20false%0A%7D&enviro=-%20OS:%20Linux%205.3%0A-%20Node:%2016.13.2%0A-%20npm:%208.1.2&labels=MD
- Time to injection: 1193ms
- Injecting api
- Injecting scripts
- Base inject: 24ms
- WAPI inject: 19ms
- Checking session integrity
- Session integrity check passed
- Launch inject: 1176ms
- WAPI injected
- Authenticating
- Authenticated
- Waiting for ripe session...
- Injecting scripts
- Session ready for injection
- Reinjecting api
- Injecting scripts
- Base inject: 305ms
- Base inject: 92ms
- WAPI inject: 484ms
- Checking session integrity
- WAPI inject: 414ms
- Checking session integrity
- Session integrity check passed
- Session integrity check passed
- Launch inject: 728ms
- Launch inject: 1174ms
- WAPI Reinjected
- Checking if session is valid
- Downloading patches from https://cdn.openwa.dev/patches.json
- Client is ready
- Downloaded patches in 0.207s
- Installing patches
- Patches Installed: e3e64
- Client loaded for normal account [MD] with 599 contacts, 15 chats & 15 messages in 26.83s
- Finalizing web session...
- Finalizing client...
^[[31mβββββββββββββββββββββββββββββββββββββββββββββββββββββββββ^[[39m
^[[31mβ^[[39m ^[[31mβ^[[39m
^[[31mβ^[[39m Use the link below to easily report issues:πππ ^[[31mβ^[[39m
^[[31mβ^[[39m ^[[31mβ^[[39m
^[[31mβββββββββββββββββββββββββββββββββββββββββββββββββββββββββ^[[39m
- 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.2218.8%22,%0A%20%20%22WA_AUTOMATE_VERSION%22:%20%224.36.5%22,%0A%20%20%22BROWSER_VERSION%22:%20%22HeadlessChrome/102.0.5002.0%22,%0A%20%20%22START_TS%22:%201653372545157,%0A%20%20%22RAM_INFO%22:%20%22Total:%206.22%20GB%20%7C%20Free:%200.79%20GB%22,%0A%20%20%22PPTR_VERSION%22:%20%2213.7.0%22,%0A%20%20%22LATEST_VERSION%22:%20true,%0A%20%20%22CLI%22:%20false,%0A%20%20%22PATCH_HASH%22:%20%22e3e64%22,%0A%20%20%22LAUNCH_TIME_MS%22:%2026830,%0A%20%20%22ACC_TYPE%22:%20%22PERSONAL%22,%0A%20%20%22chats%22:%2015,%0A%20%20%22messages%22:%2015,%0A%20%20%22contacts%22:%20599,%0A%20%20%22isMd%22:%20true,%0A%20%20%22INSTANCE_ID%22:%20%22b60507a6-a23b-49bb-a3e3-c2d5fa93e462%22%0A%7D&enviro=-%20OS:%20Linux%205.3%0A-%20Node:%2016.13.2%0A-%20npm:%208.1.2&labels=MD,PHA
- π @OPEN-WA ready for account: 1477
[ ... 2h later! ...]
/usr/local/telegram/dealwaecho/dealwaecho.ts:41
//'--proxy-server=socks5://localhost:1080', // in case you want a default proxy
^
TypeError: Cannot read properties of undefined (reading 'includes')
at /usr/local/telegram/dealwaecho/dealwaecho.ts:324:14
at step (/usr/local/telegram/dealwaecho/dealwaecho.ts:41:23)
at Object.next (/usr/local/telegram/dealwaecho/dealwaecho.ts:22:53)
at /usr/local/telegram/dealwaecho/dealwaecho.ts:16:71
at new Promise (<anonymous>)
at __awaiter (/usr/local/telegram/dealwaecho/dealwaecho.ts:12:12)
at /usr/local/telegram/dealwaecho/dealwaecho.ts:262:36
at Client.<anonymous> (/usr/local/telegram/dealwaecho/node_modules/@open-wa/wa-automate/dist/api/Client.js:697:92)
at Generator.next (<anonymous>)
at fulfilled (/usr/local/telegram/dealwaecho/node_modules/@open-wa/wa-automate/dist/api/Client.js:24:58)
OK, can confirm "TypeError: mc.processFiles" after reeconnect is gone. Issue will be closed
a followup question: the second error appears in a chat where I get messages of type chipertext whre message.content is undefined and message.body is empty. seems to be a new feature to have also encrypted message in group chats.
Type: ciphertext Caption: undefined Content: undefined Body:
how to can I get message text in this case?
@gnadelwartz read this:
@smashah thank you for pointing out, but this was not the problem. Im my case I had now some starnge behavoir - 3 alone in this issue - and therefore I decided to delete session data and re-join with QR.
An all these stange errors are gone. In multidevice it seems a good idea not only to restart the scrikpt regulary, but also to delete session data once a while...
Cheers Kay
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?
Personal account (normal)
Mode
My own code
Current Behavior
wa-automate is working as normal, but after first state change and re-pairung/the connection on next Message the follwing error happens:
This happend on Version 4.35.13 without updating, but also on newest version. It happen with installed Chromium and newest puppeteer, also.
Expected Behavior
no type error ;-)
Steps To Reproduce
run script and wait for reconnect on state change (plus send picture?)
create() code OR full CLI command + CONFIG
DEBUG INFO
Environment
Screenshots/Logs
Anything else?
No response