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.

Do not fail installation when Google Analytics call fails

See original GitHub issue

I had trouble installing pact. I kept getting the following error:

> @pact-foundation/pact-node@6.16.1 postinstall /Users/bao/.nvm/versions/node/v8.9.1/lib/node_modules/@pact-foundation/pact-node
> node postinstall.js

Installing Pact Standalone Binary for darwin.
Downloading Pact Standalone Binary v1.43.0 for platform darwin from https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v1.43.0/pact-1.43.0-osx.tar.gz
Please note: we are tracking this download anonymously to gather important usage statistics. To disable tracking, set 'DO_NOT_TRACK=true' as an environment variable.
events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: connect ECONNREFUSED 0.0.0.0:443
    at Object._errnoException (util.js:1024:11)
    at _exceptionWithHostPort (util.js:1046:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)

Only when I set DO_NOT_TRACK=true the installation worked. I believe that the call to Google Analytics failed.

Please add a catch clause to that call so it does not break the installation if the call fails.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
mboudreaucommented, May 8, 2018

@sbaechler Eh, doesn’t matter either way, I’ve added something to ignore errors that might arise. The fix will be out with 6.16.2

@mefellows it seems that my understanding of the node HTTP client was lacking when it came to error handling. Apparently, if you don’t handle it via a listener, it actually bubbles up and errors out at the process level, which is weird because it actually doesn’t seem to ‘throw’ anywhere.

0reactions
mboudreaucommented, May 9, 2018

Ah, that’s why. Either way, it’s a good edge case for us, and it should fail gracefully 😃

On Tue, May 8, 2018 at 11:16 PM Simon Bächler notifications@github.com wrote:

I forgot, I block trackers in the hosts file using hBlock https://github.com/zant95/hBlock. That’s why the Google Analytics call failed.

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/pact-foundation/pact-node/issues/91#issuecomment-387398486, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjA5CA7jtC9uvJC_fTpmrXqMaODxV8Zks5twZq1gaJpZM4T2Kfv .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Google Analytics Errors - Tag Assistant Help
This error denotes that the call to google-analytics.com/urchin.js was not made and the request is missing from the JavaScript. Omitting the call to...
Read more >
Google Analytics not working? Here are 21 ways to fix it
Google Analytics not working? Here are 21 ways to fix it. #1 Delete and Disable the cache #2 Use Google Tag Assistant and...
Read more >
29 Common Google Analytics Data Errors And How To Fix Them
Google Analytics data not showing all traffic or no view data? Here's why your data is wrong and how to fix the most...
Read more >
Google Analytics Not Working: 20 Common Errors & How to ...
Find out why Google Analytics is not woking. We've compiled a list of most common errors in Google Analytics and their fixes.
Read more >
How to Fix Common Google Analytics Errors (Blank Page ...
There is a temporary service disruption preventing some users from accessing their Google Analytics account with the following error message ...
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