Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch readMessageBegin failures #88

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mariecl
Copy link
Contributor

@mariecl mariecl commented Apr 27, 2018

Refs. #71

This patch is intended to fix uncaught exceptions triggered by a MemBuffer overrun exception.

2018-04-27T19:37:13.755+0000 - uncaughtException: Error: MemBuffer overrun
    at MemBuffer.read (/[redacted]/[redacted]/node_modules/evernote/lib/thrift/transport/memBuffer.js:29:55)
    at BinaryProtocol.readMessageBegin (/[redacted]/[redacted]/node_modules/evernote/lib/thrift/protocol/binaryProtocol.js:203:38)
    at Thrift.Method.processResponse (/[redacted]/[redacted]/node_modules/evernote/lib/thrift/thrift.js:184:27)
    at Thrift.Method.<anonymous> (/[redacted]/[redacted]/node_modules/evernote/lib/thrift/thrift.js:165:42)
    at wrapTransport (/[redacted]/[redacted]/node_modules/evernote/lib/thrift/protocol/binaryProtocol.js:48:20)
    at IncomingMessage.<anonymous> (/[redacted]/[redacted]/node_modules/evernote/lib/thrift/transport/binaryHttpTransport.js:82:27)
    at IncomingMessage.emit (events.js:185:15)
    at endReadableNT (_stream_readable.js:1106:12)
    at process._tickCallback (internal/process/next_tick.js:178:19)

@DivyaGuptaBrimma
Copy link

Thanks. This helped.

@zaverden
Copy link

@mariecl Same error appeared in my logs, but I got another stack:

Error: MemBuffer overrun
    at MemBuffer.read (/src/node_modules/evernote/lib/thrift/transport/memBuffer.js:29:55)
    at BinaryProtocol.readString (/src/node_modules/evernote/lib/thrift/protocol/binaryProtocol.js:333:29)
    at BinaryProtocol.readType (/src/node_modules/evernote/lib/thrift/protocol/binaryProtocol.js:353:25)
    at Object.Thrift.Struct.readFields (/src/node_modules/evernote/lib/thrift/thrift.js:505:49)
    at Thrift.Struct.read (/src/node_modules/evernote/lib/thrift/thrift.js:485:19)
    at Object.Thrift.List.readEntries (/src/node_modules/evernote/lib/thrift/thrift.js:257:35)
    at Thrift.List.read (/src/node_modules/evernote/lib/thrift/thrift.js:248:17)
    at Object.Thrift.Struct.readFields (/src/node_modules/evernote/lib/thrift/thrift.js:503:53)
    at Thrift.Struct.read (/src/node_modules/evernote/lib/thrift/thrift.js:485:19)
    at Thrift.Method.processResponse (/src/node_modules/evernote/lib/thrift/thrift.js:204:26)

The last line points to result = this.result.read(response);

I believe, to completely fix the issue you should put into try all code down to response.readMessageEnd();

uncaughtException: Error: MemBuffer overrun
    at MemBuffer.read (/[...]/node_modules/evernote/lib/thrift/transport/memBuffer.js:29:55)
    at BinaryProtocol.readString (/[...]/node_modules/evernote/lib/thrift/protocol/binaryProtocol.js:333:29)
    at BinaryProtocol.readType (/[...]/node_modules/evernote/lib/thrift/protocol/binaryProtocol.js:353:25)
    at Object.Thrift.Struct.readFields (/[...]/node_modules/evernote/lib/thrift/thrift.js:513:49)
    at Thrift.Struct.read (/[...]/node_modules/evernote/lib/thrift/thrift.js:493:19)
    at Object.Thrift.Struct.readFields (/[...]/node_modules/evernote/lib/thrift/thrift.js:511:53)
    at Thrift.Struct.read (/[...]/node_modules/evernote/lib/thrift/thrift.js:493:19)
    at Thrift.Method.processResponse (/[...]/node_modules/evernote/lib/thrift/thrift.js:212:26)
    at Thrift.Method.<anonymous> (/[...]/node_modules/evernote/lib/thrift/thrift.js:165:42)
    at wrapTransport (/[...]/node_modules/evernote/lib/thrift/protocol/binaryProtocol.js:48:20)
@mariecl
Copy link
Contributor Author

mariecl commented Sep 10, 2018

I updated my branch to also catch errors on Membuffer.read with the following stack trace:

    at MemBuffer.read (/[...]/node_modules/evernote/lib/thrift/transport/memBuffer.js:29:55)
    at BinaryProtocol.readString (/[...]/node_modules/evernote/lib/thrift/protocol/binaryProtocol.js:333:29)
    at BinaryProtocol.readType (/[...]/node_modules/evernote/lib/thrift/protocol/binaryProtocol.js:353:25)
    at Object.Thrift.Struct.readFields (/[...]/node_modules/evernote/lib/thrift/thrift.js:513:49)
    at Thrift.Struct.read (/[...]/node_modules/evernote/lib/thrift/thrift.js:493:19)
    at Object.Thrift.Struct.readFields (/[...]/node_modules/evernote/lib/thrift/thrift.js:511:53)
    at Thrift.Struct.read (/[...]/node_modules/evernote/lib/thrift/thrift.js:493:19)
    at Thrift.Method.processResponse (/[...]/node_modules/evernote/lib/thrift/thrift.js:212:26)
    at Thrift.Method.<anonymous> (/[...]/node_modules/evernote/lib/thrift/thrift.js:165:42)
    at wrapTransport (/[...]/node_modules/evernote/lib/thrift/protocol/binaryProtocol.js:48:20)```

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

Successfully merging this pull request may close these issues.

None yet

4 participants