Cypress: Ubuntu: Cypress crashes when I try opening a project

Created on 27 Oct 2017  路  9Comments  路  Source: cypress-io/cypress

  • Operating System: Ubuntu 16.04
  • Cypress Version: 1.0.2
  • Browser Version:

Is this a Feature or Bug?

Bug

Current behavior:

Crashing when

Desired behavior:

Not crashing when opening a project

How to reproduce:

  1. Open Cypress (Either through the terminal or through by clicking on the Cypress icon)
  2. Try open a project
  3. Cypress crashes

Test code:


Additional Info (images, stack traces, etc)

Video:
https://youtu.be/zOC2JBffJsE

Stack trace:
````
dennis.thisner@d64071:~/Downloads/Cypress$ ./Cypress
{ Error: watch /home/dennis.thisner/projects/src/cumul8.com/web-platform/package.json ENOSPC
at exports._errnoException (util.js:1026:11)
at FSWatcher.start (fs.js:1439:19)
at Object.fs.watch (fs.js:1466:11)
at createFsWatchInstance (/home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:37:15)
at setFsWatchListener (/home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:80:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:228:14)
at FSWatcher.NodeFsHandler._handleFile (/home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:255:21)
at FSWatcher. (/home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:473:21)
at /home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/graceful-fs/polyfills.js:287:18
at FSReqWrap.oncomplete (fs.js:123:15)

code: 'ENOSPC',
errno: 'ENOSPC',
syscall: 'watch /home/dennis.thisner/projects/src/cumul8.com/web-platform/package.json',
filename: '/home/dennis.thisner/projects/src/cumul8.com/web-platform/package.json' }
Error: watch /home/dennis.thisner/projects/src/cumul8.com/web-platform/package.json ENOSPC
at exports._errnoException (util.js:1026:11)
at FSWatcher.start (fs.js:1439:19)
at Object.fs.watch (fs.js:1466:11)
at createFsWatchInstance (/home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:37:15)
at setFsWatchListener (/home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:80:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:228:14)
at FSWatcher.NodeFsHandler._handleFile (/home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:255:21)
at FSWatcher. (/home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:473:21)
at /home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/graceful-fs/polyfills.js:287:18
at FSReqWrap.oncomplete (fs.js:123:15)

{ Error: watch /home/dennis.thisner/projects/src/cumul8.com/web-platform/cypress/support/commands.js ENOSPC
at exports._errnoException (util.js:1026:11)
at FSWatcher.start (fs.js:1439:19)
at Object.fs.watch (fs.js:1466:11)
at createFsWatchInstance (/home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:37:15)
at setFsWatchListener (/home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:80:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:228:14)
at FSWatcher.NodeFsHandler._handleFile (/home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:255:21)
at FSWatcher. (/home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:473:21)
at /home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/graceful-fs/polyfills.js:287:18
at FSReqWrap.oncomplete (fs.js:123:15)

code: 'ENOSPC',
errno: 'ENOSPC',
syscall: 'watch /home/dennis.thisner/projects/src/cumul8.com/web-platform/cypress/support/commands.js',
filename: '/home/dennis.thisner/projects/src/cumul8.com/web-platform/cypress/support/commands.js' }
Error: watch /home/dennis.thisner/projects/src/cumul8.com/web-platform/cypress/support/commands.js ENOSPC
at exports._errnoException (util.js:1026:11)
at FSWatcher.start (fs.js:1439:19)
at Object.fs.watch (fs.js:1466:11)
at createFsWatchInstance (/home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:37:15)
at setFsWatchListener (/home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:80:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:228:14)
at FSWatcher.NodeFsHandler._handleFile (/home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:255:21)
at FSWatcher. (/home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:473:21)
at /home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/graceful-fs/polyfills.js:287:18
at FSReqWrap.oncomplete (fs.js:123:15)

{ Error: watch /home/dennis.thisner/projects/src/cumul8.com/web-platform/cypress/support/index.js ENOSPC
at exports._errnoException (util.js:1026:11)
at FSWatcher.start (fs.js:1439:19)
at Object.fs.watch (fs.js:1466:11)
at createFsWatchInstance (/home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:37:15)
at setFsWatchListener (/home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:80:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:228:14)
at FSWatcher.NodeFsHandler._handleFile (/home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:255:21)
at FSWatcher. (/home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:473:21)
at /home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/graceful-fs/polyfills.js:287:18
at FSReqWrap.oncomplete (fs.js:123:15)

code: 'ENOSPC',
errno: 'ENOSPC',
syscall: 'watch /home/dennis.thisner/projects/src/cumul8.com/web-platform/cypress/support/index.js',
filename: '/home/dennis.thisner/projects/src/cumul8.com/web-platform/cypress/support/index.js' }
Error: watch /home/dennis.thisner/projects/src/cumul8.com/web-platform/cypress/support/index.js ENOSPC
at exports._errnoException (util.js:1026:11)
at FSWatcher.start (fs.js:1439:19)
at Object.fs.watch (fs.js:1466:11)
at createFsWatchInstance (/home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:37:15)
at setFsWatchListener (/home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:80:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:228:14)
at FSWatcher.NodeFsHandler._handleFile (/home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:255:21)
at FSWatcher. (/home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:473:21)
at /home/dennis.thisner/Downloads/Cypress/resources/app/packages/server/node_modules/graceful-fs/polyfills.js:287:18
at FSReqWrap.oncomplete (fs.js:123:15)
``

linux

Most helpful comment

just for the record

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

should also fix it

All 9 comments

This is likely due to the way you've configured your system and is not Cypress specific.

ENOSPC is coming from your OS due to not having any space to write to /tmp

https://stackoverflow.com/questions/22475849/node-js-error-enospc

I will try that, meanwhile, seems to work running from within the project by: node_modules/.bin/cypress open, just takes a really long time to open

Your fix worked, thank you :)

just for the record

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

should also fix it

That work for me and also solved other problems related to file watch in laravel mix

Thanks the following worked for me

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

Using an Ubuntu 16.04 chroot on chomeos (with crouton) I ran into this problem also. Problem was inadequate number of user watches.

Solution was to increase them as follows:
sudo sysctl fs.inotify.max_user_watches=1048576

Similar to the other recommendations above, but simpler and now you understand the problem. ENOSPC can also refer to inadequate number of user watches on the file system.

I had the same problem. I solved it by running cypress with sudo.

But why on earth is cypress trying to setup watchers on node_modules? I confirm that raising the number of allowed handles with sysctl works but I don't want to have to. The limits are sane and in place for a reason.

I'd rather use watchForFileChanges to disable it but that is also an inconvenience.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zbigniewkalinowski picture zbigniewkalinowski  路  3Comments

brian-mann picture brian-mann  路  3Comments

jennifer-shehane picture jennifer-shehane  路  3Comments

szabyg picture szabyg  路  3Comments

igorpavlov picture igorpavlov  路  3Comments