waha icon indicating copy to clipboard operation
waha copied to clipboard

[GOWS] All outbound messages fail with `server returned error 400` until session restart

Open bergpinheiro opened this issue 6 months ago • 41 comments

Note: Session names, phone numbers, and URLs in examples are fictional placeholders for privacy.


Summary

On GOWS engine, some sessions enter a state where every outbound message type fails with HTTP 500 and gRPC error server returned error 400. The WAHA dashboard still shows the session as WORKING.

Workaround that consistently fixes the problem: restart the session via POST /api/sessions/{session}/restart (stop + start, without deleting credentials or scanning QR again). After restart, text, image, audio, and video sends work again.

The issue is session-specific (other sessions on the same worker continue to work) and can affect all contacts for the broken session, not only one chatId.


Environment

Field Value
WAHA version 2026.4.2 (also observed on 2026.4.3)
Engine GOWS
Tier PLUS
Platform linux/x64
Worker ID waha_gowdy
Example session example_session_001
Example chatId [email protected]

Symptoms

  1. Session status remains WORKING in the dashboard/API.
  2. No outbound message type succeeds for that session:
    • Text (POST /api/sendText)
    • Image (POST /api/sendImage)
    • Audio / voice (POST /api/sendVoice, POST /api/sendAudio)
    • Video (POST /api/sendVideo)
    • Documents and other send endpoints that use MessageService.SendMessage over gRPC
  3. Inbound messages may still be received (not fully verified in all cases; worth confirming in logs).
  4. Sending from the physical phone may still work while the API fails (suggests desync between GOWS store/state and the linked device).
  5. Only some sessions are affected; other sessions on the same worker are fine.
  6. POST /api/sessions/{session}/restart restores sending for all message types without re-pairing (no new QR scan).

Error response (API)

HTTP 500 with body similar to:

{
  "statusCode": 500,
  "timestamp": "2026-05-18T22:20:44.455Z",
  "exception": {
    "message": "2 UNKNOWN: server returned error 400",
    "code": 2,
    "details": "server returned error 400",
    "metadata": {},
    "name": "Error"
  },
  "request": {
    "path": "/api/sendText",
    "method": "POST",
    "body": {
      "chatId": "[email protected]",
      "text": "...",
      "session": "example_session_001"
    }
  },
  "version": {
    "version": "2026.4.2",
    "engine": "GOWS",
    "tier": "PLUS",
    "worker": { "id": "waha_gowdy" }
  }
}

The same server returned error 400 occurs for video and other media endpoints.


Stack traces

sendText

Error: 2 UNKNOWN: server returned error 400
    at callErrorFromStatus (.../node_modules/@grpc/grpc-js/build/src/call.js:32:19)
    ...
    at MessageServiceClient.SendMessage (.../dist/core/engines/gows/grpc/gows.js:10502:30)
    at WhatsappSessionGoWSPlus.sendText (.../dist/core/engines/gows/session.gows.core.js:517:78)
    at descriptor.value (.../dist/core/abc/activity.js:9:35)

sendVideo

Error: 2 UNKNOWN: server returned error 400
    ...
    at MessageServiceClient.SendMessage (.../dist/core/engines/gows/grpc/gows.js:10502:30)
    at WhatsappSessionGoWSPlus.sendMedia (.../dist/plus/engines/gows/session.gows.plus.js:185:16)
    at WhatsappSessionGoWSPlus.sendVideo (.../dist/plus/engines/gows/session.gows.plus.js:213:16)

Both paths call the same gRPC method: MessageService.SendMessage.


Example requests that failed

Text

POST /api/sendText
Content-Type: application/json

{
  "session": "example_session_001",
  "chatId": "[email protected]",
  "text": "Hello"
}

Video

POST /api/sendVideo
Content-Type: application/json

{
  "session": "example_session_001",
  "chatId": "[email protected]",
  "caption": "Example",
  "convert": false,
  "file": {
    "url": "https://example.com/video.mp4",
    "mimetype": "video/mp4",
    "filename": "video.mp4"
  }
}

Media download and temp-file preparation complete successfully; failure happens only at SendMessage (WhatsApp server rejects with code 400).


Workaround (confirmed)

POST /api/sessions/example_session_001/restart

After restart:

  • Session returns to WORKING
  • sendText, sendImage, sendVoice/sendAudio, sendVideo, etc. work again
  • No session delete and no new QR pairing required

If restart stops working in the future, full session recreate (delete + QR) may still be needed; so far restart alone is sufficient.


patron:PRO

bergpinheiro avatar May 19 '26 13:05 bergpinheiro

I had the same error here. Only way to fix was restarting the session. Log: {"statusCode":500,"timestamp":"2026-05-19T10:51:08.623Z","exception":{"message":"2 UNKNOWN: server returned error 400","code":2,"details":"server returned error 400","metadata":{},"name":"Error","stack":"Error: 2 UNKNOWN: server returned error 400\n at callErrorFromStatus (/app/node_modules/@grpc/grpc-js/build/src/call.js:32:19)\n at Object.onReceiveStatus (/app/node_mggows.js:10456:30)\n at node:internal/util:495:21\n at new Promise ()\n at node:internal/util:481:12\n at WhatsappSessionGoWSPlus.sendText (/app/dist/core/engines/gows/session.gows.core.js:517:78)\n at descriptor.value (/app/dist/core/abc/activity.js:9:35ode_modules/@grpc/grpc-js/build/src/resolving-call.js:135:78\n at process.processTicksAndRejections (node:internal/process/task_queues:84:11)\nfor call at\n at MessageServiceClient.makeUnaryRequest (/app/node_modules/@grpc/grpc-js/build”src/client.js:161:32)\n at MessageServiceClient.SendMessage (/app/node_modules/@grpc/grpc-js/build/src/make-client.js:105:19)\n at MessageServiceClient.SendMessage (/app/dist/core/engines/gows/grpc/gows.js:10456:30)\n at node:internal/util:495:21\n at new Promise ()\n at node:internal/util:481:12\n at WhatsappSessionGoWSPlus.sendText (/app/dist/core/engines/gows/session.gows.core.js:517:78)\n at descriptor.value (/app/dist/core/abc/activity.js:9:35)\n at process.processTicksAndRejections (node:internal/process/task_queues:103:5)"},"request":{"path":"/api/sendText","method":"POST","body":{"chatId":"[email protected]","text":"Vendedor1:\nTeste envio","session":"7_8_XXXXXXXXXXX"},"query":{}},"version":{"version":"2026.2.2","engine":"GOWS","tier":"PLUS","browser":null,"platform":"linux/x64","worker":{"id":null}}}

mhaxabreu avatar May 19 '26 13:05 mhaxabreu

Same issue here.

{"statusCode":500,"timestamp":"2026-05-19T13:50:00.954Z","exception":{"message":"2 UNKNOWN: server returned error 400","code":2,"details":"server returned error 400","metadata":{},"name":"Error","stack":"Error: 2 UNKNOWN: server returned error 400\n at callErrorFromStatus (/app/node_modules/@grpc/grpc-js/build/src/call.js:32:19)\n at Object.onReceiveStatus (/app/node_modules/@grpc/grpc-js/build/src/client.js:193:76)\n at Object.onReceiveStatus (/app/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:367:141)\n at Object.onReceiveStatus (/app/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:327:181)\n at /app/node_modules/@grpc/grpc-js/build/src/resolving-call.js:135:78\n at process.processTicksAndRejections (node:internal/process/task_queues:84:11)\nfor call at\n at MessageServiceClient.makeUnaryRequest (/app/node_modules/@grpc/grpc-js/build/src/client.js:161:32)\n at MessageServiceClient.SendMessage (/app/node_modules/@grpc/grpc-js/build/src/make-client.js:105:19)\n at MessageServiceClient.SendMessage (/app/dist/core/engines/gows/grpc/gows.js:10502:30)\n at node:internal/util:495:21\n at new Promise ()\n at node:internal/util:481:12\n at WhatsappSessionGoWSPlus.sendText (/app/dist/core/engines/gows/session.gows.core.js:517:78)\n at descriptor.value (/app/dist/core/abc/activity.js:9:35)\n at process.processTicksAndRejections (node:internal/process/task_queues:103:5)"},"request":{"path":"/api/sendText","method":"POST","body":{"chatId":"[email protected]","text":"🕒 Previsão Horário de Entrega: 15:00 Hrs \n(Pode chegar antes ou atrasar) \n\n⚠️ Motoboy te mandará mensagem. \nResponda ele, Ok*","session":"89_368_5581984300103"},"query":{}},"version":{"version":"2026.4.2","engine":"GOWS","tier":"PLUS","browser":null,"platform":"linux/x64","worker":{"id":"waha_gowdy"}}}

johnhenderson avatar May 19 '26 15:05 johnhenderson

I'm getting the same problem, @devlikepro if you can urgently address this issue

patron:PLUS

vhiperdev avatar May 19 '26 15:05 vhiperdev

+1

patron:PRO

mxyzt avatar May 19 '26 15:05 mxyzt

+1

patron:PLUS

silvabw2 avatar May 19 '26 15:05 silvabw2

+1

patron:PLUS

joaoanzolim avatar May 19 '26 15:05 joaoanzolim

+1

patron:PLUS

WilliamSantos96 avatar May 19 '26 15:05 WilliamSantos96

same issue...

API Error: Request failed with status code 500 Data: { "statusCode": 500, "timestamp": "2026-05-19T18:50:16.823Z", "exception": { "message": "2 UNKNOWN: server returned error 400", "code": 2, "details": "server returned error 400", "metadata": {}, "name": "Error", "stack": "Error: 2 UNKNOWN: server returned error 400\n at callErrorFromStatus (/app/node_modules/@grpc/grpc-js/build/src/call.js:32:19)\n at Object.onReceiveStatus (/app/node_modules/@grpc/grpc-js/build/src/client.js:193:76)\n at Object.onReceiveStatus (/app/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:367:141)\n at Object.onReceiveStatus (/app/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:327:181)\n at /app/node_modules/@grpc/grpc-js/build/src/resolving-call.js:135:78\n at process.processTicksAndRejections (node:internal/process/task_queues:84:11)\nfor call at\n at MessageServiceClient.makeUnaryRequest (/app/node_modules/@grpc/grpc-js/build/src/client.js:161:32)\n at MessageServiceClient.SendMessage (/app/node_modules/@grpc/grpc-js/build/src/make-client.js:105:19)\n at MessageServiceClient.SendMessage (/app/dist/core/engines/gows/grpc/gows.js:10502:30)\n at node:internal/util:495:21\n at new Promise ()\n at node:internal/util:481:12\n at WhatsappSessionGoWSPlus.sendText (/app/dist/core/engines/gows/session.gows.core.js:517:78)\n at descriptor.value (/app/dist/core/abc/activity.js:9:35)\n at process.processTicksAndRejections (node:internal/process/task_queues:103:5)" }, "request": { "path": "/api/sendText", "method": "POST", "body": { "session": "CFC....", "chatId": "[email protected]", "text": "Tem certeza", "linkPreview": false, "linkPreviewHighQuality": false, "mentions": null }, "query": {} }, "version": { "version": "2026.4.2", "engine": "GOWS", "tier": "PLUS", "browser": null, "platform": "linux/x64", "worker": { "id": null } } }

brunocicom avatar May 19 '26 15:05 brunocicom

+1

patron:PLUS

ecocentauro-git avatar May 19 '26 15:05 ecocentauro-git

+1

mana-gsoares avatar May 19 '26 15:05 mana-gsoares

+1

patron:PLUS

OrionZap avatar May 19 '26 15:05 OrionZap

+1

patron:PLUS

nishit321 avatar May 19 '26 17:05 nishit321

I'm getting the same problem, @waha-plus if you can urgently address this issue #

gorillamkt avatar May 19 '26 19:05 gorillamkt

+1

patron:PLUS

douglasvillar avatar May 19 '26 20:05 douglasvillar

+1

dev01kasterweb avatar May 19 '26 20:05 dev01kasterweb

+1

patron:PLUS

jayveloper avatar May 19 '26 22:05 jayveloper

+1

simao-moreira avatar May 20 '26 08:05 simao-moreira

+1

Miguel-Git1 avatar May 20 '26 09:05 Miguel-Git1

+1

DiegoAugustusCunha avatar May 20 '26 13:05 DiegoAugustusCunha

+1

Gug4negrao avatar May 20 '26 14:05 Gug4negrao