npm install fails with ECONNRESET on new OSS environment

Feodor Fitsner's Avatar

Feodor Fitsner

10 Jul, 2015 11:02 PM

This project intermittently fails with ECONNRESET while doing npm install: https://ci.appveyor.com/project/floydpink/swara-server/history

After some investigation it seems requests to some URL(s) are being throttled by IP. We tried from VM on different IP from the same subnet and the problem was not reproducible. New environment VMs are working behind NAT and have a single external IP.

Is there any way to track down the issue to a specific npm package or even resource URL?

  1. 1 Posted by Hari Menon on 15 Jul, 2015 02:26 AM

    Hari Menon's Avatar

    Apologies about the delayed response on this, Feodor.

    As had mentioned in one of the tweets, here is the list of packages that npm seemed to have failed in the original repo, shown against the build numbers:

    1.0.49 - escape-string-regexp
    1.0.48 - gulp
    1.0.47 - kerberos
    1.0.46 - ws (not definitive)
    1.0.45 - ws (not definitive)
    1.0.44 - ws (not definitive)
    1.0.43 - v8-debug

    I also have created a smaller repo that also seems to be failing with the same error: https://ci.appveyor.com/project/floydpink/appveyor-npm-issue

    Thanks for your help in figuring out and fixing this issue.

  2. Support Staff 2 Posted by Feodor Fitsner on 15 Jul, 2015 02:58 AM

    Feodor Fitsner's Avatar

    Nope, this must be something else. 8 builds in a row - all successful: https://ci.appveyor.com/project/FeodorFitsner/npm-test/history

    Is there any way to "see" what request fails?

  3. 3 Posted by Hari Menon on 15 Jul, 2015 03:24 AM

    Hari Menon's Avatar

    I added the -dd flag to the npm install commands to get verbose logging enabled in this build which has also errored. But just scrolling down to the end of the log is proving to be a Himalayan effort - perhaps Download Log would be a nice-to-have feature for things like this. :)

  4. Support Staff 4 Posted by Feodor Fitsner on 15 Jul, 2015 03:44 AM

    Feodor Fitsner's Avatar

    Such a big log is no go anyway. It's just easier to click "Download log" - 12 MB :)

  5. Support Staff 5 Posted by Feodor Fitsner on 15 Jul, 2015 03:46 AM

    Feodor Fitsner's Avatar

    Does this piece means the problem is in lodash.repeat or async?

    [00:03:05] npm verb readDependencies loading dependencies from C:\projects\appveyor-npm-issue\mean-app\node_modules\mongoose\node_modul
    [00:03:05] es\bson\node_modules\bson-ext\node_modules\node-pre-gyp\node_modules\npmlog\node_modules\gauge\node_modules\lodash.padleft\node_modules\lodash._createpadding\node_modules\lodash.repeat\package.json
    [00:03:05] npm info preinstall lodash.repeat@3.0.1
    [00:03:05] npm info linkStuff async@0.9.2
    [00:03:05] npm verb stack Error: read ECONNRESET
    [00:03:05] npm verb stack     at exports._errnoException (util.js:746:11)
    [00:03:05] npm verb stack     at TCP.onread (net.js:559:26)
    [00:03:05] npm verb cwd C:\projects\appveyor-npm-issue\mean-app
    
  6. Support Staff 6 Posted by Feodor Fitsner on 15 Jul, 2015 03:54 AM

    Feodor Fitsner's Avatar

    It's really hard to understand what module/script throws that exception.

    Those two work: https://ci.appveyor.com/project/FeodorFitsner/npm-test/build/1.0.11...

  7. 7 Posted by Hari Menon on 15 Jul, 2015 11:17 AM

    Hari Menon's Avatar

    I understand it is not straight forward even with the verbose log.

    How do I download the log from the build? I would like to take a look as well.

  8. 8 Posted by Hari Menon on 15 Jul, 2015 02:41 PM

    Hari Menon's Avatar

    Never mind, I see the button now that I checked from my laptop. Just curious, was that button always there? :)

  9. Support Staff 9 Posted by Feodor Fitsner on 15 Jul, 2015 02:59 PM

    Feodor Fitsner's Avatar

    Yeah, it's been there from early beginning :)

    - Feodor

  10. 10 Posted by Hari Menon on 15 Jul, 2015 03:04 PM

    Hari Menon's Avatar

    I realized that now. For sure, I was sleep-deprived when trying look for that button yesterday!

    Unfortunately, I do not understand the error message either. There are a couple of msbuild errors which you also might have seen. Not sure if those are what caused the issue.

    I will add you into the test repo - feel free to make any changes there.

  11. 11 Posted by Hari Menon on 21 Jul, 2015 10:33 PM

    Hari Menon's Avatar
  12. 12 Posted by Gyandeep Singh on 22 Jul, 2015 06:20 PM

    Gyandeep Singh's Avatar

    Here is an another example where it has happened quite a few times: https://ci.appveyor.com/project/nzakas/eslint/branch/master/job/3mid80rfvg8fqsxa

  13. Support Staff 13 Posted by Feodor Fitsner on 22 Jul, 2015 06:25 PM

    Feodor Fitsner's Avatar

    Yeah, it looks bad. There is definitely something wrong - I'm trying to understand the cause of this issue as on Pro environment it's not reproducible.

  14. Support Staff 14 Posted by Feodor Fitsner on 02 Aug, 2015 08:07 PM

    Feodor Fitsner's Avatar

    Great news, the issue has been fixed! :)

    We removed RRAS with NAT, so every build worker is directly connected to a public network. Most probably that was NAT not working nicely with Node.js. However, there is still possibility that some web resource is throttling requests by IPs.

  15. 15 Posted by Hari Menon on 02 Aug, 2015 08:41 PM

    Hari Menon's Avatar

    awesome - thank you!

  16. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:58 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac