Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cypress + ECONNRESET

We've suddenly been having an issue with cypress automation, and it is impacting a number of people / different pc's.

It will run then stop with this error

Error: read ECONNRESET
    at TCP.onStreamRead (node:internal/stream_base_commons:211:20)
 {
  errno: -4077,
  code: 'ECONNRESET',
  syscall: 'read'
}
Error: read ECONNRESET
    at TCP.onStreamRead (node:internal/stream_base_commons:211:20)

Details...

Cypress Version 9.5.0 (but we have rolled back all the way to 9.2 and issue is present in all)

Node.js Version 16 (again, we've rolled back various version of Node 16 and tried 17)

Browser - Edge, Chrome, Firefox, all have this issue, (ONLY electron will run and stay alive)

Our Infrastructure team has helped roll back patching, group policy, proxy has been opened.....to the point its a standard pc with a direct connection to internet and the issue is still present.

Running Cypress in Debug mode gives us...

  cypress:server:api request to url: POST https://api.cypress.io/exceptions with params: {"body":{"err":{"name":"Error","message":"read ECONNRESET","stack":"Error: read ECONNRESET\n    at TCP.onStreamRead (node:internal<stripped-path>stream_base_commons:211:20)\n"},"version":"9.5.0","osName":"win32","osVersion":"10.0.19043","osCpus":[{"model":"Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz","speed":4008,"times":{"user":35718,"nice":0,"sys":34734,"idle":522062,"irq":1421}},{"model":"Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz","speed":4008,"times":{"user":26468,"nice":0,"sys":18562,"idle":547484,"irq":171}},{"model":"Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz","speed":4008,"times":{"user":48437,"nice":0,"sys":32609,"idle":511328,"irq":250}},{"model":"Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz","speed":4008,"times":{"user":29453,"nice":0,"sys":15000,"idle":547921,"irq":281}},{"model":"Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz","speed":4008,"times":{"user":36593,"nice":0,"sys":20656,"idle":535125,"irq":187}},{"model":"Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz","speed":4008,"times":{"user":50828,"nice":0,"sys":13906,"idle":527640,"irq":234}},{"model":"Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz","speed":4008,"times":{"user":37796,"nice":0,"sys":19703,"idle":534875,"irq":46}},{"model":"Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz","speed":4008,"times":{"user":27937,"nice":0,"sys":13546,"idle":550890,"irq":140}}],"osMemory":{"free":26111950848,"total":34228842496}},"headers":{"x-os-name":"win32","x-cypress-version":"9.5.0"}} and token: undefined +0ms
  cypress:network:agent addRequest called { isHttps: true, href: 'https://api.cypress.io/exceptions' } +11s
  cypress:network:connect beginning getAddress { hostname: 'api.cypress.io', port: 443 } +14s
Error: read ECONNRESET
    at TCP.onStreamRead (node:internal/stream_base_commons:211:20)
 {
  errno: -4077,
  code: 'ECONNRESET',
  syscall: 'read'
}
Error: read ECONNRESET
    at TCP.onStreamRead (node:internal/stream_base_commons:211:20)

https://api.cypress.io has been opened up in the proxy and even bypassing the proxy completely so the pc has a direct connection to the internet still had the same result.

Any suggestions?

like image 387
Biking-Monkey Avatar asked Mar 14 '26 23:03

Biking-Monkey


2 Answers

The way we got by this is to use Electron as your default browser to run your test. This will not get blocked by your antivirus.

like image 83
Jimmy Avatar answered Mar 17 '26 12:03

Jimmy


Update... Resolved (for us at least) after a process of elimination removing various apps / policies etc, we identified there was a setting within anti-virus that was scanning and interfering with internet traffic (how it got turned on who knows as our infra is so tightly controlled). Turned this off and it all started working as expected.

like image 45
Biking-Monkey Avatar answered Mar 17 '26 13:03

Biking-Monkey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!