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

Too many open files #57

Open
bserem opened this issue Jan 15, 2025 · 6 comments
Open

Too many open files #57

bserem opened this issue Jan 15, 2025 · 6 comments

Comments

@bserem
Copy link
Contributor

bserem commented Jan 15, 2025

When trying to add Cypress to a project, after running cypress-open I am getting the following issue more and more lately:
image

After clicking try again it attempts to create cypress.config.js and cypress folder but it fails with the following error in the terminal (almost identical):

EMFILE: too many open files, watch '/e2e'
Error: EMFILE: too many open files, watch '/e2e'
    at FSWatcher.<anonymous> (node:internal/fs/watchers:247:19)
    at Object.watch (node:fs:2418:34)
    at J (<embedded>:2209:11806)
    at $ (<embedded>:2209:12079)
    at s.exports._watchWithNodeFs (<embedded>:2209:14049)
    at s.exports._handleDir (<embedded>:2209:17414)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async s.exports._addToNodeFs (<embedded>:2209:18361)
    at async <embedded>:2209:35319
    at async Promise.all (index 0)
Failed to run cypress-open : exit status 1

Stopping/starting docker doesn't solve the issue.

Tried downgrading to Cypress v13.15.2, no luck.

Is this related to cypress or to ddev? (or something else)

@rfay
Copy link
Contributor

rfay commented Jan 15, 2025

You don't say what OS or Docker provider you're on. I think you need to increase the max_user_watches. On linux:

sudo sysctl -w fs.inotify.max_user_watches=1024

@rfay
Copy link
Contributor

rfay commented Jan 15, 2025

Actually, it's probably the open filies, not the max_user_watches. See

https://stackoverflow.com/questions/8965606/node-and-error-emfile-too-many-open-files

In general, these are settings on the host side, but may involve the Docker provider.

@tyler36
Copy link
Owner

tyler36 commented Jan 16, 2025

I have not seen that error before.
My stack is:

  • Windows 10 Docker Desktop
  • WSL (Ubuntu 24.04) DDEV

@rfay
Copy link
Contributor

rfay commented Jan 16, 2025

@bserem your original screenshot showed it doing watching on your .git directory. Whatever you're doing there... don't have it watch the .git directory.

@bserem
Copy link
Contributor Author

bserem commented Jan 16, 2025

@rfay I do not have a .git directory in there, matter of fact, the /e2e folder is not yet created when this error appears.
How would I control Cypress to not look somewhere?

I am using:
Linux, Kernel: 6.11.0
Docker version 27.3.1, build ce12230

My open files limit is 1024

@rfay
Copy link
Contributor

rfay commented Jan 16, 2025

Try raising the open files limit on host and see what happens

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

3 participants