ENOSPC: System limit for number of file watchers reached
I have found that when I start my create-react-app using yarn start the server starts as expected, however then immediately errors almost every file with ENOSPC: System limit for number of file watchers reached. I have managed to fix this by adding the below step to my yaml file (I found this solution here).
- name: Setup kernel for react, increase watchers
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
Is there are another a better approach to solve this?
Thanks for adding a solution @charklewis! I also ran into this issue and the solution seems to work for me. It would be good to at least mention it in the documentation here.
Unfortunately this solution is somehow not working for me. I get the following error:
Run echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
/__w/_temp/84726bfa-c8c8-4827-84e7-1288541db1df.sh: 1: /__w/_temp/84726bfa-c8c8-4827-84e7-1288541db1df.sh: sudo: not found
Error: Process completed with exit code 127.
My workflow:
chrome:
name: Chrome
timeout-minutes: 15
runs-on: ubuntu-latest
container: cypress/browsers:node14.15.0-chrome86-ff82
needs: build
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2
- name: Increase File Watchers 🔭
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
# other steps ...
I'm using the normal hosted runners in the latest version. Anyone maybe knows how to solve this issue? Could it be because I use a container?
EDIT: I confirmed it: It works all fine without the docker container, opened an issue in their repo: https://github.com/cypress-io/cypress-docker-images/issues/505
Related: #317
Unfortunately this solution is somehow not working for me. I get the following error:
Run echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p /__w/_temp/84726bfa-c8c8-4827-84e7-1288541db1df.sh: 1: /__w/_temp/84726bfa-c8c8-4827-84e7-1288541db1df.sh: sudo: not found Error: Process completed with exit code 127.My workflow:
chrome: name: Chrome timeout-minutes: 15 runs-on: ubuntu-latest container: cypress/browsers:node14.15.0-chrome86-ff82 needs: build steps: - name: Checkout 🛎️ uses: actions/checkout@v2 - name: Increase File Watchers 🔭 run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p # other steps ...I'm using the normal hosted runners in the latest version. Anyone maybe knows how to solve this issue? Could it be because I use a container?
EDIT: I confirmed it: It works all fine without the docker container, opened an issue in their repo: cypress-io/cypress-docker-images#505
Related: #317
This worked for me! Not seeing the error anymore:
- uses: actions/checkout@v2
- name: Increase file watchers
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- name: Run Component tests
uses: cypress-io/github-action@v2
with:
command: npx cypress run-ct
Closing
- A workaround has been shared
- This is not an issue with
github-action - CRA appears to be now unsupported. See https://github.com/facebook/create-react-app/issues/13393