[Chatwoot Integration] WAHA attempts to send media before upload is complete on external storage (Wasabi S3)
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
-
Configure Chatwoot with external Active Storage (Wasabi S3):
-
Connect WAHA Plus (GoWS) to Chatwoot via
/api/sendFile. -
Send a large attachment (e.g. 15โ30 MB ZIP or XLSX).
-
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:
or
-
Alternatively, WAHA could check file availability (HTTP 200) before proceeding.