berry icon indicating copy to clipboard operation
berry copied to clipboard

[Bug]: GitHub Actions > Error: Couldn't allocate enough memory

Open mariushorvat opened this issue 1 year ago • 1 comments

Self-service

  • [ ] I'd be willing to implement a fix

Describe the bug

Hi, I'm running lastest yarn version 4.5.0 on GitHub Actions. I'm using a macos-15-xlarge runner. The memory on this runner it's 16GB, but each time I'm getting this errro about memory. Everything works locally on my mac, but on the GHActions this always fails. Does yarn works with GitHubActions? What its the preffered runner type to avoid this type of error.

Run yarn --version 4.5.0 Run yarn install --immutable --inline-builds ➤ YN0000: · Yarn 4.5.0 ➤ YN0000: ┌ Resolution step Resolution step ➤ YN0000: └ Completed ➤ YN0000: ┌ Post-resolution validation Post-resolution validation ➤ YN0000: └ Completed ➤ YN0000: ┌ Fetch step Fetch step ➤ YN0001: Error: Couldn't allocate enough memory at ZipFS.getBufferAndClose ([worker eval]:1:298892) at ZipFS.saveAndClose ([worker eval]:1:299882) at convertToZipWorker ([worker eval]:1:409186) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async MessagePort. ([worker eval]:1:410958) ➤ YN0000: └ Completed in 14s 907ms ➤ YN0000: · Failed with errors in 15s 128ms

To reproduce

  1. User any runner
  2. My repo it's a react-native project
  3. run yarn install --immutable --inline-builds
  4. Notice that the YN0001: Error: Couldn't allocate enough memory it's displayed in the logs

Environment

OS Linux or Macos YARN: 4.5.0 NODE: 18.18.0

Additional context

No response

mariushorvat avatar Oct 08 '24 17:10 mariushorvat

Have been having the same issue, on my local machine (32Gb Mem), for some time now: The only fix I have is to run builds on a 2GB EC2. Have tried upgrading and downgrading yarn, switching how yarn is installed (installing through nvm or proto), switching version of node.

Suggestions in #3972 haven't worked for me either.

Other colleagues also running Ubuntu don't have the same issue. Are there debug flags on the CLI at all?

Output

» yarn install 
➤ YN0000: · Yarn 4.1.1
➤ YN0000: ┌ Resolution step
➤ YN0001: │ Error: my-package@file:../../../package/dir/::locator=%40company%2Fweb-client%40workspace%3Acloud%2Fapps%2Fweb-client: Couldn't allocate enough memory
    at zi.getBufferAndClose (/home/snspinn/.cache/node/corepack/v1/yarn/4.1.1/yarn.js:149:196061)
    at SH (/home/snspinn/.cache/node/corepack/v1/yarn/4.1.1/yarn.js:559:4171)
    at async O2.getCandidates (/home/snspinn/.cache/node/corepack/v1/yarn/4.1.1/yarn.js:559:5633)
    at async Dd.getCandidates (/home/snspinn/.cache/node/corepack/v1/yarn/4.1.1/yarn.js:141:1271)
    at async Dd.getCandidates (/home/snspinn/.cache/node/corepack/v1/yarn/4.1.1/yarn.js:141:1271)
    at async /home/snspinn/.cache/node/corepack/v1/yarn/4.1.1/yarn.js:210:8401
    at async Ky (/home/snspinn/.cache/node/corepack/v1/yarn/4.1.1/yarn.js:140:53910)
    at async Fe (/home/snspinn/.cache/node/corepack/v1/yarn/4.1.1/yarn.js:210:8383)
    at async Promise.allSettled (index 14)
    at async Uc (/home/snspinn/.cache/node/corepack/v1/yarn/4.1.1/yarn.js:140:53244)
➤ YN0000: └ Completed in 4s 552ms
➤ YN0000: · Failed with errors in 4s 571ms

Environment

OS: Ubuntu 20.04 Yarn: 4.1.1 Node: v20.18.0

snspinn avatar Oct 17 '24 11:10 snspinn

@mariushorvat Did you find any fix for this? I can't even find a way to troubleshoot this/increase log verbosity in yarn.

It's funny because my error message has changed a little to a "Malloc failure":

>> yarn install
➤ YN0000: · Yarn 4.1.1
➤ YN0000: ┌ Resolution step
➤ YN0001: │ Libzip Error: my-package@file:../../../package/dir/::locator=%40company%2Fweb-client%40workspace%3Acloud%2Fapps%2Fweb-client: Malloc failure
    at zi.makeLibzipError (/home/snspinn/.proto/tools/yarn/4.1.1/bin/yarn.js:149:194725)
    at zi.getBufferAndClose (/home/snspinn/.proto/tools/yarn/4.1.1/bin/yarn.js:149:195455)
    at SH (/home/snspinn/.proto/tools/yarn/4.1.1/bin/yarn.js:559:4171)
    at async O2.getCandidates (/home/snspinn/.proto/tools/yarn/4.1.1/bin/yarn.js:559:5633)
    at async Dd.getCandidates (/home/snspinn/.proto/tools/yarn/4.1.1/bin/yarn.js:141:1271)
    at async Dd.getCandidates (/home/snspinn/.proto/tools/yarn/4.1.1/bin/yarn.js:141:1271)
    at async /home/snspinn/.proto/tools/yarn/4.1.1/bin/yarn.js:210:8401
    at async Ky (/home/snspinn/.proto/tools/yarn/4.1.1/bin/yarn.js:140:53910)
    at async Fe (/home/snspinn/.proto/tools/yarn/4.1.1/bin/yarn.js:210:8383)
    at async Promise.allSettled (index 14)
➤ YN0000: └ Completed in 4s 236ms
➤ YN0000: · Failed with errors in 4s 262ms

snspinn avatar Nov 06 '24 13:11 snspinn

Hello There,

Facing the same issue, RN project... Any workaround for this?.

Thanks in advance

FaggioniHQ avatar Nov 28 '24 13:11 FaggioniHQ

Hello Again,

The package that is triggering the issue is this one: https://github.com/realm/realm-js

A lot of changes are made by that package to the yarn.lock after upgrade to the latest version

FaggioniHQ avatar Nov 28 '24 16:11 FaggioniHQ

Hello Again,

The package that is triggering the issue is this one: https://github.com/realm/realm-js

A lot of changes are made by that package to the yarn.lock after upgrade to the latest version

@FaggioniHQ This is specific to your codebase and probably best tracked in the specific package's issues.

snspinn avatar Dec 03 '24 10:12 snspinn