Search code examples
node.jsgoogle-chrometestingcypress

Cypress in a headless chrome mode: Error: read ECONNRESET at TCP.onStreamRead (internal/stream_base_commons.js:205:27)


I have updated my Ubuntu (23.04, kernel Linux 6.2.0-32-generic) and Chrome (117), and cypress run command in a headless mode with a Chrome browser is not working now. There were no problems when I use Chrome v115.

I try to run this command: yarn cypress run --headless --browser chrome --spec path/to/mytest.spec.js and getting an error:

Error: read ECONNRESET
    at TCP.onStreamRead (internal/stream_base_commons.js:205:27)
 {
  errno: 'ECONNRESET',
  code: 'ECONNRESET',
  syscall: 'read'
}

I will be grateful for the any answer or advice, thank you!

Environment:
Ubuntu: 23.04, Linux 6.2.0-32-generic
Cypress: v6.8.0
Chrome: v117
NodeJS: 18.16.1
NVM: v0.39.3


Solution

  • This issue is caused by a bug in Chromium 117 which affects Chrome 117. It was also logged as Cypress issue 27804 which lists different workarounds. This issue is now closed as resolved due to the release of the fix for Chrome (see below).

    One of the workarounds listed in the Cypress issue is to update to a Cypress version > 12.14.0. The other workarounds are more targeted to non-legacy versions of Cypress >= 10.0.0. The Cypress 6.8.0 version you are using belongs to the legacy versions of Cypress so not all of the workarounds may apply exactly.

    The following update to Google Chrome Stable Channel Update for Desktop resolves the issue:

    Wednesday, September 27, 2023 The Stable channel has been updated to 117.0.5938.132 for Windows, Mac and Linux, which will roll out over the coming days/weeks.