question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

We encountered an unexpected error talking to our servers (error: socket hang up)

See original GitHub issue

Current behavior:

Whenever I run tests with recording enable I get an error about it not being able to communicate with Cypress. Additionally, it retries at 30 seconds, 1 minute, and 2 minutes which adds 3:30 on to my total test run time.

What’s really interesting is it does successfully record the test on the cypress dashboard so I’m not sure what call is failing / retrying. Everything is working great. The logs and video are uploaded to the dashboard. However, my tests take 3 minutes longer than they should because they need to retry whatever this call is 3 times before the tests can even start.

Error message

Screenshot from 2019-03-25 18-14-53

Results in dashboard

Screenshot from 2019-03-25 18-20-35

Desired behavior:

Should not fail to contact cypress server or retry repeatedly on a call that is clearly not needed for the core functionality to succeed.

Steps to reproduce: (app code and test code)

This is just a default install of cypress running on a newly created Digital Ocean droplet running Ubuntu 18 Server. I also see this issue if I try to run it locally (on Ubuntu 18 desktop). Repro is probably just npm install cypress on Ubuntu and try to have it report to the dashboard.

The error happens during initialization (before any tests run) so I doubt the test code is relevant

This is the command I’m using to run the tests:

cypress run --spec cypress/tests/live-tests.spec.js --record --key my-key-here

(if I remove --record --key there is no error, but obviously it doesn’t record to the dashboard)

cypress.json is pretty minimal, but here it is just in case:

{
  "fixturesFolder": false,
  "integrationFolder": "cypress/tests",
  "pluginsFile": false,
  "defaultCommandTimeout": 15000,
  "projectId": "redacted"
}

Versions

OS: Ubuntu 18.04.2 LTS Browser: Electron 59.0.3071.115 (default) Cypress: 3.2.0 (in the screenshots it’s 3.1.5, but I upgraded and tried again and got the same result)

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:19 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
javierfuentesmcommented, Aug 6, 2022

hey im getting this error inside jenkins when i run the tests with the --record and the -key for the cypress dashboard image

1reaction
maryhippcommented, Jun 11, 2019

We are also having this problem running our test suite against both Chrome 74 and Electron 59 (headless) on CI pipelines in Jenkins, using Cypress 3.2.0. Our test suite always ends up running and recording to the dashboard successfully, but takes anywhere from 1-3 tries with that same output before the first test will start.

We encountered an unexpected error talking to our servers.

We will retry 3 more times in 30 seconds...

The server's response was:

RequestError: Error: socket hang up

I can send debug logs but there are a LOT - should I focus on a certain section that would be helpful? This is the request that times out and then eventually succeeds, usually only for the first test.

Tue, 11 Jun 2019 21:27:28 GMT cypress:server:api request to url: POST https://api.cypress.io/runs/********/instances with params: {"body":{"spec":"dist/integration/api/companies/companies-find.spec.js","groupId":"linux-Chrome-74-ac57cc4057","machineId":"45400210-88a8-4b3b-b8b9-1ab9ae4d51c9","platform":{"osCpus":[{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":3400,"times":{"user":827300,"nice":0,"sys":188600,"idle":5578100,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":3385,"times":{"user":762000,"nice":0,"sys":155600,"idle":5724400,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":3399,"times":{"user":788700,"nice":0,"sys":161700,"idle":6091800,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":3391,"times":{"user":786600,"nice":0,"sys":176500,"idle":6102900,"irq":0}}],"osName":"linux","osMemory":{"free":4363681792,"total":7997227008},"osVersion":"Amazon Linux - 2018.03","browserName":"Chrome","browserVersion":"74.0.3729.157"}},"headers":{"x-route-version":"5","x-os-name":"linux","x-cypress-version":"3.2.0"}}
Read more comments on GitHub >

github_iconTop Results From Across the Web

NodeJS - What does "socket hang up" actually mean?
When you, as a client, send a request to a remote server, and receive no timely response. Your socket is ended which throws...
Read more >
cypress-io/cypress - Gitter
```We encountered an unexpected error talking to our servers. ... The server's response was: RequestError: Error: socket hang up.
Read more >
Socket hang up problems - Google Groups
I am using 0.4.8 and still see the hang up problem. What i did: 100-500 concurrent threads sent from my node.js server to...
Read more >
Unknown server issue socket hang up - Appium Discuss
I got this issue with something like this: [debug] e[35m[W3C (58f83265)]e[39m Encountered internal error running command: UnknownError: An ...
Read more >
How to handle a socket hang up error in Node.js usually - Quora
Socket hang up error is thrown in two cases. When you are a client & When you are a server/proxy When you, as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found