-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
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):
ACTIVE_STORAGE_SERVICE=s3_compatible STORAGE_ENDPOINT=https://s3.wasabisys.com -
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:
WAHA_MEDIA_SEND_DELAY_MS=5000or
WAHA_APPS_JOBS_BACKOFF=5000 -
Alternatively, WAHA could check file availability (HTTP 200) before proceeding.