waha icon indicating copy to clipboard operation
waha copied to clipboard

[GOWS] Error 463 on sendText — tctoken lifecycle not implemented in GOWS engine

Open joaoAPina opened this issue 7 months ago • 14 comments

Describe the bug

Outbound messages sent via POST /api/sendText fail with HTTP 500 / error 463 when using the GOWS engine for specific contacts, even though the session is WORKING, inbound messages arrive normally, and messages sent directly from the physical device succeed.

We run 30 active WAHA instances (GOWS engine, different phone numbers). This is the first session we have ever seen this issue on. The failure affected 14 different contacts in that single session — all returning the same error 463 — while other instances continued operating normally. The issue occurs regardless of chatId format (@c.us or @lid).


Version

{
  "version": "2026.3.2",
  "engine": "GOWS",
  "tier": "PLUS"
}

Steps

To Reproduce:

  1. Start a WAHA session using the GOWS engine — session reaches WORKING state
  2. Confirm inbound messages are being received normally
  3. Send a message from the physical device — succeeds
  4. Call POST /api/sendText with a valid session and chatId
  5. Receive HTTP 500 with "2 UNKNOWN: server returned error 463"

Expected behavior

POST /api/sendText should succeed for any contact reachable from the device, matching the behavior of the physical device and the WEBJS engine.


Requests - Responses

Request:

POST /api/sendText
{
  "session": "<session-id>",
  "chatId": "[email protected]",
  "text": "Hello"
}

Response (HTTP 500):

{
  "error": "2 UNKNOWN: server returned error 463"
}

Tested with both @c.us and @lid chatId formats — both return the same error 463.


Docker Logs

Failed to send text message | status=500 | errorMessage="Request failed with status code 500" | session=<session-id> | [email protected]

Screenshots

Session status in WAHA dashboard:

  • Status: WORKING
  • Account: authenticated and active
  • Server: WAHA

Additional context

After investigating, we believe this is caused by the absence of the tctoken lifecycle in the GOWS engine.

WhatsApp now requires a valid privacy token (tctoken) in every outbound DM. When the token is missing or expired, the server rejects the message with error 463 (NackCallerReachoutTimelocked). This is not a session issue — the session is WORKING, receives messages, and the physical device sends without problems.

This was addressed in whatsmeow via:

  • tulir/whatsmeow#1081 — full tctoken lifecycle: proactive fetch before send, 28-day expiration window, async token issuance after send
  • tulir/whatsmeow#1104 — diagnostic APIs for account-level capping and reachout timelock

WEBJS does not reproduce this issue, suggesting the fix is already present there. GOWS appears to be missing the equivalent implementation.

Could the GOWS engine receive parity with the tctoken handling from whatsmeow PR #1081?

joaoAPina avatar Apr 25 '26 17:04 joaoAPina

+1

@devlikepro any deadline for this fix?

patron:PLUS

Jaedson-Digiliza avatar Apr 27 '26 12:04 Jaedson-Digiliza

+1

patron:PRO

onicolasz avatar Apr 29 '26 02:04 onicolasz

✅ Let's try dev image

Make sure to select the engine via the environment variable - WHATSAPP_DEFAULT_ENGINE=WEBJS|GOWS|NOWEB:

  • devlikeapro/waha-plus:dev
  • devlikeapro/waha-plus:dev-chrome
  • devlikeapro/waha-plus:dev-arm

patron:PRO

devlikepro avatar Apr 29 '26 05:04 devlikepro

Didn't work

{
  "statusCode": 500,
  "timestamp": "2026-04-29T15:51:11.414Z",
  "exception": {
    "message": "2 UNKNOWN: server returned error 463",
    "code": 2,
    "details": "server returned error 463",
    "metadata": {},
    "name": "Error",
    "stack": "Error: 2 UNKNOWN: server returned error 463\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 (<anonymous>)\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": "<number>@c.us",
      "text": "<message>",
      "session": "<session>"
    },
    "query": {}
  },
  "version": {
    "version": "2026.4.3",
    "engine": "GOWS",
    "tier": "PLUS",
    "browser": null,
    "platform": "linux/x64",
    "worker": {
      "id": null
    }
  }
}

patron:PLUS

Jaedson-Digiliza avatar Apr 29 '26 15:04 Jaedson-Digiliza

+1

patron:PLUS

m0d02x avatar Apr 29 '26 16:04 m0d02x

Have you checked if that specific connected number has any restrictions?

patron:PRO

bergpinheiro avatar May 02 '26 22:05 bergpinheiro

Você já verificou se esse número específico de conexão tem alguma restrição?

patrono: PRO

Sim, aparentemente não tem

joaoAPina avatar May 04 '26 02:05 joaoAPina

2026.4.3 - GOWS - Add tctoken lifecycle - #2050

patron:PRO

devlikepro avatar May 07 '26 07:05 devlikepro

463 still occurs on 2026.5.1 after session re-creation — tctoken not refreshed even with recent inbound messages

Hi @devlikepro — reopening with new evidence, as the tctoken lifecycle fix from 2026.4.3 does not seem to cover the session re-creation scenario.

Setup: WAHA Plus, GOWS engine, PostgreSQL session storage, 4 sessions on one instance. Trigger: I logged out and re-created a session reusing the same name (to keep the Chatwoot inbox/history). After that, POST /api/sendText started failing with error 463 for pre-existing contacts. Key behavior (this is the important part):

The contact sends me a message first (inbound arrives normally, session is WORKING). I reply → 463.

Sending from the physical device does not reliably refresh the token either — the contact messages me, I reply, and it still 463s.

Same result with both @c.us and @lid chatId formats.

Contacts that have never been "batched" with failed attempts sometimes work; heavily-retried contacts stay locked.

Versions tested: 2026.5.1 (where it appeared after upgrade) and 2026.4.3 (downgraded to test the original fix) — behavior persists on both. So the tctoken lifecycle does not appear to be triggered/refreshed for contacts inherited by a re-created session, even with fresh inbound activity. Engine: GOWS PLUS, platform linux/x64.

Could the tctoken proactive-fetch logic be extended to cover contacts whose session was re-created (i.e. force a token fetch on inbound or before send when the local token is missing)?

Happy to provide logs/session IDs privately.

patron:PLUS

gustavo-mamedep avatar Jun 09 '26 16:06 gustavo-mamedep

463 still occurs on 2026.5.1 after session re-creation — tctoken not refreshed even with recent inbound messages

Hi @devlikepro — reopening with new evidence, as the tctoken lifecycle fix from 2026.4.3 does not seem to cover the session re-creation scenario.

Setup: WAHA Plus, GOWS engine, PostgreSQL session storage, 4 sessions on one instance. Trigger: I logged out and re-created a session reusing the same name (to keep the Chatwoot inbox/history). After that, POST /api/sendText started failing with error 463 for pre-existing contacts. Key behavior (this is the important part):

The contact sends me a message first (inbound arrives normally, session is WORKING). I reply → 463.

Sending from the physical device does not reliably refresh the token either — the contact messages me, I reply, and it still 463s.

Same result with both @c.us and @lid chatId formats.

Contacts that have never been "batched" with failed attempts sometimes work; heavily-retried contacts stay locked.

Versions tested: 2026.5.1 (where it appeared after upgrade) and 2026.4.3 (downgraded to test the original fix) — behavior persists on both. So the tctoken lifecycle does not appear to be triggered/refreshed for contacts inherited by a re-created session, even with fresh inbound activity. Engine: GOWS PLUS, platform linux/x64.

Could the tctoken proactive-fetch logic be extended to cover contacts whose session was re-created (i.e. force a token fetch on inbound or before send when the local token is missing)?

Happy to provide logs/session IDs privately.

patron:PLUS

yep, same happens to me at GOWS (2026.5.1 PLUS)

dionisioviei avatar Jun 11 '26 12:06 dionisioviei

This issue is affecting my setup in a very specific and reproducible way involving two contacts. I have already performed full session resets in WAHA to ensure a clean state, including deleting the affected sessions and recreating them from scratch. The environment has been correctly configured since the initial deployment, following the official documentation and required environment variables.

Despite these actions, the issue persists consistently and only occurs for these two specific contacts. All other sessions and contacts within the same environment continue to operate normally without any issues.

From an operational perspective, the system behaves as expected up to the point of sending the message, where the failure occurs. No further mitigation steps have been identified that resolve or bypass the behavior at this stage.

I also tried sending the message directly through the Chat UI (after deleting and recreating the chat), but the same error still occurs. This helps rule out any issue in my integration layer, indicating that the problem is occurring within the WAHA bot itself when handling these specific contacts.

tiagomurtinhoo avatar Jun 26 '26 16:06 tiagomurtinhoo

I have the same issue here. GOWS (2026.7.1 CORE) Existing chat. Inbound works, sending hits 463 Sending from the device works

{ "statusCode": 500, "timestamp": "2026-07-29T20:08:33.891Z", "exception": { "message": "2 UNKNOWN: server returned error 463", "code": 2, "details": "server returned error 463", "metadata": {}, "name": "Error", "stack": "Error: 2 UNKNOWN: server returned error 463\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:10650:30)\n at node:internal/util:495:21\n at new Promise ()\n at node:internal/util:481:12\n at WhatsappSessionGoWSCore.sendText (/app/dist/core/engines/gows/session.gows.core.js:594:78)\n at descriptor.value (/app/dist/core/abc/activity.js:9:35)\n at process.processTicksAndRejections (node:internal/process/task_queues:103:5)" },

patron:PLUS

doronca avatar Jul 29 '26 20:07 doronca

2026.7.2 - GOWS, NOWEB, WEBJS - server returned error 463 when messaging new contacts - Reachout Timelock - #2166

patron:PRO

bergpinheiro avatar Jul 29 '26 20:07 bergpinheiro