question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cypress crashing on Linux > System limit for number of file watchers reached 'package.json'

See original GitHub issue

Hi, daily user of Cypress here. Just found this corner case where Cypress.js is crashing.

Steps to reproduce

Not exactly sure but overall this is the scenario.

  1. Open a bunch of processes which subscribe to package.json changes. In my case: two WebStorm windows & react build tools
  2. Open Cypress, open the project directory and run all tests in Chrome
  3. Cypress will crash right after opening Chrome with the following output:

Cypress process output

 {
  errno: -28,
  syscall: 'watch',
  code: 'ENOSPC',
  path: '/home/jake/DEV/dedupe-refresh/package.json',
  filename: '/home/jake/DEV/dedupe-refresh/package.json'
}
Error: ENOSPC: System limit for number of file watchers reached, watch '/home/jake/DEV/dedupe-refresh/package.json'
    at FSWatcher.start (internal/fs/watchers.js:165:26)
    at Object.watch (fs.js:1329:11)
    at createFsWatchInstance (/home/jake/.cache/Cypress/4.3.0/Cypress/resources/app/packages/server/node_modules/watchify/node_modules/chokidar/lib/nodefs-handler.js:38:15)
    at setFsWatchListener (/home/jake/.cache/Cypress/4.3.0/Cypress/resources/app/packages/server/node_modules/watchify/node_modules/chokidar/lib/nodefs-handler.js:81:15)
    at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/jake/.cache/Cypress/4.3.0/Cypress/resources/app/packages/server/node_modules/watchify/node_modules/chokidar/lib/nodefs-handler.js:233:14)
    at FSWatcher.NodeFsHandler._handleFile (/home/jake/.cache/Cypress/4.3.0/Cypress/resources/app/packages/server/node_modules/watchify/node_modules/chokidar/lib/nodefs-handler.js:262:21)
    at FSWatcher.<anonymous> (/home/jake/.cache/Cypress/4.3.0/Cypress/resources/app/packages/server/node_modules/watchify/node_modules/chokidar/lib/nodefs-handler.js:495:21)
    at callback (/home/jake/.cache/Cypress/4.3.0/Cypress/resources/app/packages/server/node_modules/graceful-fs/polyfills.js:289:20)
    at FSReqCallback.oncomplete (fs.js:159:5)

GET /__cypress/tests?p=cypress/support/index.js-271 - - ms - -
GET /__cypress/tests?p=cypress/integration/2.rwandaAllDedupes.test.js-101 - - ms - -
GET /__cypress/tests?p=cypress/integration/1.filterOptions.test.js-697 - - ms - -
/home/jake/.cache/Cypress/4.3.0/Cypress/Cypress --no-sandbox -- --cwd /home/jake/DEV/dedupe-refresh[19436]: ../../third_party/electron_node/src/node_platform.cc:449:std::shared_ptr<PerIsolatePlatformData> node::NodePlatform::ForIsolate(v8::Isolate *): Assertion `data' failed.
The Test Runner unexpectedly exited via a exit event with signal SIGABRT

Please search Cypress documentation for possible solutions:

https://on.cypress.io

Check if there is a GitHub issue describing this crash:

https://github.com/cypress-io/cypress/issues

Consider opening a new issue.

----------

Platform: linux (Ubuntu Linux - 19.10)
Cypress Version: 4.3.0

System

Ubuntu 19.10 Cypress 4.3.0 node.js v12.16.1


Thanks! I love cypress. Let me know if I can provide more info.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:16 (2 by maintainers)

github_iconTop GitHub Comments

23reactions
jakub-baocommented, Apr 8, 2020

Also, FYI, I have file watching explicitly disabled in cypress.json, but it’s still crashing:

{
  "baseUrl": "http://localhost:3003",
  "watchForFileChanges": false,
  "defaultCommandTimeout": 10000
}
15reactions
berviantoleocommented, Jul 8, 2021

Hi,

I think I meet the same problem that the options for disabling file watch do not work (it’s happened at 7.7.0):

https://github.com/berviantoleo/react-multi-crop/runs/3018043472?check_suite_focus=true

Since my configuration like this:

https://github.com/berviantoleo/react-multi-crop/blob/master/examples/demo/cypress.json

But it’s fine when at 7.6.0:

https://github.com/berviantoleo/react-multi-crop/runs/2958413049?check_suite_focus=true

Read more comments on GitHub >

github_iconTop Results From Across the Web

System limit for number of file watchers reached - Stack Overflow
I solve this issue this way rm -rf node_modules rm package-lock.json yarn.
Read more >
Changelog - Cypress Documentation
Fixed an issue where file watchers were not completely closed prior to the Cypress App quitting, causing crashes on exit in some macOS...
Read more >
ENOSPC: System limit for number of file watchers reached.
This problem seems to affect especially Linux users like myself. I can't confirm this for sure as I run only Linux- distribution.
Read more >
Error: ENOSPC: System limit for number of file watchers ...
When developing JavaScript-based applications on App Service Linux, notably ones that also come with a development server (e.x, ...
Read more >
node:internal/fs/watchers:252 throw error; - You.com | The AI ...
... Error: ENOSPC: System limit for number of file watchers reached, watch '/var/opt/thelounge/packages/package.json' at FSWatcher.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found