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.

warn (proxy): Proxy Request failed - Error: socket hang up

See original GitHub issue

I see the following when running angular scenario tests:

info (Chrome 22.0): Connected on socket id d3eUh0FBtoVaT-CdRlHB
Chrome 22.0: Executed 2 of 7
Chrome 22.0: Executed 3 of 7
warn (proxy): Proxy Request failed - Error: socket hang up
warn (proxy): Proxy Request failed - Error: socket hang up
warn (proxy): Proxy Request failed - Error: socket hang up
Chrome 22.0: Executed 5 of 7
warn (proxy): Proxy Request failed - Error: socket hang up
warn (proxy): Proxy Request failed - Error: socket hang up
warn (proxy): Proxy Request failed - Error: socket hang up
Chrome 22.0: Executed 7 of 7 SUCCESS (1.134 secs / 0.988 secs)

You can use angular-phonecat to repro the issue.

I think that the issue is that the app initiates multiple requests per test that are proxied via the built in proxy. Most of the requests are for asset files (images) and some of these get handled by the proxy only after the test is done. At this point, the browser navigates (within the iframe) to a new page and cancels all the pending requests. Proxy then freaks out because it has all these requests mid-flight and issues a warning log.

Since this particular scenario is harmless, I would reclassify the log as debug instead of warn

Issue Analytics

  • State:closed
  • Created 11 years ago
  • Comments:5

github_iconTop GitHub Comments

5reactions
Carniattocommented, Feb 24, 2016

Just figured it out:


...
  files: [
        {pattern: 'www/lib/angular-i18n/angular-locale_en.js', watched: false, included: true, served: true, nocache: false}],

  proxies: {
      '/lib/angular-i18n/': '/base/www/lib/angular-i18n/'
    },
...

the /base/ at the begging of the proxie values was what was missing for me

3reactions
MohannadNajcommented, Nov 30, 2017

I tried to be clever and map proxies to the regular node-paths conventions, but ./dir caused the issue and /dir without the dot fixed it for me.

So I replaced:

...
    proxies: {
      '/images':'./dist/images'
    },
...

to:

... 
    proxies: {
      '/images':'/dist/images'
    },
...

and Ta-Dah! the annoying message is gone.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NodeJS - What does "socket hang up" actually mean?
It means that socket does not send connection end event within the timeout period. If you are getting the request for cheerio via...
Read more >
NodeJS - What does socket hang up actually mean - Edureka
When you're a customer, When you send a request to a distant server as a client and don't get a response in a...
Read more >
502 Bad Gateway - Socket hang up | Apigee Edge
The error code [socket hang up][ECONNRESET] indicates that the target server has closed the connection with Edge Microgateway. This can be ...
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 >
UniversalPackages task fails with socket hang up error behind ...
ProxyUsername =undefined 2020-03-26T22:19:28.9720166Z ##[debug]Agent. ... cause=socket hang up 2020-03-26T22:21:14.2279347Z ##[debug]Error: tunneling socket ...
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