Skip to content

[Gows] - POST /api/sendFile to send a PDF document via WAHA, the API returns 500 Internal Server Error #1916

@Hardeep-indigital

Description

@Hardeep-indigital

When calling POST /api/sendFile to send a PDF document via WAHA, the API returns 500 Internal Server Error with a gRPC error:

2 UNKNOWN: failed to execute request:
Post "https://media-bom2-1.cdn.whatsapp.net/mms/document/...":
write tcp <internal-ip>:<port>-><remote-ip>:443:
write: connection reset by peer

Important:

  • Sending image files works correctly.
  • The issue occurs only when sending PDF documents.

Version

Output of GET /api/version:

{
  "version": "2026.1.4",
  "engine": "GOWS",
  "tier": "PLUS",
  "browser": null,
  "platform": "linux/x64",
  "worker": {
    "id": null
  }
}

Request Payload

POST /api/sendFile

{
  "chatId": "<redacted>@c.us",
  "file": {
    "mimetype": "application/pdf",
    "filename": "filename.pdf",
    "url": "https://<my-domain-redacted>/path/to/file.pdf"
  },
  "reply_to": null,
  "caption": "string",
  "session": "<redacted>"
}

Response

{
  "statusCode": 500,
  "exception": {
    "message": "2 UNKNOWN: failed to execute request: Post \"https://media-bom2-1.cdn.whatsapp.net/...\": write: connection reset by peer",
    "code": 2,
    "details": "connection reset by peer"
  }
}

Stack Trace Location

Failure occurs during:

  • WhatsappSessionGoWSPlus.sendMedia
  • WhatsappSessionGoWSPlus.sendFile

Expected Behavior

PDF file should upload successfully to WhatsApp CDN and return a valid message response (same behavior as image uploads).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions