WhiskeySockets / Baileys

Lightweight full-featured typescript/javascript WhatsApp Web API
https://baileys.whiskeysockets.io/
MIT License
3.09k stars 1.06k forks source link

[BUG] Error: `myAppStateKey` not present #588

Open SuhailTechInfo opened 5 months ago

SuhailTechInfo commented 5 months ago

Whenever i try to use ChatModify for pin, clear, mute and unmute etc.. in chat Modification, I always stucked and got below Error

{
 Error: myAppStateKey ("AAAAAP5+") not present
      at encodeSyncdPatch (D:\Assinments\Suhail_Md_v3\node_modules\@whiskeysockets\baileys\lib\Utils\chat-utils.js:105:15)
      at async D:\Assinments\Suhail_Md_v3\node_modules\@whiskeysockets\baileys\lib\Socket\chats.js:555:32
      at async Object.transaction (D:\Assinments\Suhail_Md_v3\node_modules\@whiskeysockets\baileys\lib\Utils\auth-utils.js:136:26)
      at async D:\Assinments\Suhail_Md_v3\node_modules\@whiskeysockets\baileys\lib\Socket\chats.js:550:13
      at async D:\Assinments\Suhail_Md_v3\node_modules\@whiskeysockets\baileys\lib\Utils\make-mutex.js:18:36
      at async appPatch (D:\Assinments\Suhail_Md_v3\node_modules\@whiskeysockets\baileys\lib\Socket\chats.js:549:9)
      at async Object.function (D:\Assinments\Suhail_Md_v3\plugins\_main.js:2750:12) {
    data: null,
    isBoom: true,
    isServer: false,
    output: { statusCode: 404, payload: [Object], headers: {} }
  }
}
const msg = {
      id: m.id,
      fromMe: false,
      timestamp: Math.floor(Date.now() * 1 / 1000)
    };
let data = await Suhail_MD.chatModify( { clear: { messages: [msg] }, } ,m.jid )
console.log({data})
AbhishekSuresh2 commented 5 months ago

Yes i have same error

officialdittaz commented 5 months ago

Screenshot inside your session folder

SuhailTechInfo commented 5 months ago

Screenshot inside your session folder

Session directory files

Screenshot_2024_0124_074022

Creds data:

{
  noiseKey: {
    private: <Buffer f8 a4 71 ba 98 73 ff 8f bc fc 89 07 00 e4 41 34 af 1d ba 32 e9 98 b7 6d 3a 08 32 72 cf 5f 8c 50>,
    public: <Buffer 07 d2 03 2f 3b 54 57 1a 9b 8e 76 0c db 39 b9 5e c5 58 74 c8 f4 42 0c 68 1f 54 91 45 18 14 78 32>
  },
  pairingEphemeralKeyPair: {
    private: <Buffer 28 59 af 39 73 3d 9f c7 6f e8 c3 99 0f 6c d5 f0 18 82 98 40 4d d8 88 7b a2 26 6d 83 e7 3e b4 74>,
    public: <Buffer 44 59 7c d6 c1 01 b7 70 74 83 3b f3 67 ca 2b 2d f9 11 0c 23 c4 73 3c 00 fd 7c 59 a3 a1 9e 95 24>
  },
  signedIdentityKey: {
    private: <Buffer 78 cb af af 28 6d a0 ef 46 8d 1d d3 09 c2 9d 6d b8 d1 12 72 ac 4c 2f 2c 99 fd 3c 97 2c c3 ad 59>,
    public: <Buffer a0 ae b8 ff 9c 63 46 39 cc 2b af ed 1c 04 fc f0 2b 36 69 dd 60 16 60 c2 68 d8 8d 8b 85 1c 65 26>
  },
  signedPreKey: {
    keyPair: {
      private: <Buffer 18 67 11 0c bc bc 51 71 8b 2c ab 26 dc ba 51 cd 27 67 29 1e 49 aa f3 14 85 71 56 b4 55 74 f9 43>,
      public: <Buffer 0f 26 1c d3 a5 d2 17 5e 97 17 92 5b 89 6d e9 a1 a4 73 ad d1 05 9d 4f 44 ea 57 38 03 6a 70 8f 6d>
    },
    signature: <Buffer 1a 2d 64 4e 34 9c 7c 90 30 39 ab de f6 a5 21 8b dd 78 d6 d5 cc 8d bd b2 50 76 4c 85 9c 8d d8 55 83 b0 4a 4e 2c 03 d6 7e 7d 16 0b f0 b7 f5 06 7b fe 46 ... 14 more bytes>,
    keyId: 1
  },
  registrationId: 100,
  advSecretKey: 'Pbtvz4KsHyRtl5DjU2BhyRt3zCSQ6baR3YlPguTOOH4=',
  processedHistoryMessages: [ { key: [Object], messageTimestamp: 1700476880 } ],
  nextPreKeyId: 63,
  firstUnuploadedPreKeyId: 63,
  accountSyncCounter: 1,
  accountSettings: { unarchiveChats: false },
  deviceId: 'oLpmmRosRU66DloZFP3W5A',
  phoneId: '31b67804-023e-49ba-b32c-813f6a3d215d',
  identityId: <Buffer e9 c0 6d 5b cd 88 bb 3e 7c d7 42 c6 6e 96 0b 49 c1 ec 7a c8>,
  registered: false,
  backupToken: <Buffer fc 6c 5d 5f cc 9a 72 85 46 54 f2 d1 46 e1 7c 4a c0 4c 1a 68>,
  registration: {},
  account: {
    details: 'CJ/Ovo4GEMLv7KoGGBw=',
    accountSignatureKey: 'JcdHn+yu26reju4F50gw/qnhJvdli/P4KLLVV8g8/TM=',
    accountSignature: '5+XAweLIOc4c++GNqfP2dkT+9Muzh19Cp+e/ezRXt4v2q+PErQ48lqpytclR91tGkyF8BpjHYekJ+p9RbW64AA==',
    deviceSignature: 'Iho/ZUKsaadBD6ccJtPO2OXw63XAIcRWmUpcgMi98H+6vs0JFU1gB0ofvb1p46C00+7VJQvz+NrBDKhtrIi8iQ=='
  },
  me: { id: '923184474176:24@s.whatsapp.net', name: 'سᷝـͥــᷧــͪــͧــᷤہیل' },
  signalIdentities: [
    {
      identifier: [Object],
      identifierKey: <Buffer 05 25 c7 47 9f ec ae db aa de 8e ee 05 e7 48 30 fe a9 e1 26 f7 65 8b f3 f8 28 b2 d5 57 c8 3c fd 33>
    }
  ],
  platform: 'android',
  lastAccountSyncTimestamp: 1700476869,
  myAppStateKeyId: 'AAAAAH9v'
}
Maher-Zubair commented 5 months ago

Yes i am also facing the same issue 🤪🤪😁

I-NRL commented 5 months ago

Am also😂

SuhailTechInfo commented 5 months ago

Am also😂 Bruh, Are you kidding on us 😂.

Coz your bot support ChatModify function

mdev-imagenet commented 5 months ago

In my case, I resolved it this way:

Look inside the session folder for the file: app-state-sync-key-XXXXXXXXX.json (Where XXXXXXXXX is the id found in the error myAppStateKey ("XXXXXXXXX ") not present)

If it doesn't exist, just delete the session folder and reconnect the number.

I hope this helps.

SuhailTechInfo commented 5 months ago

In my case, I resolved it this way:

Look inside the session folder for the file: app-state-sync-key-XXXXXXXXX.json (Where XXXXXXXXX is the id found in the error myAppStateKey ("XXXXXXXXX ") not present)

If it doesn't exist, just delete the session folder and reconnect the number.

I hope this helps.

Ahh i was forget to close this issue!

THANKS FOR YOUR RESPONCE! (mark helpfull)

PurpShell commented 1 month ago

Not a good fix!