Cypress + ECONNRESET
Asked Answered
B

4

11

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?

Browning answered 28/2, 2022 at 11:2 Comment(3)
Update - tried the latest cypress 9.5.1 and issue is still presentBrowning
How do you run Cypress in debug mode?Fruiter
@Fruiter See docs.cypress.io/guides/guides/command-line#Enable-Debug-LogsPolley
L
5

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.

Ledbetter answered 29/4, 2022 at 20:54 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Needleful
B
3

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.

Browning answered 4/3, 2022 at 10:17 Comment(4)
We are having same issue, and I do not have any privileges to disable it the anti-virus settings. Is there a workaround it? Also can you specify which anti-virus causing the issue for you? any change in cypress.json that could help?Immesh
Yes please, we are having the same issues. Any more details would be helpful!Fruiter
We were using Sophos and the particular setting is network threat protection (we had to disable it)Browning
If you're running Sophos, it's a known issue: support.sophos.com/support/s/article/…Brynne
R
0

It is possible to opt out of sending information to https://api.cypress.io/exceptions by setting the environment variable CYPRESS_CRASH_REPORTS=0

See this link for more information: https://github.com/cypress-io/cypress/issues/4386

Rosaline answered 1/6, 2022 at 8:23 Comment(0)
P
0

To resolve this issue please remove the antivirus or any other protection that is installed in your system.

Pickings answered 20/9, 2022 at 6:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.