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

Large uploads may fail with exit code 137 #243

Open
stephanosio opened this issue Jul 13, 2022 · 2 comments · May be fixed by #252
Open

Large uploads may fail with exit code 137 #243

stephanosio opened this issue Jul 13, 2022 · 2 comments · May be fixed by #252

Comments

@stephanosio
Copy link

Problem statement

The softprops/action-gh-release action may fail silently or complete with the exit code 137 (when debug logging is enabled) when there are numerous large release assets:

##[debug]Node Action run completed with exit code 137
##[debug]Finishing: Upload release assets

The exit code 137 is likely due to the node process, in which the release action runs, being killed because of the system running out of memory.

Looking at the softprops/action-gh-release implementation, this seems to make sense because it uses the readFileSync function to read the full content of the release assets into memory (instead of using, for instance, a stream):

data: readFileSync(path)

Also note that the action attempts to read all release assets into the the memory at once, making this problem much worse:

      const files = paths(config.input_files);
...
      const assets = await Promise.all(
        files.map(async path => {
          const json = await upload(

Suggested solution

The action should use Stream to read the content of the release assets.

Note that the node-fetch module supports Stream, so the file stream should be passed to it instead of an object containing the full content of the release asset loaded into it.

Additional context

Reported in zephyrproject-rtos/sdk-ng#520 (comment)

@stephanosio
Copy link
Author

Also just noting that the GitHub Actions runner is now on Node 16, so it would be good to update the action to use it and take advantage of the improved stream support.

@kirillmorozov
Copy link

Faced the same issue when trying to upload a couple of release assets (~1.95GB in size each) from AWS EC2 instances.

Also tried @trxcllnt's fix(#252) without any luck and since I didn't have time to debug I switched to ncipollo/release-action which suited my needs.

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

Successfully merging a pull request may close this issue.

3 participants
@kirillmorozov @stephanosio and others