Search code examples
cypress

Why does Cypress get ECONNRESET when accessing api.cypress.io port 443?


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)

Solution

  • 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.