Skip to content

[BUG] error bad-request when I try to get the profilePicture with profilePictureUrl("xyz@g.us") #904

Description

@Yago-Tavares

Describe the bug
I'm trying to get the contact profile picture who send me message, but I receive the follow error:

Error: bad-request
    at assertNodeErrorFree (C:\Users\devs\Documents\xama\backend\node_modules\@whiskeysockets\baileys\lib\WABinary\generic-utils.js:56:15)
    at query (C:\Users\devs\Documents\xama\backend\node_modules\@whiskeysockets\baileys\lib\Socket\socket.js:145:48)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Object.profilePictureUrl (C:\Users\devs\Documents\xama\backend\node_modules\@whiskeysockets\baileys\lib\Socket\chats.js:442:24)
    at async verifyContact (C:\Users\devs\Documents\xama\backend\dist\services\WbotServices\wbotMessageListener.js:439:25)
    at async handleMessage (C:\Users\devs\Documents\xama\backend\dist\services\WbotServices\wbotMessageListener.js:1441:25)
    at async EventEmitter.<anonymous> (C:\Users\devs\Documents\xama\backend\dist\services\WbotServices\wbotMessageListener.js:1849:21) {
  data: 400,
  isBoom: true,
  isServer: true,
  output: {
    statusCode: 500,
    payload: {
      statusCode: 500,
      error: 'Internal Server Error',
      message: 'An internal server error occurred'
    },
    headers: {}
  }
}

The message contact id is valid

To Reproduce
Steps to reproduce the behavior:

  1. Created a new connection
  2. Receive a new message
  3. Try get the profile picture with the message ID

Expected behavior
Return the url picture

Environment (please complete the following information):

  • Is this on a server? Yes
  • What do your connectOptions look like?
let wsocket: Session = null;
      const store = makeInMemoryStore({
        logger: loggerBaileys
      });

      const {state, saveState} = await authState(whatsapp);

      const msgRetryCounterCache = new NodeCache();

      wsocket = makeWASocket({
        logger: loggerBaileys,
        printQRInTerminal: false,
        browser: Browsers.appropriate("Desktop"),
        auth: {
          creds: state.creds,
          keys: makeCacheableSignalKeyStore(state.keys, logger),
        },
        version,
        msgRetryCounterCache,
        shouldIgnoreJid: jid => isJidBroadcast(jid),
        defaultQueryTimeoutMs: undefined,
      });

  • Do you have multiple clients on the same IP? No
  • Are you using a proxy? Yes

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions