Baileys: [BUG] No session found to decrypt message

Describe the bug I have a server with 15 connected whatsapp users. I find this on the log from time to time:

{
  "level": 50,
  "time": 1718906974900,
  "pid": 41327,
  "hostname": "ip-xxx-xxx-xxx-xxx",
  "key": {
    "remoteJid": "xxx@g.us",
    "fromMe": false,
    "id": "xxx",
    "participant": "xxx@s.whatsapp.net"
  },
  "err": {
    "type": "Error",
    "message": "No session found to decrypt message",
    "stack": "Error: No session found to decrypt message\n at xxx@g.us::xxx::0 [as awaitable]   
     (/baileys/WASignalGroup/group_cipher.js:54:15)
     at async asyncQueueExecutor (/baileys/WASignalGroup/queue_job.js:20:29)"
  },
  "msg": "failed to decrypt message"
}

To Reproduce Don’t know how to reproduce, it happens from time to time on a server with 15 connected whatsapp users.

Expected behavior No errors on the log

Environment (please complete the following information):

  • Is this on a server? yes
  • What do your connectOptions look like?
const { version, isLatest } = await fetchLatestBaileysVersion()
const { state, saveCreds } = await useMultiFileAuthState('myPath')
const msgRetryCounterCache = new NodeCache()

        async function getMessage(key)  {
            if(store) {
                const msg = await store.loadMessage(key.remoteJid, key.id)
                return msg?.message || undefined
            }
            // only if store is present
            return proto.Message.fromObject({})
        }

 makeWASocket({
            version,
            logger,
            printQRInTerminal: false,
            mobile: false,
            auth: {
                creds: state.creds,
                keys: makeCacheableSignalKeyStore(state.keys, logger),
            },
            msgRetryCounterCache,
            generateHighQualityLinkPreview: true,
            // ignore broadcast and newsletter messages
            shouldIgnoreJid: jid => !jid || isJidBroadcast(jid) || isJidNewsletter(jid),
            // implement to handle retries & poll updates
            getMessage,
            shouldSyncHistoryMessage: () => true,
            markOnlineOnConnect: false
        })
  • Do you have multiple clients on the same IP? yes, 15 clients
  • Are you using a proxy? no

Additional context Using baileys v6.7.5

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 20 (2 by maintainers)

Most upvoted comments

Experiencing this with MongoDB

Hey! The session is missing from your auth state. I hope all of you describe your auth state (multi-file, mysql etc.)

I am working behind the scenes on a revamp to the auth key storage situation since they are getting lost it seems