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
Exec failing with internal error when piping large output #818
Labels
fix
Bug/defect, or a fix for such a problem
Comments
Thanks for digging into this! Yeah, it makes sense that there's a limit on argument size. Did this reproduce on 0.7.x? It seems like #807 was wrong, and we may be able to fix this by reverting. |
nfischer
added a commit
that referenced
this issue
Jan 19, 2018
This reverts commit 64d5899. Reason for revert: If stdin is large, then the param object can become an extremely long string, exceeding the maximum OS size limit on commandline parameters. Original change's description: > refactor(exec): remove paramsFile (#807) > > The `paramsFile` is obsolete now that we use `execFileSync()` for our > internal implementation. Instead, we pass parameters to the child > process directly as a single commandline parameter to reduce file I/O. > > Issue #782 Fixes #818
nfischer
added a commit
that referenced
this issue
Jan 20, 2018
This reverts commit 64d5899. Reason for revert: If stdin is large, then the param object can become an extremely long string, exceeding the maximum OS size limit on commandline parameters. Original change's description: > refactor(exec): remove paramsFile (#807) > > The `paramsFile` is obsolete now that we use `execFileSync()` for our > internal implementation. Instead, we pass parameters to the child > process directly as a single commandline parameter to reduce file I/O. > > Issue #782 Fixes #818
I'll release this in 0.8.1 soon |
This was referenced Aug 29, 2019
This was referenced Mar 24, 2020
This was referenced Apr 24, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Node version (or tell us if you're using electron or some other framework):
8
ShellJS version (the most recent version/Github branch you see the bug on):
0.8.0
Operating system:
Ubuntu 16.04.3
Description of the bug:
Piping medium to large amounts of output between two exec's causes the second one to fail with 'Error: exec: internal error'.
Example ShellJS command to reproduce the error:
Here,
small.txt
is a small file (under 1kb), whilebig.txt
is a 2MB file.The first command executes perfectly well, while the second one fails with
exec: internall error
.Without
fatal = true
, the second exec on the second command simply returnsnull
and the command fails due toto
not being a property of null. (Likely related: #724)Note
I did some digging and it seems the problem is here:
https://github.com/shelljs/shelljs/blob/master/src/exec.js#L68
That call to
execFileSync
receivesexecArgs
, which contains the serialized output from the first exec. So it's essentially calling a process with an argument which is over 2MB, which is breaking a limit on my OS. That call toexecFileSync
ends with anError: spawnSync /usr/bin/node E2BIG
being thrown by node.The text was updated successfully, but these errors were encountered: