-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
nx format fails with Error: spawnSync /bin/sh E2BIG #17612
Comments
Which particular distro of Linux are you on? What is the result of:
I'm on Pop!_OS and it's That is the value we use to chunk the changed files into sets which fit into the command. I could see it failing is if there is a file path that is so long that it alone, does not fit in a command but I think it would have to be really long which your paths do not seem to be that long. So maybe the command length limit is low? |
I saw this issue on GitHub actions running ubuntu_latest. I could also reproduce it on a test server running Rocky Linux 9. On that server I also get However I can run |
I did a more debugging. If I monkey patch |
For me this works with node 16, but anything higher than that I get this issue. |
The same issue on Gitlab CI. Command
|
After investigating a bit, I found that while ARG_MAX is indeed 2097152 on my laptop, it actually only works for chunks < than about 131k. This is because while 2097152 is the maximum length of an entire command, the length of a single argument is hardcoded in the kernel (in our case it's 131072). In the I didn't find a way to get this value programmatically, so there are 2 ways to fix this:
|
Fixed with #21074 |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
Running
nx format
on GitHub Actions fails with:Running
nx format:check
fails with a less clear error message:It seems that there are too many files to be checked.
Expected Behavior
nx format
should work with many files.Steps to Reproduce
nx format
on a branch with many changed filesNx Report
Operating System
The text was updated successfully, but these errors were encountered: