Attempts to download a >1GB files fail
See original GitHub issueSteps to reproduce
- Attempt to download a large ~1GB file using the
dropbox.filesDownload()
method
Expected Result
- File gets downloaded fine.
Actual Result
- A V8 memory error is logged and the download fails:
Logs
/node_modules/dropbox/src/download-request.js:27
res.on('data', function (chunk) { res.text += chunk; });
^
RangeError: Invalid string length
at IncomingMessage.<anonymous> node_modules/dropbox/src/download-request.js:27:27)
at emitOne (events.js:96:13)
at IncomingMessage.emit (events.js:189:7)
at readableAddChunk (_stream_readable.js:176:18)
at IncomingMessage.Readable.push (_stream_readable.js:134:10)
at HTTPParser.parserOnBody (_http_common.js:123:22)
at TLSSocket.socketOnData (_http_client.js:411:20)
at emitOne (events.js:96:13)
at TLSSocket.emit (events.js:189:7)
at readableAddChunk (_stream_readable.js:176:18)
at TLSSocket.Readable.push (_stream_readable.js:134:10)
at TLSWrap.onread (net.js:551:20)
Notes
AFAIK RangeError: Invalid string length
is a V8 out-of-memory error. It basically complaints that a string’s length is too long. Perhaps res.on('data')
response should accumulate on a Buffer
instead to circumvent this?
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (11 by maintainers)
Top Results From Across the Web
Can't download a certain large file - error: Failed - Network Error
Try a dedicated file downloader that can segment the download. Browsers are not good with large files & every browser you've tried so...
Read more >6 Ways to Fix the “Download Failed Network Error” on Chrome
6 Ways to Fix the “Download Failed Network Error” on Chrome · 1. Check Your Internet Speed and Connection · 2. Modify Your...
Read more >Downloads fail for files more than 1Gb if download speed is ...
The files fail to download if end-users have download speed lower than 8 MB/sec which is 64 Mbps. End users with 64 Mbps...
Read more >Fix file download errors - Google Chrome Help
This error means that there's not enough space on your computer to download the file. To fix the error: Delete some files from...
Read more >Large zip file downloads fail or need several attempts to ...
Hi Folks, Since we started allowing users to upload images at 1600x1200px we are having repeated download failures. Needless to say our zip...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@pran1990 duplicate of #101 and the PR #137 could update download-request.js and upload-request.js to return the Response object rather than buffered body. The Response object returns the stream (node-fetch) and has standardised methods to return different types of data, i.e. res.blob(), res.arrayBuffer() and res.json(). It also has properties for determining the response type (res.ok) and limiting duplicate consumption of the same stream (res.bodyUsed). Current methods in your SDK are very opposed to your company’s primary focus was on syncing large files between different operating systems…
Please read: https://developer.mozilla.org/en-US/docs/Web/API/Response
I’m not sure I agree that this is a dupe of #101 (though certainly a streams-based solution should handle upload and download). I don’t have a problem with lack of stream support on upload, since I’m doing multipart upload on anything over 8Mb, and that doesn’t cause any heartburn. But not being able to download large files (due to lack of stream support) is kind of a deal killer. I also don’t see any support for doing a range request to get around this. It seems like the ability to download large files is pretty key and that not having that should be a pretty high priority fix.