3

Cypress is failing whenever it tries to start the browser for any test. The debug output (below) for Cypress says that it makes a request of api.cypress.io at port 443 but that's get rejected with ECONNRESET. This worked fine until yesterday, 3/15/2022.

 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.2","osName":"win32","osVersion":"10.0.19044","osCpus":[{"model":"Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz","speed":2592,"times":{"user":1742484,"nice":0,"sys":2745609,"idle":83140890,"irq":564140}},{"model":"Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz","speed":2592,"times":{"user":1367906,"nice":0,"sys":770843,"idle":85490125,"irq":12953}},{"model":"Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz","speed":2592,"times":{"user":3082156,"nice":0,"sys":1812125,"idle":82734593,"irq":58062}},{"model":"Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz","speed":2592,"times":{"user":1978218,"nice":0,"sys":1167062,"idle":84483593,"irq":5796}},{"model":"Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz","speed":2592,"times":{"user":1980421,"nice":0,"sys":1389296,"idle":84259156,"irq":58531}},{"model":"Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz","speed":2592,"times":{"user":1058968,"nice":0,"sys":641062,"idle":85928843,"irq":5765}},{"model":"Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz","speed":2592,"times":{"user":1659281,"nice":0,"sys":1226531,"idle":84743062,"irq":15203}},{"model":"Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz","speed":2592,"times":{"user":7150921,"nice":0,"sys":2484828,"idle":77993125,"irq":15234}},{"model":"Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz","speed":2592,"times":{"user":1834953,"nice":0,"sys":1689578,"idle":84104343,"irq":15718}},{"model":"Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz","speed":2592,"times":{"user":1049156,"nice":0,"sys":710531,"idle":85869156,"irq":6703}},{"model":"Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz","speed":2592,"times":{"user":2008078,"nice":0,"sys":2070031,"idle":83550734,"irq":40375}},{"model":"Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz","speed":2592,"times":{"user":1321593,"nice":0,"sys":1019718,"idle":85287531,"irq":8406}}],"osMemory":{"free":13561356288,"total":34093076480}},"headers":{"x-os-name":"win32","x-cypress-version":"9.5.2"}} and token: undefined +0ms
  cypress:network:agent addRequest called { isHttps: true, href: 'https://api.cypress.io/exceptions' } +4s
  cypress:network:connect beginning getAddress { hostname: 'api.cypress.io', port: 443 } +167ms
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)

6 Answers6

5

As I don't have enough of a reputation to upvote or add a comment onto others answers here is what I've found with this issue.

My company uses Sophos as its antivirus and this I can confirm is the cause (at least for me). After speaking with the IT team they gave me the tamper password and I was able to go into the settings and disable 'Network Threat Protection' after doing this I was able to run Cypress with no issues.

*** Update *** I've posted in the Sophos community forums here and while I test out one of the changes that needs to be made for Sophos there does appear to be a workaround (that worked for me) and that is to use the "Electron browser" rather than Chrome, Firefox or Edge.

ajling
  • 61
  • 3
  • It's been raised as an advisory: https://support.sophos.com/support/s/article/KB-000044041?language=en_US – svict4 May 25 '22 at 07:14
1

I believe it's something to do with Sophos.

Simon Lam
  • 11
  • 1
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 19 '22 at 09:12
0

This was working fine for me until I tried on March 14th. I get the same behaviour. The browser starts, it runs a little bit and crashes with this error. I was thinking it had to do something with an update on my computer, and I didn't see anyone else have this issue recently until just now.

ouflak
  • 2,458
  • 10
  • 44
  • 49
Kratrz
  • 1
  • 1
  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 17 '22 at 22:10
0

I'm having the same issue, but I have found no solution for it so far. Just to shed some light, this what I have configured and what I tried:

  • O.S: Windows 10
  • Node version: 16.13.1
  • Cypress version: tried 9.2.0 and 9.5.4
  • Others: I have Sophos on my computer, but no admin rights on it. Also, the issue started just a few days ago for me, while the project I'm working on I've been on it for several weeks.
  • I tried cleaning the cache, but did not solve the issue.
  • I tried creating a new cypress project and run the example tests, and the issue happened as well.

I know this is not an answer as it does not give a solution to the issue, but I hope it may help getting there

0

I finally figured out that Cypress was trying to connect to it's man server which runs the Cypress Dashboard. That's a product that Cypress offers to let you monitor and debug tests that fail in a CI/CD pipeline. I don't remember now how I solve it but we did eventually create an account there. They have a free version.

  • This doesn't really answer or help solve the issue, just re-states the problem. I think @ajling's answer is really what should be accepted since the workaround to use the Electron browser works, also that user put in effort to report and continue the discussion on the Sophos Community website, since Sophos does appear to he the culprit in this case. – Sergey Apr 29 '22 at 22:58
0

I was also facing this issue and after doing lots of analysis, I found that it is happening because of Antivirus installed on my machine. Particularly due to Sophos. You can find this issue at - https://community.sophos.com/intercept-x-endpoint/f/discussions/134136/sophos-network-threat-detection-is-blocking-cypress-automation-tool

To solve this issue, try to execute your test cases on Electron browser, or contact your admin team and get the password of Sophos and then Login into the Sophos, Go to settings and disable 'Network Threat Protection'

Sudheer Singh
  • 555
  • 5
  • 10