whatsapp-http-api
whatsapp-http-api copied to clipboard
[BUG][WEBJS] - Session not starting
Session not starting
When starting, even with defaults the session hangs "STARTING" without further information in the logs...
[Nest] 30 - 04/30/2024, 10:35:34 PM LOG [SessionManager] 'default' - starting session...
2024.4.4
{
version: '2024.4.4',
engine: 'WEBJS',
tier: 'PLUS',
browser: '/usr/bin/chromium'
}
To Reproduce Steps to reproduce the behavior:
- Start session with defaults
Expected behavior
status to change from STARTING to SCANQRCODE
Engine I'm using WEBJS engine.
Requests - Responses
{ "name": "default", "config": { "proxy": null, "debug": true } }
Response:
{ "name": "default", "status": "STARTING", "config": { "proxy": null, "debug": true } }
Docker Logs
[Nest] 30 - 04/30/2024, 10:34:50 PM LOG [InstanceLoader] ConfigHostModule dependencies initialized +1ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [InstanceLoader] TerminusModule dependencies initialized +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [InstanceLoader] ConfigModule dependencies initialized +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [SessionManager] Using local storage for session info. [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [Storage] Directory '/tmp/whatsapp-files' created from scratch [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [InstanceLoader] ServeStaticModule dependencies initialized +1ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [InstanceLoader] AppModulePlus dependencies initialized +1ms Please set up both WHATSAPP_SWAGGER_USERNAME and WHATSAPP_SWAGGER_PASSWORD to enable swagger authentication. [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RoutesResolver] AuthController {/api/:session/auth}: +62ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/auth/qr, GET} route +1ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/auth/request-code, POST} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/auth/authorize-code, POST} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/auth/captcha, GET} route +1ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/auth/captcha, POST} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RoutesResolver] SessionsController {/api/sessions}: +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/sessions/start, POST} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/sessions/stop, POST} route +1ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/sessions/logout, POST} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/sessions, GET} route +1ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/sessions/:session, GET} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RoutesResolver] SessionController {/api/sessions/:session}: +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/sessions/:session/me, GET} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RoutesResolver] ChattingController {/api}: +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/checkNumberStatus, GET} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/sendContactVcard, POST} route +1ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/sendText, GET} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/sendText, POST} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/sendPoll, POST} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/sendLocation, POST} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/sendLinkPreview, POST} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/sendImage, POST} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/sendFile, POST} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/sendVoice, POST} route +1ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/sendVideo, POST} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/reply, POST} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/sendSeen, POST} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/startTyping, POST} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/stopTyping, POST} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/reaction, PUT} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/star, PUT} route +1ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/messages, GET} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RoutesResolver] ChatsController {/api/:session/chats}: +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/chats, GET} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/chats/:chatId, DELETE} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/chats/:chatId/messages, GET} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/chats/:chatId/messages, DELETE} route +1ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/chats/:chatId/messages/:messageId, DELETE} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/chats/:chatId/messages/:messageId, PUT} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RoutesResolver] StatusController {/api/:session/status}: +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/status/text, POST} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/status/image, POST} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/status/voice, POST} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/status/video, POST} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RoutesResolver] ContactsController {/api/contacts}: +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/contacts, GET} route +1ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/contacts/all, GET} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/contacts/check-exists, GET} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/contacts/about, GET} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/contacts/profile-picture, GET} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/contacts/block, POST} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/contacts/unblock, POST} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RoutesResolver] GroupsController {/api/:session/groups}: +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/groups, POST} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/groups, GET} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/groups/:id, GET} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/groups/:id/settings/security/info-admin-only, PUT} route +1ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/groups/:id/settings/security/info-admin-only, GET} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/groups/:id/settings/security/messages-admin-only, PUT} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/groups/:id/settings/security/messages-admin-only, GET} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/groups/:id, DELETE} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/groups/:id/leave, POST} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/groups/:id/description, PUT} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/groups/:id/subject, PUT} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/groups/:id/invite-code, GET} route +1ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/groups/:id/invite-code/revoke, POST} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/groups/:id/participants, GET} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/groups/:id/participants/add, POST} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/groups/:id/participants/remove, POST} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/groups/:id/admin/promote, POST} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/groups/:id/admin/demote, POST} route +1ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RoutesResolver] PresenceController {/api/:session/presence}: +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/presence, POST} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/presence, GET} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/presence/:chatId, GET} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/:session/presence/:chatId/subscribe, POST} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RoutesResolver] ScreenshotController {/api}: +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/screenshot, GET} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RoutesResolver] VersionController {/api/version}: +1ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/api/version, GET} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RoutesResolver] HealthController {/health}: +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [RouterExplorer] Mapped {/health, GET} route +0ms [Nest] 30 - 04/30/2024, 10:34:50 PM LOG [NestApplication] Nest application successfully started +2ms WhatsApp HTTP API is running on: http://[::1]:3000 Environment: { version: '2024.4.4', engine: 'WEBJS', tier: 'PLUS', browser: '/usr/bin/chromium' } [Nest] 30 - 04/30/2024, 10:35:34 PM LOG [SessionManager] 'default' - starting session...
Screenshots
N/A
Additional context
Only just updated to new image.
Hi! Could you run the session with config.debug: True
flag in the request and send logs here please :pray:
https://waha.devlike.pro/docs/how-to/sessions/#enable-debug
Used the following to start the session and I am not seeing anything more in addition to above ....
{ "name": "default", "status": "STARTING", "config": { "debug": true } }
Hi! Sorry for asking dump question, but could you try to run a different session, like default2
{
"name": "default2",
"config": {
"proxy": null,
"webhooks": [
{
"url": "https://httpbin.org/post",
"events": [
"message",
"session.status"
],
"hmac": null,
"retries": null,
"customHeaders": null
}
],
"debug": false
}
}
[ { "name": "default", "status": "STARTING", "config": { "debug": true }, "me": null, "engine": { "engine": "WEBJS" } }, { "name": "default2", "status": "STARTING", "config": { "proxy": null, "webhooks": [ { "url": "https://httpbin.org/post", "events": [ "message", "session.status" ], "hmac": null, "retries": null, "customHeaders": null } ], "debug": false }, "me": null, "engine": { "engine": "WEBJS" } } ]
That is after it’s been running for a while.. initially I get…
{ "statusCode": 500, "timestamp": "2024-05-04T02:07:33.531Z", "exception": { "stack": "ProtocolError: Protocol error (Page.captureScreenshot): Cannot take screenshot with 0 width.\n at /app/node_modules/whatsapp-web.js/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:329:24\n at new Promise (<anonymous>)\n at CDPSessionImpl.send (/app/node_modules/whatsapp-web.js/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:325:16)\n at CDPPage._CDPPage_screenshotTask (/app/node_modules/whatsapp-web.js/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Page.js:2591:77)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)", "name": "ProtocolError", "originalMessage": "Cannot take screenshot with 0 width.", "message": "Protocol error (Page.captureScreenshot): Cannot take screenshot with 0 width." }, "request": { "path": "/api/screenshot?session=default", "method": "GET", "body": {}, "query": { "session": "default" } }, "version": { "version": "2024.5.1", "engine": "WEBJS", "tier": "PLUS", "browser": "/usr/bin/chromium" } }
Sorry for asking, did you try to completely remove .sessions
folder? Or may be connect a new folder, .sessions2
As long as WhatsApp Web itself is loading, nothing we can do here :(
One more thing to try - using chrome based (not chromium) docker image
https://waha.devlike.pro/docs/how-to/engines/#docker-images
This one:
devlikeapro/whatsapp-http-api-plus:chrome
May be it's some sort of bug in chromium + whatsapp web
@5and0 is the account old one or new? With old one it can have too many messages in it, so syncing takes long (weird tho, we should get some logs there in that case)
@5and0 is the account old one or new? With old one it can have too many messages in it, so syncing takes long (weird tho, we should get some logs there in that case)
Old account, but not even getting to the point of logging in, so not sure how that would impact at this point.
Ok ... got it working with :chrome and version 2024.5.3 ... if I switch back to chromium I notice version is 2024.5.2 even after removing and pulling latest image.
Should I continue to use Chrome ? Even if it is saying "Update available" ? I have been logged out before by WhatsApp for using an unsupported device/version.
Should I continue to use Chrome ?
Yes please! idk why it doesn't work with chromium for you...
Even if it is saying "Update available"
That's fine, we pin exact version, so we don't get the latest version with unknown updates. We're working on supporting new version as well, but it's in "alpha" phase even in Meta.
Let me know if there's anything we can help you with!