Skip to content

[Chatwoot Integration] WAHA attempts to send media before upload is complete on external storage (Wasabi S3)Β #1445

@MrDandi79

Description

@MrDandi79

When integrating Chatwoot β†’ WAHA (GoWS Plus) with external S3-compatible storage (Wasabi), WAHA attempts to send the media file before the upload is fully propagated or publicly accessible, resulting in a 404 error.

This leads to 2–3 failed attempts before the final retry succeeds.


πŸ’‘ Steps to reproduce

  1. Configure Chatwoot with external Active Storage (Wasabi S3):

    ACTIVE_STORAGE_SERVICE=s3_compatible STORAGE_ENDPOINT=https://s3.wasabisys.com
  2. Connect WAHA Plus (GoWS) to Chatwoot via /api/sendFile.

  3. Send a large attachment (e.g. 15–30 MB ZIP or XLSX).

  4. Observe WAHA logs:

    • First attempt β†’ AxiosError: 404

    • Second attempt β†’ AxiosError: 404

    • Third attempt β†’ success.


🧠 Expected behavior

WAHA should wait a few seconds before attempting to download and send the file, or allow configuration of a delay (backoff) between upload and media fetch.


βš™οΈ Current behavior

  • WAHA calls fileToMedia() immediately after receiving the webhook from Chatwoot.

  • At this point, the file URL (Active Storage redirect) still points to an object that isn't yet available in Wasabi.

  • WAHA retries automatically but without a configurable delay, resulting in multiple unnecessary 404s.


🧩 Suggested solution

  • Introduce an environment variable to delay the first attempt of media download, such as:

    WAHA_MEDIA_SEND_DELAY_MS=5000

    or

    WAHA_APPS_JOBS_BACKOFF=5000
  • Alternatively, WAHA could check file availability (HTTP 200) before proceeding.


🧾 Environment

Component | Version -- | -- WAHA Version | 2025.9.7 (Plus, GoWS) Chatwoot | 3.x (Active Storage + Wasabi) Storage | Wasabi S3 (s3.wasabisys.com) OS | Ubuntu 24.04 (Easypanel VPS, 8GB RAM, 100GB SSD)
``

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions