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

ENOSPC: System limit for number of file watchers reached #357

Closed
charklewis opened this issue Apr 23, 2021 · 4 comments
Closed

ENOSPC: System limit for number of file watchers reached #357

charklewis opened this issue Apr 23, 2021 · 4 comments

Comments

@charklewis
Copy link

charklewis commented Apr 23, 2021

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?

@lizraeli
Copy link

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.

@panmona
Copy link

panmona commented Jun 20, 2021

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

@FelipeLahti
Copy link

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

@MikeMcC399
Copy link
Collaborator

Closing

@MikeMcC399 MikeMcC399 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 4, 2023
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

No branches or pull requests

5 participants