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 v3.3.0 crashes with ENOSPC in AWS CodeBuild

See original GitHub issue

Current behavior:

[AWS CodeBuild Plugin] > cross-env NODE_ENV=test cypress run
[AWS CodeBuild Plugin] 
[AWS CodeBuild Plugin] { Error: watch /codebuild/output/src525851951/src/project/cypress/plugins/index.js ENOSPC
[AWS CodeBuild Plugin]     at _errnoException (util.js:1024:11)
[AWS CodeBuild Plugin]     at FSWatcher.start (fs.js:1386:19)
[AWS CodeBuild Plugin]     at Object.fs.watch (fs.js:1412:11)
[AWS CodeBuild Plugin]     at createFsWatchInstance (/root/.cache/Cypress/3.3.0/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:37:15)
[AWS CodeBuild Plugin]     at setFsWatchListener (/root/.cache/Cypress/3.3.0/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:80:15)
[AWS CodeBuild Plugin]     at FSWatcher.NodeFsHandler._watchWithNodeFs (/root/.cache/Cypress/3.3.0/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:228:14)
[AWS CodeBuild Plugin]     at FSWatcher.NodeFsHandler._handleFile (/root/.cache/Cypress/3.3.0/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:255:21)
[AWS CodeBuild Plugin]     at FSWatcher.<anonymous> (/root/.cache/Cypress/3.3.0/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:473:21)
[AWS CodeBuild Plugin]     at /root/.cache/Cypress/3.3.0/Cypress/resources/app/packages/server/node_modules/graceful-fs/polyfills.js:285:20
[AWS CodeBuild Plugin]     at FSReqWrap.oncomplete (fs.js:153:5)
[AWS CodeBuild Plugin] 
[AWS CodeBuild Plugin]   code: 'ENOSPC',
[AWS CodeBuild Plugin]   errno: 'ENOSPC',
[AWS CodeBuild Plugin]   syscall: 'watch /codebuild/output/src525851951/src/project/cypress/plugins/index.js',
[AWS CodeBuild Plugin]   filename: '/codebuild/output/src525851951/src/project/cypress/plugins/index.js' }
[AWS CodeBuild Plugin] Error: watch /codebuild/output/src525851951/src/project/cypress/plugins/index.js ENOSPC
[AWS CodeBuild Plugin]     at _errnoException (util.js:1024:11)
[AWS CodeBuild Plugin]     at FSWatcher.start (fs.js:1386:19)
[AWS CodeBuild Plugin]     at Object.fs.watch (fs.js:1412:11)
[AWS CodeBuild Plugin]     at createFsWatchInstance (/root/.cache/Cypress/3.3.0/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:37:15)
[AWS CodeBuild Plugin]     at setFsWatchListener (/root/.cache/Cypress/3.3.0/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:80:15)
[AWS CodeBuild Plugin]     at FSWatcher.NodeFsHandler._watchWithNodeFs (/root/.cache/Cypress/3.3.0/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:228:14)
[AWS CodeBuild Plugin]     at FSWatcher.NodeFsHandler._handleFile (/root/.cache/Cypress/3.3.0/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:255:21)
[AWS CodeBuild Plugin]     at FSWatcher.<anonymous> (/root/.cache/Cypress/3.3.0/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:473:21)
[AWS CodeBuild Plugin]     at /root/.cache/Cypress/3.3.0/Cypress/resources/app/packages/server/node_modules/graceful-fs/polyfills.js:285:20
[AWS CodeBuild Plugin]     at FSReqWrap.oncomplete (fs.js:153:5)
[AWS CodeBuild Plugin] 
[AWS CodeBuild Plugin] { Error: watch /codebuild/output/src525851951/src/project/env/parse.js ENOSPC
[AWS CodeBuild Plugin]     at _errnoException (util.js:1024:11)
[AWS CodeBuild Plugin]     at FSWatcher.start (fs.js:1386:19)
[AWS CodeBuild Plugin]     at Object.fs.watch (fs.js:1412:11)
[AWS CodeBuild Plugin]     at createFsWatchInstance (/root/.cache/Cypress/3.3.0/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:37:15)
[AWS CodeBuild Plugin]     at setFsWatchListener (/root/.cache/Cypress/3.3.0/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:80:15)
[AWS CodeBuild Plugin]     at FSWatcher.NodeFsHandler._watchWithNodeFs (/root/.cache/Cypress/3.3.0/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:228:14)
[AWS CodeBuild Plugin]     at FSWatcher.NodeFsHandler._handleFile (/root/.cache/Cypress/3.3.0/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:255:21)
[AWS CodeBuild Plugin]     at FSWatcher.<anonymous> (/root/.cache/Cypress/3.3.0/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:473:21)
[AWS CodeBuild Plugin]     at /root/.cache/Cypress/3.3.0/Cypress/resources/app/packages/server/node_modules/graceful-fs/polyfills.js:285:20
[AWS CodeBuild Plugin]     at FSReqWrap.oncomplete (fs.js:153:5)
[AWS CodeBuild Plugin] 
[AWS CodeBuild Plugin]   code: 'ENOSPC',
[AWS CodeBuild Plugin]   errno: 'ENOSPC',
[AWS CodeBuild Plugin]   syscall: 'watch /codebuild/output/src525851951/src/project/env/parse.js',
[AWS CodeBuild Plugin]   filename: '/codebuild/output/src525851951/src/project/env/parse.js' }
[AWS CodeBuild Plugin] Error: watch /codebuild/output/src525851951/src/project/env/parse.js ENOSPC
[AWS CodeBuild Plugin]     at _errnoException (util.js:1024:11)
[AWS CodeBuild Plugin]     at FSWatcher.start (fs.js:1386:19)
[AWS CodeBuild Plugin]     at Object.fs.watch (fs.js:1412:11)
[AWS CodeBuild Plugin]     at createFsWatchInstance (/root/.cache/Cypress/3.3.0/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:37:15)
[AWS CodeBuild Plugin]     at setFsWatchListener (/root/.cache/Cypress/3.3.0/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:80:15)
[AWS CodeBuild Plugin]     at FSWatcher.NodeFsHandler._watchWithNodeFs (/root/.cache/Cypress/3.3.0/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:228:14)
[AWS CodeBuild Plugin]     at FSWatcher.NodeFsHandler._handleFile (/root/.cache/Cypress/3.3.0/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:255:21)
[AWS CodeBuild Plugin]     at FSWatcher.<anonymous> (/root/.cache/Cypress/3.3.0/Cypress/resources/app/packages/server/node_modules/chokidar/lib/nodefs-handler.js:473:21)
[AWS CodeBuild Plugin]     at /root/.cache/Cypress/3.3.0/Cypress/resources/app/packages/server/node_modules/graceful-fs/polyfills.js:285:20
[AWS CodeBuild Plugin]     at FSReqWrap.oncomplete (fs.js:153:5)
[AWS CodeBuild Plugin] 

Desired behavior:

Cypress should run normally.

With version 3.2.0 same configuration this does not happens

Steps to reproduce: (app code and test code)

Use AWS Codebuild with NodeJS image, install Cypress 3.3.0 in it and try to run tests, it will fail

Versions

AWS Codebuild, Node 10.15.1, Yarn 1.13.0, Cypress 3.3.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:20 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
stanvitcommented, Jul 11, 2019

Fo those who are struggling with this issue on AWS Codebuild, enabling privileged mode on the build allows to modify sysctl parameters, including fs.inotify.max_user_watches:

[Container] 2019/07/11 06:18:34 Running command sysctl fs.inotify.max_user_watches 
fs.inotify.max_user_watches = 8192 
 
[Container] 2019/07/11 06:18:34 Running command sysctl fs.inotify.max_user_watches=524288 
fs.inotify.max_user_watches = 524288 
 
[Container] 2019/07/11 06:18:34 Running command sysctl fs.inotify.max_user_watches 
fs.inotify.max_user_watches = 524288
3reactions
kucebcommented, Jun 4, 2019

I think the best solution here is to not register the file watchers when using cypress run what do you think @jennifer-shehane ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting AWS CodeBuild
Issue: When you try to run a build project, the build fails with this error. Possible cause: Your source repository has a self-signed...
Read more >
Changelog - Cypress Documentation
When a chromium based browser tab or process crashes, Cypress will no longer hang indefinitely but will fail the current test and move...
Read more >
Cypress AWS codebuild error: spec must be a string or ...
My problem is the environments that I use during the cypress command are getting as empty. - echo $CY_GROUP_SPEC - CY_GROUP=$(echo $ ...
Read more >
cypress: Versions - Openbase
Changelog: https://docs.cypress.io/guides/references/changelog#10-3-1 ... We now collect environment variables for AWS CodeBuild when recording to the ...
Read more >
All the AWS CodeBuild You Can Stomach in 45 Minutes
GitHub project: https://github.com/krimple/ptw-2020- codebuild -sample (slides are in the presentation-slides.pdf file).OK, let's face it.
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