Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Creating Zip failes due to filesize #17

Open
jsnet-ops opened this issue May 10, 2021 · 2 comments
Open

Creating Zip failes due to filesize #17

jsnet-ops opened this issue May 10, 2021 · 2 comments

Comments

@jsnet-ops
Copy link

At the "Create zip file" stage following error occurs:

There was an error processing your request: RangeError [ERR_INVALID_ARG_VALUE]: The argument 'size' is invalid. Received 4620737532
at Function.allocUnsafe (node:buffer:374:3)
at Function.concat (node:buffer:553:25)
at concat (/usr/lib/node_modules/@kentico/kontent-backup-manager/node_modules/jszip/lib/stream/StreamHelper.js:62:27)
at StreamHelper. (/usr/lib/node_modules/@kentico/kontent-backup-manager/node_modules/jszip/lib/stream/StreamHelper.js:96:61)
at Immediate._onImmediate (/usr/lib/node_modules/@kentico/kontent-backup-manager/node_modules/jszip/lib/utils.js:381:18)
at processImmediate (node:internal/timers:464:21) {
code: 'ERR_INVALID_ARG_VALUE'
}

This seems to be JSZip related, although size is not a known restriction.

  • Zip to be written: 4.6GB
  • Diskspace: 230GB

Versions used:
Ubuntu 20.04 (In Docker)
Node: v16.1.0
npm: 7.11.2
jszip: 3.6.0

@Enngage
Copy link
Contributor

Enngage commented May 10, 2021

@sojwil, node.js processes are limited by the amount of memory they can use by default. I think that for standard processes its 512 MB, but that can be increased with --max_old_space_size setting.

I have limited experience with this, but in the past I've used following script to increase memory for my Angular build process where the default was not enough:

node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng

You can also read some more about this here - https://stackoverflow.com/questions/48387040/how-do-i-determine-the-correct-max-old-space-size-for-node-js

Let me know if you are able to get it working with the settings so I can potentially update documentation, thank you :-)

@jsnet-ops
Copy link
Author

Hi Enngage,

Thanks for your help.
As recommended, I started the backup like this:

node --max-old-space-size=8192 ./_commonjs/src/node-js/cli/app.js --action=backup --apiKey=xxx --projectId=xxxx --zipFilename=bak

Also, I added some extra debug info to zip.service.ts to make sure the right amount is memory (8192) is allocated and no overruns occur. Still the same error msg.

Any other suggestions are very welcome.

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

No branches or pull requests

2 participants