Skip to content

[WEBJS] - Error when receiving audio #1733

@mauricioaniche

Description

@mauricioaniche

Describe the bug

Sometimes I get a event webhook about an audio, but no file comes. If I inspect the message, I see an error. Below is a log of a user that sent 4 audio messages in a row and all of them had this error:

{"rawBody": "{\"id\":\"evt_01kcj4pkh12hm0kddqq38hs10a\",\"timestamp\":1765840473634,\"event\":\"message.any\",\"session\":\"session-2-2\",\"metadata\":{},\"me\":{\"id\":\"ANONYMIZED\",\"pushName\":\"ANONYMIZED\"},\"payload\":{\"id\":\"ANONYMIZED\",\"timestamp\":1765840470,\"from\":\"ANONYMIZED\",\"fromMe\":false,\"source\":\"app\",\"to\":\"ANONYMIZED\",\"body\":\"\",\"hasMedia\":true,\"media\":{\"url\":null,\"filename\":null,\"mimetype\":\"audio/ogg; codecs=opus\",\"error\":{\"name\":\"TypeError\",\"details\":\"TypeError: Cannot read properties of undefined (reading 'addAnnotations')\
https://static.whatsapp.net/rsrc.php/v4iu2q4/ys/l/pt_BR-j/lDvVH2LgP1Q.js:1143:1963\
Generator.next (<anonymous>)\
    at #evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/ExecutionContext.js:391:56)\
    at async ExecutionContext.evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/ExecutionContext.js:277:16)\
    at async IsolatedWorld.evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/IsolatedWorld.js:100:16)\
    at async CdpFrame.evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/api/Frame.js:364:20)\
    at async CdpPage.evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/api/Page.js:822:20)\
    at async WPage.evaluate (/app/dist/core/engines/webjs/WPage.js:13:20)\
    at async Message.downloadMedia (/app/node_modules/whatsapp-web.js/src/structures/Message.js:452:24)\
    at async MediaManager.fetchMedia (/app/dist/core/media/MediaManager.js:95:24)\
    at async MediaManager.withRetry (/app/dist/core/media/MediaManager.js:119:20)\
    at async MediaManager.processMediaInternal (/app/dist/core/media/MediaManager.js:55:28)\
    at async MediaManager.processMedia (/app/dist/core/media/MediaManager.js:82:26)\
    at async WhatsappSessionWebJSPlus.downloadMedia (/app/dist/core/engines/webjs/session.webjs.core.js:1218:23)\
    at async WhatsappSessionWebJSPlus.downloadMediaSafe (/app/dist/core/engines/webjs/session.webjs.core.js:1208:20)\
    at async WhatsappSessionWebJSPlus.processIncomingMessage (/app/dist/core/engines/webjs/session.webjs.core.js:1086:27)\
    at <anonymous> (https://static.whatsapp.net/rsrc.php/v4iu2q4/ys/l/pt_BR-j/lDvVH2LgP1Q.js:1142:2969)\
    at <anonymous> (https://static.whatsapp.net/rsrc.php/v4/yC/r/F9511sy6u10.js:106:276)\"}},\"ack\":1,\"ackName\":\"SERVER\",\"location\":null,\"vCards\":[],\"_data\":{\"id\":{\"fromMe\":false,\"remote\":\"ANONYMIZED\",\"id\":\"AC09A8C9A43AAA95B506F67FE6F66F83\",\"_serialized\":\"ANONYMIZED\"},\"viewed\":false,\"type\":\"ptt\",\"t\":1765840470,\"clientReceivedTsMillis\":1765840471146,\"notifyName\":\"ANONYMIZED\",\"from\":\"ANONYMIZED\",\"to\":\"ANONYMIZED\",\"ack\":1,\"invis\":false,\"isNewMsg\":true,\"star\":false,\"kicNotified\":false,\"recvFresh\":true,\"deprecatedMms3Url\":\"SOME URL\",\"directPath\":\"SOMEURL\",\"mimetype\":\"audio/ogg; codecs=opus\",\"duration\":\"1\",\"filehash\":\"jXf1XwTYxlqETZxe6LVZU9J2N3qkWn+I5qmIs0dLiAA=\",\"encFilehash\":\"Fhl3BvaEiCZ61uJ8mpJOK9YtAtHb8H5x5M2/r5HLhOI=\",\"size\":3486,\"mediaKey\":\"SOME KEY",\"mediaKeyTimestamp\":1765840469,\"isViewOnce\":false,\"waveform\":{\"0\":0,\"1\":4,\"2\":9,\"3\":15,\"4\":21,\"5\":20,\"6\":19,\"7\":19,\"8\":20,\"9\":24,\"10\":29,\"11\":26,\"12\":23,\"13\":33,\"14\":44,\"15\":43,\"16\":43,\"17\":35,\"18\":28,\"19\":34,\"20\":40,\"21\":40,\"22\":40,\"23\":41,\"24\":43,\"25\":47,\"26\":52,\"27\":54,\"28\":57,\"29\":56,\"30\":55,\"31\":59,\"32\":64,\"33\":38,\"34\":13,\"35\":6,\"36\":0,\"37\":20,\"38\":41,\"39\":43,\"40\":45,\"41\":42,\"42\":40,\"43\":38,\"44\":36,\"45\":34,\"46\":33,\"47\":22,\"48\":11,\"49\":8,\"50\":6,\"51\":12,\"52\":19,\"53\":18,\"54\":18,\"55\":13,\"56\":8,\"57\":12,\"58\":17,\"59\":15,\"60\":14,\"61\":7,\"62\":0,\"63\":0},\"isFromTemplate\":false,\"isAdsMedia\":false,\"pollInvalidated\":false,\"isSentCagPollCreation\":false,\"latestEditMsgKey\":null,\"latestEditSenderTimestampMs\":null,\"mentionedJidList\":[],\"groupMentions\":[],\"isEventCanceled\":false,\"eventInvalidated\":false,\"isVcardOverMmsDocument\":false,\"isForwarded\":false,\"isQuestion\":false,\"questionReplyQuotedMessage\":null,\"questionResponsesCount\":0,\"readQuestionResponsesCount\":0,\"forwardsCount\":0,\"labels\":[],\"hasReaction\":false,\"viewMode\":\"VISIBLE\",\"messageSecret\":{\"0\":88,\"1\":65,\"2\":62,\"3\":190,\"4\":204,\"5\":164,\"6\":203,\"7\":187,\"8\":69,\"9\":65,\"10\":148,\"11\":36,\"12\":120,\"13\":226,\"14\":152,\"15\":172,\"16\":84,\"17\":75,\"18\":8,\"19\":174,\"20\":82,\"21\":227,\"22\":18,\"23\":186,\"24\":161,\"25\":38,\"26\":53,\"27\":83,\"28\":167,\"29\":160,\"30\":132,\"31\":122},\"productHeaderImageRejected\":false,\"lastPlaybackProgress\":0,\"isDynamicReplyButtonsMsg\":false,\"isCarouselCard\":false,\"parentMsgId\":null,\"callSilenceReason\":null,\"isVideoCall\":false,\"callDuration\":null,\"callCreator\":null,\"callParticipants\":null,\"isCallLink\":null,\"callLinkToken\":null,\"isMdHistoryMsg\":false,\"stickerSentTs\":0,\"isAvatar\":false,\"lastUpdateFromServerTs\":0,\"invokedBotWid\":null,\"bizBotType\":null,\"botResponseTargetId\":null,\"botPluginType\":null,\"botPluginReferenceIndex\":null,\"botPluginSearchProvider\":null,\"botPluginSearchUrl\":null,\"botPluginSearchQuery\":null,\"botPluginMaybeParent\":false,\"botReelPluginThumbnai--lCdnUrl\":null,\"botMessageDisclaimerText\":null,\"botMsgBodyType\":null,\"reportingTokenInfo\":{\"reportingToken\":{\"0\":182,\"1\":76,\"2\":102,\"3\":200,\"4\":200,\"5\":198,\"6\":180,\"7\":145,\"8\":85,\"9\":100,\"10\":148,\"11\":58,\"12\":43,\"13\":198,\"14\":21,\"15\":7},\"version\":2,\"reportingTag\":{\"0\":1,\"1\":14,\"2\":107,\"3\":58,\"4\":3,\"5\":177,\"6\":40,\"7\":227,\"8\":23,\"9\":185,\"10\":161,\"11\":49,\"12\":100,\"13\":171,\"14\":177,\"15\":177,\"16\":100,\"17\":160,\"18\":186,\"19\":148}},\"requiresDirectConnection\":null,\"bizContentPlaceholderType\":null,\"hostedBizEncStateMismatch\":false,\"senderOrRecipientAccountTypeHosted\":false,\"placeholderCreatedWhenAccountIsHosted\":false,\"groupHistoryBundleMessageKey\":null,\"groupHistoryBundleMetadata\":null,\"nonJidMentions\":null,\"links\":[]}},\"engine\":\"WEBJS\",\"environment\":{\"version\":\"2025.11.4\",\"engine\":\"WEBJS\",\"tier\":\"PLUS\",\"browser\":\"/usr/bin/google-chrome-stable\"}}", "request": {"event": "message.any", "payload": {"id": "ANONYMIZED", "to": "ANONYMIZED", "body": "", "from": "ANONYMIZED", "_data": {"key": null, "notifyName": "Elizabeth Vitória"}, "empty": false, "media": {"url": null, "error": {"details": "TypeError: Cannot read properties of undefined (reading 'addAnnotations')
https://static.whatsapp.net/rsrc.php/v4iu2q4/ys/l/pt_BR-j/lDvVH2LgP1Q.js:1143:1963
Generator.next (<anonymous>)
    at #evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/ExecutionContext.js:391:56)
    at async ExecutionContext.evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/ExecutionContext.js:277:16)
    at async IsolatedWorld.evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/IsolatedWorld.js:100:16)
    at async CdpFrame.evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/api/Frame.js:364:20)
    at async CdpPage.evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/api/Page.js:822:20)
    at async WPage.evaluate (/app/dist/core/engines/webjs/WPage.js:13:20)
    at async Message.downloadMedia (/app/node_modules/whatsapp-web.js/src/structures/Message.js:452:24)
    at async MediaManager.fetchMedia (/app/dist/core/media/MediaManager.js:95:24)
    at async MediaManager.withRetry (/app/dist/core/media/MediaManager.js:119:20)
    at async MediaManager.processMediaInternal (/app/dist/core/media/MediaManager.js:55:28)
    at async MediaManager.processMedia (/app/dist/core/media/MediaManager.js:82:26)
    at async WhatsappSessionWebJSPlus.downloadMedia (/app/dist/core/engines/webjs/session.webjs.core.js:1218:23)
    at async WhatsappSessionWebJSPlus.downloadMediaSafe (/app/dist/core/engines/webjs/session.webjs.core.js:1208:20)
    at async WhatsappSessionWebJSPlus.processIncomingMessage (/app/dist/core/engines/webjs/session.webjs.core.js:1086:27)
    at <anonymous> (https://static.whatsapp.net/rsrc.php/v4iu2q4/ys/l/pt_BR-j/lDvVH2LgP1Q.js:1142:2969)
    at <anonymous> (https://static.whatsapp.net/rsrc.php/v4/yC/r/F9511sy6u10.js:106:276)"}, "filename": null, "mimetype": "audio/ogg; codecs=opus"}, "fromMe": false, "status": null, "ackName": "SERVER", "isVideo": null, "replyTo": null, "hasMedia": true, "mimeType": "audio/ogg; codecs=opus", "reaction": null, "timestamp": 1765840470, "editedMessageId": null, "revokedMessageId": null}, "session": "session-2-2"}}

Version

Get the WAHA version by calling GET /api/version

{"version":"2025.11.4","engine":"WEBJS","tier":"PLUS","browser":"/usr/bin/google-chrome-stable"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions