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

RangeError [ERR_FS_FILE_TOO_LARGE]: File size (***) is greater than possible Buffer: *** bytes #5

Open
slrslr opened this issue Aug 23, 2018 · 1 comment

Comments

@slrslr
Copy link

slrslr commented Aug 23, 2018

Hi,

today i installed drop-dat via npm on my latest Linux CentOS 6.10 and when i try to share large file , i see:

$ drop-dat vzdump-1.tgz
Importing file(s):
  vzdump-1.tgz
RangeError [ERR_FS_FILE_TOO_LARGE]: File size (18561994013) is greater than possible Buffer: 2147483647 bytes
    at FSReqWrap.readFileAfterStat [as oncomplete] (fs.js:260:11)

When i paste 2147483647 into https://whatsabyte.com/P1/byteconverter.htm i see that it is 2048MB which is 2GB

[root@me abc]# df -h

Filesystem      Size  Used Avail Use% Mounted on
/dev/simfs      512G  132G  381G  26% /
none            256M  4.0K  256M   1% /dev
none            256M     0  256M   0% /dev/shm

[root@me abc]# free -mht

             total       used       free     shared    buffers     cached
Mem:          512M       354M       157M       5.6M         0B       307M
-/+ buffers/cache:        46M       465M
Swap:         256M        60M       195M
Total:        768M       414M       353M

[root@me abc]# node -v
v10.8.0

This is VPS based on OpenVZ virtualization. I have enough free space, how can i increase that buffer or move buffer so it utilize my free HDD space? Or how to share such big file?

@joehand
Copy link

joehand commented Aug 23, 2018

That is the max buffer size in node. To import larger files, the code will need to change the imports to streams instead of putting the whole file in a buffer: https://github.com/creationix/drop-dat/blob/master/drop-dat.js#L76

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

2 participants