Cypress: Bad file descriptor

Created on 11 Mar 2020  Â·  8Comments  Â·  Source: cypress-io/cypress

Current behavior:

Every time I try and run cypress open (or cypress run) it fails with the following information:

i ï½¢wdsï½£: Project is running at http://10.255.239.56/
[0] i ï½¢wdsï½£: webpack output is served from /
[0] i ï½¢wdsï½£: Content not from webpack is served from C:\development\***\***\web_app\public
[0] i ï½¢wdsï½£: 404s will fallback to /index.html
[0] Starting the development server...
[0]
[1] child_process.js:122
[1]   p.open(fd);
[1]     ^
[1]
[1] Error: EBADF: bad file descriptor, uv_pipe_open
[1]     at Object._forkChild (child_process.js:122:5)
[1]     at setupChildProcessIpcChannel (internal/bootstrap/pre_execution.js:325:30)
[1]     at prepareMainThreadExecution (internal/bootstrap/pre_execution.js:51:3)
[1]     at internal/main/run_main_module.js:7:1 {
[1]   errno: -4083,
[1]   code: 'EBADF',
[1]   syscall: 'uv_pipe_open'
[1] }
[0] Compiled successfully!

The cypress window does open, but it's stuck in an infinite loading state.

Desired behavior:

For it to work.

Versions

Cypress version: 4.1.0
Windows 10
Chrome

Most helpful comment

@john-brown-bjss what works for me is to change the nodeVersion in cypress.json from system to bundled.

I'm using Node v12.16.1 locally whilst bundled is v12.8.1.

All 8 comments

@john-brown-bjss Could you run Cypress in debug mode mode and print the entire set of logs here?

Are you running this in combination with another command starting your server? Could you share the command you're running?

So we have two commands which we can run:

"test-ui": "concurrently --kill-others \"PORT=8080 node scripts/start.js\" \"cypress open\"",

"test-ui-ci": "concurrently --success=first --kill-others \"PORT=8080 node scripts/start.js\" \"cypress run\""

Command i'm running to debug:

"test-ui:debug": "concurrently --kill-others \"PORT=8080 node scripts/start.js\" \"DEBUG=cypress:cli cypress open\"",

Here's a debug log:

[1] 2020-03-12T07:53:36.346Z cypress:cli NODE_OPTIONS is not set
[1] 2020-03-12T07:53:36.666Z cypress:cli parsed cli options {}
[1] 2020-03-12T07:53:36.666Z cypress:cli opening from options {"project":"C:\\development\\***\\***\\web_app"}
[1] 2020-03-12T07:53:36.666Z cypress:cli command line arguments ["--project","C:\\development\\***\\***\\web_app"]
[1] 2020-03-12T07:53:36.666Z cypress:cli verifying Cypress app
[1] 2020-03-12T07:53:36.667Z cypress:cli checking environment variables
[1] 2020-03-12T07:53:36.669Z cypress:cli checking if executable exists C:\Users\***\AppData\Local\Cypress\Cache\4.1.0\Cypress\Cypress.exe
[1] 2020-03-12T07:53:36.674Z cypress:cli Binary is executable? : true
[1] 2020-03-12T07:53:36.674Z cypress:cli binaryDir is  C:\Users\***\AppData\Local\Cypress\Cache\4.1.0\Cypress
[1] 2020-03-12T07:53:36.675Z cypress:cli Reading binary package.json from: C:\Users\***\AppData\Local\Cypress\Cache\4.1.0\Cypress\resources\app\package.json
[1] 2020-03-12T07:53:36.678Z cypress:cli Found binary version 4.1.0 installed in: C:\Users\***\AppData\Local\Cypress\Cache\4.1.0\Cypress
[1] 2020-03-12T07:53:36.682Z cypress:cli { verified: true }
[1] 2020-03-12T07:53:36.682Z cypress:cli is Verified ? true
[1] 2020-03-12T07:53:36.683Z cypress:cli needs to start own Xvfb? false
[1] 2020-03-12T07:53:36.683Z cypress:cli spawning, should retry on display problem? false
[1] 2020-03-12T07:53:36.688Z cypress:cli spawning Cypress with executable: C:\Users\***\AppData\Local\Cypress\Cache\4.1.0\Cypress\Cypress.exe
[1] 2020-03-12T07:53:36.688Z cypress:cli spawn args [ '--', '--project', 'C:\\development\\***\\***\\web_app', '--cwd', 'C:\\development\\***\\***\\web_app' ] { detached: false, stdio: 'inherit', windowsHide: false }
[1] 
[0] i ï½¢wdsï½£: Project is running at http://10.255.239.56/
[0] i ï½¢wdsï½£: webpack output is served from /
[0] i ï½¢wdsï½£: Content not from webpack is served from C:\development\***\\***\web_app\public
[0] i ï½¢wdsï½£: 404s will fallback to /index.html
[0] Starting the development server...
[0]
[0] Compiled successfully!
[0]
[0] You can now view screening_web_app in the browser.
[0]
[0]   Local:            http://localhost:8080/
[0]   On Your Network:  http://10.255.239.56:8080/
[0]
[0] Note that the development build is not optimized.
[0] To create a production build, use yarn build.
[0]
[1] child_process.js:122
[1]   p.open(fd);
[1]     ^
[1]
Error: EBADF: bad file descriptor, uv_pipe_open
[1]     at Object._forkChild (child_process.js:122:5)
[1]     at setupChildProcessIpcChannel (internal/bootstrap/pre_execution.js:325:30)
[1]     at prepareMainThreadExecution (internal/bootstrap/pre_execution.js:51:3)
[1]     at internal/main/run_main_module.js:7:1 {
[1]   errno: -4083,
[1]   code: 'EBADF',
[1]   syscall: 'uv_pipe_open'
[1] }

I don't think this error if originating from the Cypress process, but from the other script. If you run cypress open separately from your start script does Cypress error?

Yes exact same problem. Also tried just running cypress run - same problem.

For now i've decided to use an Ubuntu VM to get past this crippling problem.

I am facing a similar issue only using Cypress 3.8.3 on Windows 10.

It appears that Cypress does not find the test specs.

When using cypress run command, I see:

$ cypress run

child_process.js:122
  p.open(fd);
    ^

Error: EBADF: bad file descriptor, uv_pipe_open
    at Object._forkChild (child_process.js:122:5)
    at setupChildProcessIpcChannel (internal/bootstrap/pre_execution.js:325:30)
    at prepareMainThreadExecution (internal/bootstrap/pre_execution.js:51:3)
    at internal/main/run_main_module.js:7:1 {
  errno: -4083,
  code: 'EBADF',
  syscall: 'uv_pipe_open'
}
bad file descriptor, uv_pipe_open

@john-brown-bjss what works for me is to change the nodeVersion in cypress.json from system to bundled.

I'm using Node v12.16.1 locally whilst bundled is v12.8.1.

Thanks @jaw111 I think this has solved my problem.

@jennifer-shehane Could we get some information why this helps fix the problem?

The nodeVersion will be used to:

  • Build files in the integrationFolder.
  • Build files in the supportFolder.
  • Execute code in the pluginsFile.

When set to bundled - it will use the version bundled with Cypress (currently 12.8.1), if set to system, it will use the Node.js version we found in your system.

So there's possibly something in the build process or execution of the pluginsFile that throws an error in a different version of Node.js than our bundled version - although we do run tests down to Node.js 8 for the Cypress product.

Is there anything specific in your supportFolder or pluginsFile that is maybe whats causing the error when run in a different Node.js version?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SecondFlight picture SecondFlight  Â·  3Comments

carloscheddar picture carloscheddar  Â·  3Comments

jennifer-shehane picture jennifer-shehane  Â·  3Comments

igorpavlov picture igorpavlov  Â·  3Comments

tahayk picture tahayk  Â·  3Comments