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

File download fails for gib files #155

Open
holographix opened this issue Mar 29, 2021 · 0 comments
Open

File download fails for gib files #155

holographix opened this issue Mar 29, 2021 · 0 comments

Comments

@holographix
Copy link

What happened

I was trying to retrieve a 1.5Gb file from a folder and when I execute the getFile function after a bit of downloading time I got what I think is a buffer related error.

Code executed

Here is the excerpt a test version of my original code that ends up with the same error.
note: googleDriveSvc is just a custom class that wraps the node-google-drive functions

let gfiles = await this.googleDriveSvc.listFiles();
for(let i=0; i<gfiles.length;i++) {
   const gfile = gfiles[i];
   await this.googleDriveSvc.getFile(gfile, this.tmpFolder);
}

Error

buffer.js:799
    return this.utf8Slice(start, end);
                ^

Error: Cannot create a string longer than 0x1fffffe8 characters
    at Buffer.toString (buffer.js:799:17)
    at Request.<anonymous> (/var/lib/jenkins/workspace/ferrini-strapi/google-drive-s3-cron/node_modules/request/request.js:1128:39)
    at Request.emit (events.js:327:22)
    at Request.EventEmitter.emit (domain.js:467:12)
    at IncomingMessage.<anonymous> (/var/lib/jenkins/workspace/ferrini-strapi/google-drive-s3-cron/node_modules/request/request.js:1076:12)
    at Object.onceWrapper (events.js:421:28)
    at IncomingMessage.emit (events.js:327:22)
    at IncomingMessage.EventEmitter.emit (domain.js:467:12)
    at endReadableNT (internal/streams/readable.js:1327:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  code: 'ERR_STRING_TOO_LONG'

Versions

I am using node v. 12.19.0 on a ubuntu 20.04 machine, but also on OSX with node 14.16.0 I got the same results.

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

No branches or pull requests

1 participant