devlikeapro / waha

WAHA - WhatsApp HTTP API (REST API) that you can configure in a click!
https://waha.devlike.pro/
Apache License 2.0
806 stars 247 forks source link

[BUG][WEBJS] - Not able to authenticate nor able to generate QR #350

Closed S1D007 closed 1 month ago

S1D007 commented 1 month ago

Describe the bug

Version

{
  "version": "2024.5.8",
  "engine": "WEBJS",
  "tier": "CORE",
  "browser": "/usr/bin/chromium"
}

Expected behavior I want my whatsapp to be logined here, but it is not generating QR, so need QR and i should able to login

Engine I'm using WEBJS engine.

Requests - Responses

{
  "name": "default",
  "config": {
    "proxy": null,
    "webhooks": [
      {
        "url": "https://httpbin.org/post",
        "events": [
          "message",
          "session.status"
        ],
        "hmac": null,
        "retries": null,
        "customHeaders": null
      }
    ],
    "debug": false
  }
}

Docker Logs ubuntu@ip-172-31-12-147:~$ docker run -it --rm -p 5003:3000/tcp --name whatsapp-http-api devlikeapro/whatsapp-http-api yarn run v1.22.19 $ node --unhandled-rejections=none dist/main WAHA (WhatsApp HTTP API) - Running CORE version... [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [NestFactory] Starting Nest application... [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [InstanceLoader] PassportModule dependencies initialized +28ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [InstanceLoader] ConfigHostModule dependencies initialized +1ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [InstanceLoader] TerminusModule dependencies initialized +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [InstanceLoader] ConfigModule dependencies initialized +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [InstanceLoader] ServeStaticModule dependencies initialized +2ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [InstanceLoader] AppModuleCore dependencies initialized +2ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RoutesResolver] AuthController {/api/:session/auth}: +98ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/auth/qr, GET} route +5ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/auth/request-code, POST} route +1ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/auth/authorize-code, POST} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/auth/captcha, GET} route +1ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/auth/captcha, POST} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RoutesResolver] SessionsController {/api/sessions}: +1ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/sessions/start, POST} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/sessions/stop, POST} route +1ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/sessions/logout, POST} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/sessions, GET} route +1ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/sessions/:session, GET} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RoutesResolver] SessionController {/api/sessions/:session}: +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/sessions/:session/me, GET} route +1ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RoutesResolver] ChattingController {/api}: +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/checkNumberStatus, GET} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/sendContactVcard, POST} route +1ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/sendText, GET} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/sendText, POST} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/sendPoll, POST} route +1ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/sendLocation, POST} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/sendLinkPreview, POST} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/sendImage, POST} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/sendFile, POST} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/sendVoice, POST} route +1ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/sendVideo, POST} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/reply, POST} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/sendSeen, POST} route +1ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/startTyping, POST} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/stopTyping, POST} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/reaction, PUT} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/star, PUT} route +1ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/messages, GET} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RoutesResolver] ChatsController {/api/:session/chats}: +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/chats, GET} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/chats/:chatId, DELETE} route +1ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/chats/:chatId/messages, GET} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/chats/:chatId/messages, DELETE} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/chats/:chatId/messages/:messageId, DELETE} route +1ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/chats/:chatId/messages/:messageId, PUT} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RoutesResolver] StatusController {/api/:session/status}: +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/status/text, POST} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/status/image, POST} route +1ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/status/voice, POST} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/status/video, POST} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RoutesResolver] ContactsController {/api/contacts}: +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/contacts, GET} route +1ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/contacts/all, GET} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/contacts/check-exists, GET} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/contacts/about, GET} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/contacts/profile-picture, GET} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/contacts/block, POST} route +1ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/contacts/unblock, POST} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RoutesResolver] GroupsController {/api/:session/groups}: +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/groups, POST} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/groups, GET} route +1ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/groups/:id, GET} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/groups/:id/settings/security/info-admin-only, PUT} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/groups/:id/settings/security/info-admin-only, GET} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/groups/:id/settings/security/messages-admin-only, PUT} route +1ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/groups/:id/settings/security/messages-admin-only, GET} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/groups/:id, DELETE} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/groups/:id/leave, POST} route +1ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/groups/:id/description, PUT} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/groups/:id/subject, PUT} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/groups/:id/invite-code, GET} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/groups/:id/invite-code/revoke, POST} route +1ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/groups/:id/participants, GET} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/groups/:id/participants/add, POST} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/groups/:id/participants/remove, POST} route +1ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/groups/:id/admin/promote, POST} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/groups/:id/admin/demote, POST} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RoutesResolver] PresenceController {/api/:session/presence}: +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/presence, POST} route +7ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/presence, GET} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/presence/:chatId, GET} route +1ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/:session/presence/:chatId/subscribe, POST} route +1ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RoutesResolver] ScreenshotController {/api}: +1ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/screenshot, GET} route +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RoutesResolver] VersionController {/api/version}: +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/api/version, GET} route +1ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RoutesResolver] HealthController {/health}: +0ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [RouterExplorer] Mapped {/health, GET} route +1ms [Nest] 30 - 05/26/2024, 12:09:46 PM LOG [NestApplication] Nest application successfully started +5ms WhatsApp HTTP API is running on: http://[::1]:3000 Environment: { version: '2024.5.8', engine: 'WEBJS', tier: 'CORE', browser: '/usr/bin/chromium' } [Nest] 30 - 05/26/2024, 12:09:58 PM LOG [SessionManager] 'default' - starting session... [Nest] 30 - 05/26/2024, 12:09:58 PM LOG [Webhook - default] Configuring webhooks for https://httpbin.org/post... [Nest] 30 - 05/26/2024, 12:09:58 PM LOG [Webhook - default] Event 'session.status' is enabled for url: https://httpbin.org/post [Nest] 30 - 05/26/2024, 12:09:58 PM LOG [Webhook - default] Webhooks were configured for https://httpbin.org/post. [Nest] 30 - 05/26/2024, 12:09:58 PM LOG [Webhook - default] Event 'message' is enabled for url: https://httpbin.org/post [Nest] 30 - 05/26/2024, 12:09:58 PM LOG [Webhook - default] Sending POST to https://httpbin.org/post... [Nest] 30 - 05/26/2024, 12:09:59 PM LOG [Webhook - default] POST request was sent with status code: 200 [Nest] 30 - 05/26/2024, 12:10:05 PM ERROR [WhatsappSession - default] ProtocolError: Waiting for selector [data-icon='search'] failed: Protocol error (Runtime.callFunctionOn): Target closed. [Nest] 30 - 05/26/2024, 12:10:05 PM LOG [Webhook - default] Sending POST to https://httpbin.org/post... [Nest] 30 - 05/26/2024, 12:10:06 PM LOG [Webhook - default] POST request was sent with status code: 200

Screenshots ![Uploading Screenshot 2024-05-26 at 5.43.43 PM.png…]()

devlikepro commented 1 month ago

@S1D007 hi! Could you share the screenshot? especially from GET /screenshot page

patron:PRO

devlikepro commented 1 month ago

Could you try to use

devlikeapro/whatsapp-http-api:chrome

image https://waha.devlike.pro/docs/how-to/engines/#docker-images

patron:PRO

S1D007 commented 1 month ago

yes it is working locally, but not in EC2 Instance, it just not able to scan code

S1D007 commented 1 month ago

@S1D007 hi! Could you share the screenshot? especially from GET /screenshot page

patron:PRO

I am getting Whatsapp Login QR code Page

devlikepro commented 1 month ago

Are you from India by any chance? Or you're using indian phone number? You can try a proxy https://waha.devlike.pro/docs/how-to/proxy/ If proxy doesn't help but it works on your local laptop - consider setting up a tunnel https://github.com/devlikeapro/whatsapp-http-api/issues/343#issuecomment-2130780175

patron:PRO

devlikepro commented 1 month ago

I am getting Whatsapp Login QR code Page

What exactly? Can not connect or forever "loading" and a error after?

patron:PRO

S1D007 commented 1 month ago

I am getting Whatsapp Login QR code Page

What exactly? Can not connect or forever "loading" and a error after?

patron:PRO

So basically when I try to create a session. It creates successfuly but when I try to scan the QR from whatsapp using screenshot method or /QR method both of them either giving me cannot connect to the device right now or it's loading in infinity. Working locally but not working in ec2 or any normal server. So yes I am from India

S1D007 commented 1 month ago

Can you help me setup proxy

devlikepro commented 1 month ago

The guide is pretty self explanatory https://waha.devlike.pro/docs/how-to/proxy/

{
  "name": "default",
  "config": {
    "proxy": {
      "server": "localhost:3128"
    }
  }
}

You can get a proxy from one of our tested solutions https://waha.devlike.pro/docs/how-to/proxy/#recommended-proxies

Keep in mind that it not always work, the last way to fix it - to setup WAHA locally and tunnel it (publish) to the internet using ngrok https://waha.devlike.pro/docs/how-to/proxy/#tunneling

patron:PRO