-
-
Notifications
You must be signed in to change notification settings - Fork 604
Description
Description
Post a file (image or pdf) to "/api/{session}/send-file" with autoDownload: true and onSelfMessage: true
server will emit an event with error:
error: 2025-07-21T14:20:03.867Z message is missing critical data (mediaUrl
) needed to download the file. - Error: message is missing critical data (mediaUrl
) needed to download the file.
wpp-server | at Whatsapp. (/usr/src/wpp-server/node_modules/@wppconnect-team/wppconnect/dist/api/whatsapp.js:437:35)
wpp-server | at step (/usr/src/wpp-server/node_modules/@wppconnect-team/wppconnect/dist/api/whatsapp.js:97:23)
wpp-server | at Object.next (/usr/src/wpp-server/node_modules/@wppconnect-team/wppconnect/dist/api/whatsapp.js:78:53)
wpp-server | at /usr/src/wpp-server/node_modules/@wppconnect-team/wppconnect/dist/api/whatsapp.js:72:71
wpp-server | at new Promise ()
wpp-server | at __awaiter (/usr/src/wpp-server/node_modules/@wppconnect-team/wppconnect/dist/api/whatsapp.js:68:12)
wpp-server | at Whatsapp.decryptFile (/usr/src/wpp-server/node_modules/@wppconnect-team/wppconnect/dist/api/whatsapp.js:429:16)
wpp-server | at autoDownload (/usr/src/wpp-server/dist/util/functions.js:130:35)
wpp-server | at callWebHook (/usr/src/wpp-server/dist/util/functions.js:106:55)
wpp-server | at EventEmitter. (/usr/src/wpp-server/dist/util/createSessionUtil.js:226:97)
wpp-server | at EventEmitter.emit (node:events:518:28)
wpp-server | at /usr/src/wpp-server/node_modules/@wppconnect-team/wppconnect/dist/api/layers/listener.layer.js:154:87
Environment
- Wppconnect-server version(s): [2.8.6]
- Browser: [default]
- OS: Ubuntu 22.04]
- Node version: [22.17.0]
- WhatsApp version: [2.3000.10243x]
- MultiDevice (BETA): default, didn't change this option
- config.json:
import { ServerOptions } from './types/ServerOptions';
export default {
secretKey: 'secretKey',
host: 'http://localhost',
port: '21465',
deviceName: 'WppConnectAlpha',
poweredBy: 'WPPConnect-Server',
startAllSession: true,
tokenStoreType: 'file',
maxListeners: 15,
customUserDataDir: './userDataDir/',
webhook: {
url: 'http://192.168.0.106:7000/api/whatsapp/V1/webhook',
autoDownload: true,
uploadS3: false,
readMessage: true,
allUnreadOnStart: false,
listenAcks: true,
onPresenceChanged: false,
onParticipantsChanged: false,
onReactionMessage: true,
onPollResponse: true,
onRevokedMessage: false,
onLabelUpdated: true,
onSelfMessage: true,
ignore: ['status@broadcast'],
},
websocket: {
autoDownload: false,
uploadS3: false,
},
chatwoot: {
sendQrCode: true,
sendStatus: true,
},
archive: {
enable: false,
waitTime: 10,
daysToArchive: 45,
},
log: {
level: 'silly', // Before open a issue, change level to silly and retry a action
logger: ['console', 'file'],
},
createOptions: {
browserArgs: [
'--disable-web-security',
'--no-sandbox',
'--disable-web-security',
'--aggressive-cache-discard',
'--disable-cache',
'--disable-application-cache',
'--disable-offline-load-stale-cache',
'--disk-cache-size=0',
'--disable-background-networking',
'--disable-default-apps',
'--disable-extensions',
'--disable-sync',
'--disable-dev-shm-usage',
'--disable-gpu',
'--disable-translate',
'--hide-scrollbars',
'--metrics-recording-only',
'--mute-audio',
'--no-first-run',
'--safebrowsing-disable-auto-update',
'--ignore-certificate-errors',
'--ignore-ssl-errors',
'--ignore-certificate-errors-spki-list',
],
/**
* Example of configuring the linkPreview generator
* If you set this to 'null', it will use global servers; however, you have the option to define your own server
* Clone the repository https://github.com/wppconnect-team/wa-js-api-server and host it on your server with ssl
*
* Configure the attribute as follows:
* linkPreviewApiServers: [ 'https://www.yourserver.com/wa-js-api-server' ]
*/
linkPreviewApiServers: null,
},
mapper: {
enable: false,
prefix: 'tagone-',
},
db: {
mongodbDatabase: 'tokens',
mongodbCollection: '',
mongodbUser: '',
mongodbPassword: '',
mongodbHost: '',
mongoIsRemote: true,
mongoURLRemote: '',
mongodbPort: 27017,
redisHost: 'localhost',
redisPort: 6379,
redisPassword: '',
redisDb: 0,
redisPrefix: 'docker',
},
aws_s3: {
region: 'sa-east-1' as any,
access_key_id: null,
secret_key: null,
defaultBucketName: null,
endpoint: null,
forcePathStyle: null,
},
} as unknown as ServerOptions;
Steps to Reproduce
- set autoDownload = true and onselfmessage = true and enabled webhook
- post a file to /api/{session}/send-file
- get an error of a callback which tries to send data to a webhook
Log Output
If relevant, paste all of your Log Output
Your Code
If relevant, paste all of your challenge code in here
Additional context / Screenshot
Add any other context about the problem here. If applicable, add screenshots to help explain.