-
Notifications
You must be signed in to change notification settings - Fork 157
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
Error: MemBuffer overrun when notes contain binary data [files, images etc] #71
Comments
Thanks for your email - let's keep correspondence on this issue. For posterity, here's an excerpt from your email:
It looks like the relevant code is in binaryHttpTransport.js, which is loaded in stores.js. BinaryHttpTransport creates a MemBuffer. |
Is there any plan to fix this one? |
@akhaku Since Locally, if I replace
(btw,
in I am not creating a PR because I am unsure how you want the SDK to handle this memBuffer exception, but could you please look into it? |
I am experimenting with the express sample code and kept running into this error every time I logged in. Replacing the code @mariecl mentioned seems to solve the issue for me at least. Thanks! :) |
I tried with the simplest snippet I could come up with using var Evernote = require('evernote');
var TOKEN = '<put-your-dev-token-here>';
var noteGUID = '<put-your-note-guid-here>';
var client = new Evernote.Client({
token: TOKEN,
sandbox: true,
});
var ns = client.getNoteStore();
ns.getNoteWithResultSpec(noteGUID, { includeContent: true, includeResourcesData: true })
.then(function(note) {
console.log(note);
}).catch(function (err) {
console.log(err);
}); and I'm unable to reproduce this issue on node v8.9.1. I tested with multiple notes which include binary data. Can someone affected by this please provide more details? |
This error has re-appeared for me after upgrading to node |
I just created a PR (#88) leveraging the code I posted above since it looks like it works for a few people other than me. I hope this can get fixed in the near future 🤞. |
I have faced same issue, and can provide you some details
How you can reproduce the issue:
Meaning: If you'll apply fix from PR #88 you'll get expected @julen with this information, when do you think we can expect new version with this fix applied? |
Monkey patch to make const Thrift = require('evernote/lib/thrift/thrift');
Thrift.Method.prototype.__processResponse = Thrift.Method.prototype.processResponse;
Thrift.Method.prototype.processResponse = function (response, callback) {
try {
this.__processResponse(response, callback);
} catch (err) {
callback(err);
}
}; |
Hey @zaverden, thanks for your diagnosis. I believe the intermittent errors you were having can be attributed to some EN service availability issues that became more frequent at the beginning of July. I'm not in charge of the SDK, but I heard the Thrift-generated code might get an update soon, which is quite old at the moment, and I reckon that is likely to change the code causing this. |
We just got a MemBuffer overrun crash in production. |
Same thing, MemBuffer overrun crash our app in production. |
TIP should also remove JSON.stringify(error) to make @zaverden solution work, |
I am working on evernote javascript SDK [[email protected]], things worked fine till I tried to make the following call ::
noteStore.getNoteWithResultSpec(guid, {includeContent:true, includeResourcesData: true})
The call to this function getNoteWithResultSpecfails when my notes on evernote contain binary data e.g. [img / pdf] etc. However if my notes only contain text data [ no img / pdf ] then this function works fine.
The console shows the following ::
` evernote/node_modules/evernote/lib/thrift/transport/memBuffer.js:32
if (this.offset + len > this.buffer.length) throw Error('MemBuffer overrun');
^
Error: MemBuffer overrun
at Error (native)
at MemBuffer.read (/evernote/node_modules/evernote/lib/thrift/transport/memBuffer.js:32:55)
at BinaryProtocol.readBinary (/evernote/node_modules/evernote/lib/thrift/protocol/binaryProto
col.js:327:29)
at BinaryProtocol.readType (/evernote/node_modules/evernote/lib/thrift/protocol/binaryProtoco
l.js:355:25)
at Object.Thrift.Struct.readFields (/evernote/node_modules/evernote/lib/thrift/thrift.js:505:
49)
at Thrift.Struct.read (/evernote/node_modules/evernote/lib/thrift/thrift.js:485:19)
`
Please suggest / help to resolve this.
The text was updated successfully, but these errors were encountered: