evolution-api icon indicating copy to clipboard operation
evolution-api copied to clipboard

Evolution + Chatwoot + Whatsapp Cloud API | Sending media files not working

Open EnriqueGF opened this issue 8 months ago • 11 comments

Welcome!

  • [x] Yes, I have searched for similar issues on GitHub and found none.

What did you do?

Hello,

I have a correctly configured instance of Evolution and Chatwood, all is working and I can send and receive messages, and also receive media files from the chats.

But when I try to upload a media file, it shown up on Chatwood, but it fails in the Evolution API part.

This is the generated log when I try to upload a file:

[Evolution API] [Whatsapp Business] v2.2.3 198 - Wed Apr 02 2025 09:08:52 ERROR [ChannelStartupService] [object] TypeError: Cannot read properties of undefined (reading 'name') at FormData._getContentDisposition (/evolution/node_modules/form-data/lib/form_data.js:227:40) at FormData._multiPartHeader (/evolution/node_modules/form-data/lib/form_data.js:178:33) at FormData.append (/evolution/node_modules/form-data/lib/form_data.js:71:21) at ls.getIdMedia (/evolution/dist/main.js:221:1700) at ls.prepareMediaMessage (/evolution/dist/main.js:221:2432) at ls.mediaMessage (/evolution/dist/main.js:221:2648) at Re.sendAttachment (/evolution/dist/main.js:82:10618) at Re.receiveWebhook (/evolution/dist/main.js:84:243) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async fi.dataValidate (/evolution/dist/main.js:286:62716)

Chatwoot seems to be correctly uploading the file (it shown up in the UI etc) but when it comes to Evolution API, it fails sending the media back to the Whatsapp Cloud API

Any help would be appreciated

What did you expect?

The file being sent to Whatsapp Cloud API

What did you observe instead of what you expected?

Error uploading the file

Screenshots/Videos

Image

Which version of the API are you using?

2.2.3

What is your environment?

Docker

Other environment specifications

No response

If applicable, paste the log output

[Evolution API] [Whatsapp Business] v2.2.3 198 - Wed Apr 02 2025 09:08:52 ERROR [ChannelStartupService] [object] TypeError: Cannot read properties of undefined (reading 'name') at FormData._getContentDisposition (/evolution/node_modules/form-data/lib/form_data.js:227:40) at FormData._multiPartHeader (/evolution/node_modules/form-data/lib/form_data.js:178:33) at FormData.append (/evolution/node_modules/form-data/lib/form_data.js:71:21) at ls.getIdMedia (/evolution/dist/main.js:221:1700) at ls.prepareMediaMessage (/evolution/dist/main.js:221:2432) at ls.mediaMessage (/evolution/dist/main.js:221:2648) at Re.sendAttachment (/evolution/dist/main.js:82:10618) at Re.receiveWebhook (/evolution/dist/main.js:84:243) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async fi.dataValidate (/evolution/dist/main.js:286:62716)

Additional Notes

No response

EnriqueGF avatar Apr 02 '25 13:04 EnriqueGF

Same here

marcosvb1 avatar Apr 03 '25 15:04 marcosvb1

Same here

henrique062 avatar Apr 04 '25 10:04 henrique062

Same here

jhonmolano09 avatar Apr 05 '25 13:04 jhonmolano09

aqui igual

orabanal avatar Apr 06 '25 07:04 orabanal

Help!

joseeavrs avatar Apr 06 '25 23:04 joseeavrs

Image

this was the issue, guys whatsapp.business.service.ts file

obviously after changing that, you have to rebuild/restart

FiniAppBr avatar Apr 11 '25 17:04 FiniAppBr

Image

this was the issue, guys whatsapp.business.service.ts file

obviously after changing that, you have to rebuild/restart

Where is the issue? Can you explain?

ajudanet avatar Apr 12 '25 01:04 ajudanet

Image

this was the issue, guys whatsapp.business.service.ts file

obviously after changing that, you have to rebuild/restart

That in fact seems to be wrong, but I changed it and I get the same error, it occurs before calling the media endpoint when its preparing the form data (undefined "name")

It seems that Evolution is correctly receiving the chatwoot webhook api call, but something get wrong when it tries to get the data from the media file.

EnriqueGF avatar Apr 12 '25 12:04 EnriqueGF

i can send 200x200 resolution ok, but when i try to send image with 1000x600 resolution, this same error occurs.

osmarkozanjr avatar Apr 28 '25 20:04 osmarkozanjr

i can send 200x200 resolution ok, but when i try to send image with 1000x600 resolution, this same error occurs.

WTF! It couldn't be more random!

TheEmanuelSampaio avatar May 20 '25 17:05 TheEmanuelSampaio

#1475

TheEmanuelSampaio avatar May 20 '25 17:05 TheEmanuelSampaio

UP! same here

agencia904 avatar Jul 23 '25 15:07 agencia904