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

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

Closed
dthisner opened this issue Oct 27, 2017 · 9 comments
Closed

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

dthisner opened this issue Oct 27, 2017 · 9 comments

Comments

@dthisner
Copy link

dthisner commented Oct 27, 2017

  • 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.<anonymous> (/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.<anonymous> (/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.<anonymous> (/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.<anonymous> (/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.<anonymous> (/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.<anonymous> (/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)
```
`
@brian-mann
Copy link
Member

brian-mann commented Oct 27, 2017

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

@dthisner
Copy link
Author

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

@dthisner
Copy link
Author

Your fix worked, thank you :)

@jhartma
Copy link

jhartma commented Nov 27, 2017

just for the record

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

should also fix it

@aldomendez
Copy link

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

@preethih78
Copy link

preethih78 commented May 25, 2018

Thanks the following worked for me

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

@aaronmfparr
Copy link

aaronmfparr commented Oct 7, 2018

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.

@gbosetti
Copy link

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

@ext
Copy link

ext commented Aug 6, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants