Schmavery / facebook-chat-api

Unofficial Facebook Chat API for Nodejs
MIT License
1.94k stars 597 forks source link

500 & 404 error code #782

Open lukyrys opened 4 years ago

lukyrys commented 4 years ago

I have often returning error. Version 1.6.1

WARN parseAndCheckLogin Got status code 500 - 1. attempt to retry in 3382 milliseconds...
ERR! markAsRead Error: parseAndCheckLogin got status code: 404. Bailing out of trying to parse response.
ERR! markAsRead     at /home/pogo/fb/node_modules/facebook-chat-api/utils.js:1042:15
ERR! markAsRead     at tryCatcher (/home/pogo/fb/node_modules/bluebird/js/main/util.js:26:23)
ERR! markAsRead     at Function.Promise.attempt.Promise.try (/home/pogo/fb/node_modules/bluebird/js/main/method.js:31:24)
ERR! markAsRead     at /home/pogo/fb/node_modules/facebook-chat-api/utils.js:989:24
ERR! markAsRead     at tryCatcher (/home/pogo/fb/node_modules/bluebird/js/main/util.js:26:23)
ERR! markAsRead     at Promise._settlePromiseFromHandler (/home/pogo/fb/node_modules/bluebird/js/main/promise.js:510:31)
ERR! markAsRead     at Promise._settlePromiseAt (/home/pogo/fb/node_modules/bluebird/js/main/promise.js:584:18)
ERR! markAsRead     at Async._drainQueue (/home/pogo/fb/node_modules/bluebird/js/main/async.js:128:12)
ERR! markAsRead     at Async._drainQueues (/home/pogo/fb/node_modules/bluebird/js/main/async.js:133:10)
ERR! markAsRead     at Immediate.Async.drainQueues [as _onImmediate] (/home/pogo/fb/node_modules/bluebird/js/main/async.js:15:14)
ERR! markAsRead     at runCallback (timers.js:705:18)
ERR! markAsRead     at tryOnImmediate (timers.js:676:5)
ERR! markAsRead     at processImmediate (timers.js:658:5)
ERR! markAsRead  Error: parseAndCheckLogin got status code: 404. Bailing out of trying to parse response.
ERR! markAsRead     at /home/pogo/fb/node_modules/facebook-chat-api/utils.js:1042:15
ERR! markAsRead     at tryCatcher (/home/pogo/fb/node_modules/bluebird/js/main/util.js:26:23)
ERR! markAsRead     at Function.Promise.attempt.Promise.try (/home/pogo/fb/node_modules/bluebird/js/main/method.js:31:24)
ERR! markAsRead     at /home/pogo/fb/node_modules/facebook-chat-api/utils.js:989:24
ERR! markAsRead     at tryCatcher (/home/pogo/fb/node_modules/bluebird/js/main/util.js:26:23)
ERR! markAsRead     at Promise._settlePromiseFromHandler (/home/pogo/fb/node_modules/bluebird/js/main/promise.js:510:31)
ERR! markAsRead     at Promise._settlePromiseAt (/home/pogo/fb/node_modules/bluebird/js/main/promise.js:584:18)
ERR! markAsRead     at Async._drainQueue (/home/pogo/fb/node_modules/bluebird/js/main/async.js:128:12)
ERR! markAsRead     at Async._drainQueues (/home/pogo/fb/node_modules/bluebird/js/main/async.js:133:10)
ERR! markAsRead     at Immediate.Async.drainQueues [as _onImmediate] (/home/pogo/fb/node_modules/bluebird/js/main/async.js:15:14)
ERR! markAsRead     at runCallback (timers.js:705:18)
ERR! markAsRead     at tryOnImmediate (timers.js:676:5)
ERR! markAsRead     at processImmediate (timers.js:658:5)
Error: parseAndCheckLogin got status code: 404. Bailing out of trying to parse response.
    at /home/pogo/fb/node_modules/facebook-chat-api/utils.js:1042:15
    at tryCatcher (/home/pogo/fb/node_modules/bluebird/js/main/util.js:26:23)
    at Function.Promise.attempt.Promise.try (/home/pogo/fb/node_modules/bluebird/js/main/method.js:31:24)
    at /home/pogo/fb/node_modules/facebook-chat-api/utils.js:989:24
    at tryCatcher (/home/pogo/fb/node_modules/bluebird/js/main/util.js:26:23)
    at Promise._settlePromiseFromHandler (/home/pogo/fb/node_modules/bluebird/js/main/promise.js:510:31)
    at Promise._settlePromiseAt (/home/pogo/fb/node_modules/bluebird/js/main/promise.js:584:18)
    at Async._drainQueue (/home/pogo/fb/node_modules/bluebird/js/main/async.js:128:12)
    at Async._drainQueues (/home/pogo/fb/node_modules/bluebird/js/main/async.js:133:10)
    at Immediate.Async.drainQueues [as _onImmediate] (/home/pogo/fb/node_modules/bluebird/js/main/async.js:15:14)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)
BadAimWeeb commented 4 years ago

did you try using bleeding edge?

Theblood commented 4 years ago

@lequanglam how is it used? , help me plis!

Schmavery commented 4 years ago

@lukyrys @Theblood I just published 1.7.0, you can try that and see if it helps. https://www.npmjs.com/package/facebook-chat-api/v/1.7.0

lukyrys commented 4 years ago

@Schmavery problem persist with 1.7.0

ERR! markAsRead Error: parseAndCheckLogin got status code: 404. Bailing out of trying to parse response.
ERR! markAsRead     at /home/pogo/fb/node_modules/facebook-chat-api/utils.js:1042:15
ERR! markAsRead     at tryCatcher (/home/pogo/fb/node_modules/bluebird/js/main/util.js:26:23)
ERR! markAsRead     at Function.Promise.attempt.Promise.try (/home/pogo/fb/node_modules/bluebird/js/main/method.js:31:24)
ERR! markAsRead     at /home/pogo/fb/node_modules/facebook-chat-api/utils.js:989:24
ERR! markAsRead     at tryCatcher (/home/pogo/fb/node_modules/bluebird/js/main/util.js:26:23)
ERR! markAsRead     at Promise._settlePromiseFromHandler (/home/pogo/fb/node_modules/bluebird/js/main/promise.js:510:31)
ERR! markAsRead     at Promise._settlePromiseAt (/home/pogo/fb/node_modules/bluebird/js/main/promise.js:584:18)
ERR! markAsRead     at Async._drainQueue (/home/pogo/fb/node_modules/bluebird/js/main/async.js:128:12)
ERR! markAsRead     at Async._drainQueues (/home/pogo/fb/node_modules/bluebird/js/main/async.js:133:10)
ERR! markAsRead     at Immediate.Async.drainQueues [as _onImmediate] (/home/pogo/fb/node_modules/bluebird/js/main/async.js:15:14)
ERR! markAsRead     at runCallback (timers.js:705:18)
ERR! markAsRead     at tryOnImmediate (timers.js:676:5)
ERR! markAsRead     at processImmediate (timers.js:658:5)
ERR! markAsRead  Error: parseAndCheckLogin got status code: 404. Bailing out of trying to parse response.
ERR! markAsRead     at /home/pogo/fb/node_modules/facebook-chat-api/utils.js:1042:15
ERR! markAsRead     at tryCatcher (/home/pogo/fb/node_modules/bluebird/js/main/util.js:26:23)
ERR! markAsRead     at Function.Promise.attempt.Promise.try (/home/pogo/fb/node_modules/bluebird/js/main/method.js:31:24)
ERR! markAsRead     at /home/pogo/fb/node_modules/facebook-chat-api/utils.js:989:24
ERR! markAsRead     at tryCatcher (/home/pogo/fb/node_modules/bluebird/js/main/util.js:26:23)
ERR! markAsRead     at Promise._settlePromiseFromHandler (/home/pogo/fb/node_modules/bluebird/js/main/promise.js:510:31)
ERR! markAsRead     at Promise._settlePromiseAt (/home/pogo/fb/node_modules/bluebird/js/main/promise.js:584:18)
ERR! markAsRead     at Async._drainQueue (/home/pogo/fb/node_modules/bluebird/js/main/async.js:128:12)
ERR! markAsRead     at Async._drainQueues (/home/pogo/fb/node_modules/bluebird/js/main/async.js:133:10)
ERR! markAsRead     at Immediate.Async.drainQueues [as _onImmediate] (/home/pogo/fb/node_modules/bluebird/js/main/async.js:15:14)
ERR! markAsRead     at runCallback (timers.js:705:18)
ERR! markAsRead     at tryOnImmediate (timers.js:676:5)
ERR! markAsRead     at processImmediate (timers.js:658:5)
Error: parseAndCheckLogin got status code: 404. Bailing out of trying to parse response.
    at /home/pogo/fb/node_modules/facebook-chat-api/utils.js:1042:15
    at tryCatcher (/home/pogo/fb/node_modules/bluebird/js/main/util.js:26:23)
    at Function.Promise.attempt.Promise.try (/home/pogo/fb/node_modules/bluebird/js/main/method.js:31:24)
    at /home/pogo/fb/node_modules/facebook-chat-api/utils.js:989:24
    at tryCatcher (/home/pogo/fb/node_modules/bluebird/js/main/util.js:26:23)
    at Promise._settlePromiseFromHandler (/home/pogo/fb/node_modules/bluebird/js/main/promise.js:510:31)
    at Promise._settlePromiseAt (/home/pogo/fb/node_modules/bluebird/js/main/promise.js:584:18)
    at Async._drainQueue (/home/pogo/fb/node_modules/bluebird/js/main/async.js:128:12)
    at Async._drainQueues (/home/pogo/fb/node_modules/bluebird/js/main/async.js:133:10)
    at Immediate.Async.drainQueues [as _onImmediate] (/home/pogo/fb/node_modules/bluebird/js/main/async.js:15:14)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)
Theblood commented 4 years ago

found error, is a 404 code not exist "https://www.facebook.com/chat/user_info_all"

BadAimWeeb commented 4 years ago

found error, is a 404 code not exist "https://www.facebook.com/chat/user_info_all"

you can't access these link by typing it into address bar. btw markAsRead is perfectly fine here, not sure why.

CatalizCS commented 4 years ago

@Schmavery problem persist with 1.7.0

ERR! markAsRead Error: parseAndCheckLogin got status code: 404. Bailing out of trying to parse response.
ERR! markAsRead     at /home/pogo/fb/node_modules/facebook-chat-api/utils.js:1042:15
ERR! markAsRead     at tryCatcher (/home/pogo/fb/node_modules/bluebird/js/main/util.js:26:23)
ERR! markAsRead     at Function.Promise.attempt.Promise.try (/home/pogo/fb/node_modules/bluebird/js/main/method.js:31:24)
ERR! markAsRead     at /home/pogo/fb/node_modules/facebook-chat-api/utils.js:989:24
ERR! markAsRead     at tryCatcher (/home/pogo/fb/node_modules/bluebird/js/main/util.js:26:23)
ERR! markAsRead     at Promise._settlePromiseFromHandler (/home/pogo/fb/node_modules/bluebird/js/main/promise.js:510:31)
ERR! markAsRead     at Promise._settlePromiseAt (/home/pogo/fb/node_modules/bluebird/js/main/promise.js:584:18)
ERR! markAsRead     at Async._drainQueue (/home/pogo/fb/node_modules/bluebird/js/main/async.js:128:12)
ERR! markAsRead     at Async._drainQueues (/home/pogo/fb/node_modules/bluebird/js/main/async.js:133:10)
ERR! markAsRead     at Immediate.Async.drainQueues [as _onImmediate] (/home/pogo/fb/node_modules/bluebird/js/main/async.js:15:14)
ERR! markAsRead     at runCallback (timers.js:705:18)
ERR! markAsRead     at tryOnImmediate (timers.js:676:5)
ERR! markAsRead     at processImmediate (timers.js:658:5)
ERR! markAsRead  Error: parseAndCheckLogin got status code: 404. Bailing out of trying to parse response.
ERR! markAsRead     at /home/pogo/fb/node_modules/facebook-chat-api/utils.js:1042:15
ERR! markAsRead     at tryCatcher (/home/pogo/fb/node_modules/bluebird/js/main/util.js:26:23)
ERR! markAsRead     at Function.Promise.attempt.Promise.try (/home/pogo/fb/node_modules/bluebird/js/main/method.js:31:24)
ERR! markAsRead     at /home/pogo/fb/node_modules/facebook-chat-api/utils.js:989:24
ERR! markAsRead     at tryCatcher (/home/pogo/fb/node_modules/bluebird/js/main/util.js:26:23)
ERR! markAsRead     at Promise._settlePromiseFromHandler (/home/pogo/fb/node_modules/bluebird/js/main/promise.js:510:31)
ERR! markAsRead     at Promise._settlePromiseAt (/home/pogo/fb/node_modules/bluebird/js/main/promise.js:584:18)
ERR! markAsRead     at Async._drainQueue (/home/pogo/fb/node_modules/bluebird/js/main/async.js:128:12)
ERR! markAsRead     at Async._drainQueues (/home/pogo/fb/node_modules/bluebird/js/main/async.js:133:10)
ERR! markAsRead     at Immediate.Async.drainQueues [as _onImmediate] (/home/pogo/fb/node_modules/bluebird/js/main/async.js:15:14)
ERR! markAsRead     at runCallback (timers.js:705:18)
ERR! markAsRead     at tryOnImmediate (timers.js:676:5)
ERR! markAsRead     at processImmediate (timers.js:658:5)
Error: parseAndCheckLogin got status code: 404. Bailing out of trying to parse response.
    at /home/pogo/fb/node_modules/facebook-chat-api/utils.js:1042:15
    at tryCatcher (/home/pogo/fb/node_modules/bluebird/js/main/util.js:26:23)
    at Function.Promise.attempt.Promise.try (/home/pogo/fb/node_modules/bluebird/js/main/method.js:31:24)
    at /home/pogo/fb/node_modules/facebook-chat-api/utils.js:989:24
    at tryCatcher (/home/pogo/fb/node_modules/bluebird/js/main/util.js:26:23)
    at Promise._settlePromiseFromHandler (/home/pogo/fb/node_modules/bluebird/js/main/promise.js:510:31)
    at Promise._settlePromiseAt (/home/pogo/fb/node_modules/bluebird/js/main/promise.js:584:18)
    at Async._drainQueue (/home/pogo/fb/node_modules/bluebird/js/main/async.js:128:12)
    at Async._drainQueues (/home/pogo/fb/node_modules/bluebird/js/main/async.js:133:10)
    at Immediate.Async.drainQueues [as _onImmediate] (/home/pogo/fb/node_modules/bluebird/js/main/async.js:15:14)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)

same problem here, any update ? D41C20AC-D96C-4227-8CF1-3617FBDC7F13

BadAimWeeb commented 4 years ago

oh well, i'm currently testing markAsSeen (required before calling markAsRead) on my forked repository fca-unofficial (somehow it's missing here, even through it's required)

j4pa0 commented 4 years ago

@Schmavery problem persist with 1.7.0

ERR! markAsRead Error: parseAndCheckLogin got status code: 404. Bailing out of trying to parse response.
ERR! markAsRead     at /home/pogo/fb/node_modules/facebook-chat-api/utils.js:1042:15
ERR! markAsRead     at tryCatcher (/home/pogo/fb/node_modules/bluebird/js/main/util.js:26:23)
ERR! markAsRead     at Function.Promise.attempt.Promise.try (/home/pogo/fb/node_modules/bluebird/js/main/method.js:31:24)
ERR! markAsRead     at /home/pogo/fb/node_modules/facebook-chat-api/utils.js:989:24
ERR! markAsRead     at tryCatcher (/home/pogo/fb/node_modules/bluebird/js/main/util.js:26:23)
ERR! markAsRead     at Promise._settlePromiseFromHandler (/home/pogo/fb/node_modules/bluebird/js/main/promise.js:510:31)
ERR! markAsRead     at Promise._settlePromiseAt (/home/pogo/fb/node_modules/bluebird/js/main/promise.js:584:18)
ERR! markAsRead     at Async._drainQueue (/home/pogo/fb/node_modules/bluebird/js/main/async.js:128:12)
ERR! markAsRead     at Async._drainQueues (/home/pogo/fb/node_modules/bluebird/js/main/async.js:133:10)
ERR! markAsRead     at Immediate.Async.drainQueues [as _onImmediate] (/home/pogo/fb/node_modules/bluebird/js/main/async.js:15:14)
ERR! markAsRead     at runCallback (timers.js:705:18)
ERR! markAsRead     at tryOnImmediate (timers.js:676:5)
ERR! markAsRead     at processImmediate (timers.js:658:5)
ERR! markAsRead  Error: parseAndCheckLogin got status code: 404. Bailing out of trying to parse response.
ERR! markAsRead     at /home/pogo/fb/node_modules/facebook-chat-api/utils.js:1042:15
ERR! markAsRead     at tryCatcher (/home/pogo/fb/node_modules/bluebird/js/main/util.js:26:23)
ERR! markAsRead     at Function.Promise.attempt.Promise.try (/home/pogo/fb/node_modules/bluebird/js/main/method.js:31:24)
ERR! markAsRead     at /home/pogo/fb/node_modules/facebook-chat-api/utils.js:989:24
ERR! markAsRead     at tryCatcher (/home/pogo/fb/node_modules/bluebird/js/main/util.js:26:23)
ERR! markAsRead     at Promise._settlePromiseFromHandler (/home/pogo/fb/node_modules/bluebird/js/main/promise.js:510:31)
ERR! markAsRead     at Promise._settlePromiseAt (/home/pogo/fb/node_modules/bluebird/js/main/promise.js:584:18)
ERR! markAsRead     at Async._drainQueue (/home/pogo/fb/node_modules/bluebird/js/main/async.js:128:12)
ERR! markAsRead     at Async._drainQueues (/home/pogo/fb/node_modules/bluebird/js/main/async.js:133:10)
ERR! markAsRead     at Immediate.Async.drainQueues [as _onImmediate] (/home/pogo/fb/node_modules/bluebird/js/main/async.js:15:14)
ERR! markAsRead     at runCallback (timers.js:705:18)
ERR! markAsRead     at tryOnImmediate (timers.js:676:5)
ERR! markAsRead     at processImmediate (timers.js:658:5)
Error: parseAndCheckLogin got status code: 404. Bailing out of trying to parse response.
    at /home/pogo/fb/node_modules/facebook-chat-api/utils.js:1042:15
    at tryCatcher (/home/pogo/fb/node_modules/bluebird/js/main/util.js:26:23)
    at Function.Promise.attempt.Promise.try (/home/pogo/fb/node_modules/bluebird/js/main/method.js:31:24)
    at /home/pogo/fb/node_modules/facebook-chat-api/utils.js:989:24
    at tryCatcher (/home/pogo/fb/node_modules/bluebird/js/main/util.js:26:23)
    at Promise._settlePromiseFromHandler (/home/pogo/fb/node_modules/bluebird/js/main/promise.js:510:31)
    at Promise._settlePromiseAt (/home/pogo/fb/node_modules/bluebird/js/main/promise.js:584:18)
    at Async._drainQueue (/home/pogo/fb/node_modules/bluebird/js/main/async.js:128:12)
    at Async._drainQueues (/home/pogo/fb/node_modules/bluebird/js/main/async.js:133:10)
    at Immediate.Async.drainQueues [as _onImmediate] (/home/pogo/fb/node_modules/bluebird/js/main/async.js:15:14)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)

same problem here, any update ? D41C20AC-D96C-4227-8CF1-3617FBDC7F13

I'm having this on the bleeding edge too.

kalucky0 commented 4 years ago

Have anyone managed to fix this?

j4pa0 commented 4 years ago

Have anyone managed to fix this?

try using api.listenMqtt, not api.listen

kalucky0 commented 4 years ago

@japaodsc I'm using listenMqtt

kalucky0 commented 4 years ago

That's my code

login({email: "email@example.com", password: "password"}, (err, api) => {
    if (err) return console.error(err);

    api.listenMqtt((err, message) => {
        if (err) return console.error(err);

        if (message.body !== undefined) {
            // api.markAllAsRead();
            api.markAsRead(message.threadID);
        }
    });
});
kalucky0 commented 4 years ago

@lequanglam how is markAsSeen going? I'm starting to investigate it right now, if you could share your progress I would appreciate it.

BadAimWeeb commented 4 years ago

look like it's OK. i'm not sure, but i didn't see error last couple weeks.

kalucky0 commented 4 years ago

Yesterday there were no errors, today morning were a lot of errors, now there are none. Seems pretty random to me.

j4pa0 commented 4 years ago

I'm using bleeding edge and everything seems great (used to have this kind of error, but now there are no more for the markAsRead, at least for one week now).