Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Duplication / flooding of ping messages #31

Closed
savely-krasovsky opened this issue Apr 4, 2017 · 9 comments
Closed

Duplication / flooding of ping messages #31

savely-krasovsky opened this issue Apr 4, 2017 · 9 comments

Comments

@savely-krasovsky
Copy link

savely-krasovsky commented Apr 4, 2017

I use you lib as layer for hybrid bot that use Bot API and TG API simultaneously (because of lib has not update manager). But after some hours (4-5) I got many error like NETWORK_BAD_REQUEST, Unhandled rejection undefined etc. Is it okay or it's normal for beta state?

Encrypted request failed { Error: MT[406] NETWORK_BAD_REQUEST: http://149.154.167.51/apiw1
    at MTError (\node_modules\telegram-mtproto\lib\error.js:13:5)
    at ErrorBadRequest (\node_modules\telegram-mtproto\lib\error.js:30:5)
    at NetworkerThread._ref20 (\node_modules\telegram-mtproto\lib\service\networker\index.js:1050:40)
    at throw (native)
    at step (\node_modules\telegram-mtproto\lib\service\networker\index.js:62:202)
    at \node_modules\telegram-mtproto\lib\service\networker\index.js:62:424
    at tryCatcher (\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (\node_modules\bluebird\js\release\promise.js:512:31)
    at Promise._settlePromise (\node_modules\bluebird\js\release\promise.js:569:18)
    at Promise._settlePromise0 (\node_modules\bluebird\js\release\promise.js:614:10)
    at Promise._settlePromises (\node_modules\bluebird\js\release\promise.js:689:18)
    at Async._drainQueue (\node_modules\bluebird\js\release\async.js:133:16)
    at Async._drainQueues (\node_modules\bluebird\js\release\async.js:143:10)
    at Immediate.Async.drainQueues (\node_modules\bluebird\js\release\async.js:17:14)
    at runCallback (timers.js:666:20)
    at tryOnImmediate (timers.js:639:5)
    at processImmediate [as _immediateCallback] (timers.js:611:5)
  code: 406,
  type: 'NETWORK_BAD_REQUEST',
  originalError: 
   { Error: Request failed with status code 429
       at createError (\node_modules\axios\lib\core\createError.js:15:15)
       at settle (\node_modules\axios\lib\core\settle.js:18:12)
       at IncomingMessage.handleStreamEnd (\node_modules\axios\lib\adapters\http.js:186:11)
       at emitNone (events.js:91:20)
       at IncomingMessage.emit (events.js:185:7)
       at endReadableNT (_stream_readable.js:974:12)
       at _combinedTickCallback (internal/process/next_tick.js:80:11)
       at process._tickDomainCallback (internal/process/next_tick.js:128:9)
     config: 
      { adapter: [Function: httpAdapter],
        transformRequest: [Object],
        transformResponse: [Object],
        timeout: 0,
        xsrfCookieName: 'XSRF-TOKEN',
        xsrfHeaderName: 'X-XSRF-TOKEN',
        maxContentLength: -1,
        validateStatus: [Function: validateStatus],
        headers: [Object],
        method: 'post',
        responseType: 'arraybuffer',
        url: 'http://149.154.167.51/apiw1',
        data: ArrayBuffer { byteLength: 904 } },
     response: 
      { status: 429,
        statusText: 'Too Many Requests',
        headers: [Object],
        config: [Object],
        request: [Object],
        data: <Buffer 3c 68 74 6d 6c 3e 0d 0a 3c 68 65 61 64 3e 3c 74 69 74 6c 65 3e 34 32 39 20 54 6f 6f 20 4d 61 6e 79 20 52 65 71 75 65 73 74 73 3c 2f 74 69 74 6c 65 3e ... > } } }

and:

. . .
Unhandled rejection undefined
Unhandled rejection undefined
Unhandled rejection undefined
Unhandled rejection undefined
Unhandled rejection undefined
Unhandled rejection undefined
Unhandled rejection undefined
Unhandled rejection undefined
Unhandled rejection undefined
Unhandled rejection undefined
Unhandled rejection undefined
Unhandled rejection undefined
Unhandled rejection undefined
Unhandled rejection undefined
Unhandled rejection undefined
. . .
@savely-krasovsky
Copy link
Author

Full logs: https://gist.github.com/Lord-Protector/25ab216eb905ef2252c7bf0e41f7c0c9

@zerobias
Copy link
Owner

zerobias commented Apr 4, 2017

Oh, thanks, I think I know where is the problem

@zerobias zerobias self-assigned this Apr 4, 2017
@zerobias zerobias changed the title After long work many errors Duplication / flooding of ping messages Apr 4, 2017
@savely-krasovsky
Copy link
Author

@zerobias Also sometime I get randomly two errors:
[MT] Bad server salt for invalid message and [MT] Bad msg notification for invalid message

Full log for example:
https://gist.github.com/Lord-Protector/158a4e04fb70e66e42d3129a27cfa54b

@zerobias
Copy link
Owner

zerobias commented Apr 7, 2017

Fixed in 4019b2d

I'll leave it open for a while. Needs to make sure that the problem is solved.

@savely-krasovsky
Copy link
Author

savely-krasovsky commented Apr 7, 2017

Wait it in NPM to test.

@zerobias
Copy link
Owner

zerobias commented Apr 7, 2017

npm install --save telegram-mtproto@alpha

#37 (comment)

@savely-krasovsky
Copy link
Author

Oh, thanks 👍

@vodnicearv
Copy link
Contributor

In version ^2.2.8 error still exists?

@koloboid
Copy link
Contributor

Still exists in 2.2.8 and really annoying. Any workaround?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants