Azure-pipelines-tasks: Npm command execution is failing throwing ECONNRESET

Created on 13 Sep 2018  路  7Comments  路  Source: microsoft/azure-pipelines-tasks

Troubleshooting

Checkout how to troubleshoot failures and collect debug logs: https://docs.microsoft.com/en-us/vsts/build-release/actions/troubleshooting

Environment

  • Server - VSTS
    account name: Juan Arango ([email protected])
    project name: Brainshark
    build definition name: UI Automation - Coaching
    build number: 2558

  • Agent - Hosted:
    Hosted Agent
    Hosted Agent 2
    Hosted Agent 3
    Hosted Agent 4

Issue Description

Some npm executions are failing and is showing read ECONNRESET . When it fails these are the specific npm and node versions with it is running:

user-agent = "npm/6.4.1 node/v8.12.0 win32 x64"

when the execution pass these are the is the specific npm and node versions:

user-agent = "npm/5.6.0 node/v8.11.4 win32 x64"

Error logs

2018-09-13T09:34:01.0182559Z ##[section]Starting: Run Protractor Test
2018-09-13T09:34:01.0187268Z ==============================================================================
2018-09-13T09:34:01.0187450Z Task : npm
2018-09-13T09:34:01.0187803Z Description : Install and publish npm packages, or run an npm command. Supports npmjs.com and authenticated registries like Package Management.
2018-09-13T09:34:01.0187983Z Version : 1.0.24
2018-09-13T09:34:01.0188129Z Author : Microsoft Corporation
2018-09-13T09:34:01.0188285Z Help : More Information
2018-09-13T09:34:01.0188478Z ==============================================================================
2018-09-13T09:34:01.5279609Z SYSTEMVSSCONNECTION exists true
2018-09-13T09:34:01.6866080Z SYSTEMVSSCONNECTION exists true
2018-09-13T09:34:01.8454064Z [command]C:\Windows\system32\cmd.exe /D /S /C "D:\a_tool\node\8.12.0\x64\npm.cmd --version"
2018-09-13T09:34:02.4794113Z 6.4.1
2018-09-13T09:34:03.8344689Z [command]C:\Windows\system32\cmd.exe /D /S /C "D:\a_tool\node\8.12.0\x64\npm.cmd config list"
2018-09-13T09:34:04.4960074Z ; cli configs
2018-09-13T09:34:04.4961454Z metrics-registry = "http://registry.npmjs.org/"
2018-09-13T09:34:04.4961730Z scope = ""
2018-09-13T09:34:04.4961961Z user-agent = "npm/6.4.1 node/v8.12.0 win32 x64"
2018-09-13T09:34:04.4962150Z
2018-09-13T09:34:04.4962337Z ; environment configs
2018-09-13T09:34:04.4962554Z cache = "C:\NPM\Cache"
2018-09-13T09:34:04.4962761Z prefix = "C:\NPM\Modules"
2018-09-13T09:34:04.4962974Z userconfig = "D:\a\1\npm\2558.npmrc"
2018-09-13T09:34:04.4963349Z
2018-09-13T09:34:04.4963553Z ; globalconfig C:\NPM\Modules\etc\npmrc
2018-09-13T09:34:04.4963767Z registry = "http://registry.npmjs.org/"
2018-09-13T09:34:04.4963938Z
2018-09-13T09:34:04.4964144Z ; node bin location = D:\a_tool\node\8.12.0\x64\node.exe
2018-09-13T09:34:04.4964370Z ; cwd = D:\a\1\s
2018-09-13T09:34:04.4964566Z ; HOME = C:\Users\buildguest
2018-09-13T09:34:04.4964813Z ; "npm config ls -l" to show all defaults.
2018-09-13T09:34:04.4964986Z
2018-09-13T09:34:04.4968919Z [command]C:\Windows\system32\cmd.exe /D /S /C "D:\a_tool\node\8.12.0\x64\npm.cmd run e2e:vsts-sauce "--server=prod" "--browser=chrome" -- --specs e2e/tests/ui-tests/coaching//e2e-spec.ts"
2018-09-13T09:34:07.2155552Z (node:364) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
2018-09-13T09:34:07.2155775Z
2018-09-13T09:34:07.2155994Z > [email protected] e2e:vsts-sauce D:\a\1\s
2018-09-13T09:34:07.2156196Z > ng e2e --no-serve --config protractor.conf.saucelabs.js "--specs" "e2e/tests/ui-tests/coaching/
/e2e-spec.ts"
2018-09-13T09:34:07.2156361Z
2018-09-13T09:34:07.2156553Z [09:34:06] I/file_manager - creating folder D:\a\1\s\node_modules\protractor\node_modules\webdriver-manager\selenium
2018-09-13T09:34:07.2157851Z events.js:183
2018-09-13T09:34:07.2160404Z throw er; // Unhandled 'error' event
2018-09-13T09:34:07.2160774Z ^
2018-09-13T09:34:07.2160962Z
2018-09-13T09:34:07.2161152Z Error: read ECONNRESET
2018-09-13T09:34:07.2161378Z at TLSWrap.onread (net.js:622:25)
2018-09-13T09:34:07.2161582Z npm ERR! code ELIFECYCLE
2018-09-13T09:34:07.2161786Z npm ERR! errno 1
2018-09-13T09:34:07.2162056Z npm ERR! [email protected] e2e:vsts-sauce: ng e2e --no-serve --config protractor.conf.saucelabs.js "--specs" "e2e/tests/ui-tests/coaching/**/*e2e-spec.ts"
2018-09-13T09:34:07.2162336Z npm ERR! Exit status 1
2018-09-13T09:34:07.2162520Z npm ERR!
2018-09-13T09:34:07.2162734Z npm ERR! Failed at the [email protected] e2e:vsts-sauce script.
2018-09-13T09:34:07.2163958Z npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-09-13T09:34:07.2690479Z
2018-09-13T09:34:07.2690738Z npm ERR! A complete log of this run can be found in:
2018-09-13T09:34:07.2690930Z npm ERR! C:\NPM\Cache_logs\2018-09-13T09_34_07_184Z-debug.log
2018-09-13T09:34:07.2694266Z Found npm debug log, make sure the path matches with the one in npm's output: C:\NPM\Cache_logs\2018-09-13T09_34_07_184Z-debug.log
2018-09-13T09:34:07.2695471Z 0 info it worked if it ends with ok
2018-09-13T09:34:07.2696026Z 1 verbose cli [ 'D:\a\_tool\node\8.12.0\x64\node.exe',
2018-09-13T09:34:07.2696287Z 1 verbose cli 'D:\a\_tool\node\8.12.0\x64\node_modules\npm\bin\npm-cli.js',
2018-09-13T09:34:07.2696466Z 1 verbose cli 'run',
2018-09-13T09:34:07.2696602Z 1 verbose cli 'e2e:vsts-sauce',
2018-09-13T09:34:07.2696741Z 1 verbose cli '--server=prod',
2018-09-13T09:34:07.2696891Z 1 verbose cli '--browser=chrome',
2018-09-13T09:34:07.2697047Z 1 verbose cli '--',
2018-09-13T09:34:07.2697176Z 1 verbose cli '--specs',
2018-09-13T09:34:07.2697339Z 1 verbose cli 'e2e/tests/ui-tests/coaching//e2e-spec.ts' ]
2018-09-13T09:34:07.2697488Z 2 info using [email protected]
2018-09-13T09:34:07.2697617Z 3 info using [email protected]
2018-09-13T09:34:07.2697878Z 4 verbose run-script [ 'pree2e:vsts-sauce', 'e2e:vsts-sauce', 'poste2e:vsts-sauce' ]
2018-09-13T09:34:07.2698097Z 5 info lifecycle [email protected]~pree2e:vsts-sauce: [email protected]
2018-09-13T09:34:07.2698293Z 6 info lifecycle [email protected]~e2e:vsts-sauce: [email protected]
2018-09-13T09:34:07.2698488Z 7 verbose lifecycle [email protected]~e2e:vsts-sauce: unsafe-perm in lifecycle true
2018-09-13T09:34:07.2700164Z 8 verbose lifecycle [email protected]~e2e:vsts-sauce: PATH: D:\a_tool\node\8.12.0\x64\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\a\1\s\node_modules.bin;D:\a_tool\node\8.12.0\x64;C:\LR\mms\Services\Mms\Provisioner\TaskAgent\agents\2.140.0\externals\git\cmd;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.4\;C:\Users\VssAdministrator.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Microsoft Emulator Manager\1.0\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files (x86)\Microsoft SDKs\Azure\CLI\wbin;C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\Git LFS;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files\Git\cmd;C:\Program Files\Git\bin;C:\Program Files\Git\usr\bin;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Python27;C:\Program Files\dotnet\;C:\Program Files (x86)\CMake\bin;C:\NPM\Modules;C:\Program Files\nodejs\;C:\NPM\Modules;C:\cordova;C:\java\ant\apache-ant-1.9.7\bin;C:\NPM\Modules;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn\;C:\cf-cli_6.25.0_winx64\;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\
2018-09-13T09:34:07.2702836Z 9 verbose lifecycle [email protected]~e2e:vsts-sauce: CWD: D:\a\1\s
2018-09-13T09:34:07.2703061Z 10 silly lifecycle [email protected]~e2e:vsts-sauce: Args: [ '/d /s /c',
2018-09-13T09:34:07.2703677Z 10 silly lifecycle 'ng e2e --no-serve --config protractor.conf.saucelabs.js "--specs" "e2e/tests/ui-tests/coaching/
/e2e-spec.ts"' ]
2018-09-13T09:34:07.2703917Z 11 silly lifecycle [email protected]~e2e:vsts-sauce: Returned: code: 1 signal: null
2018-09-13T09:34:07.2704120Z 12 info lifecycle [email protected]~e2e:vsts-sauce: Failed to exec e2e:vsts-sauce script
2018-09-13T09:34:07.2704376Z 13 verbose stack Error: [email protected] e2e:vsts-sauce: ng e2e --no-serve --config protractor.conf.saucelabs.js "--specs" "e2e/tests/ui-tests/coaching/**/*e2e-spec.ts"
2018-09-13T09:34:07.2704617Z 13 verbose stack Exit status 1
2018-09-13T09:34:07.2704822Z 13 verbose stack at EventEmitter. (D:\a_tool\node\8.12.0\x64\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
2018-09-13T09:34:07.2705038Z 13 verbose stack at emitTwo (events.js:126:13)
2018-09-13T09:34:07.2705206Z 13 verbose stack at EventEmitter.emit (events.js:214:7)
2018-09-13T09:34:07.2705440Z 13 verbose stack at ChildProcess. (D:\a_tool\node\8.12.0\x64\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
2018-09-13T09:34:07.2705648Z 13 verbose stack at emitTwo (events.js:126:13)
2018-09-13T09:34:07.2705812Z 13 verbose stack at ChildProcess.emit (events.js:214:7)
2018-09-13T09:34:07.2705995Z 13 verbose stack at maybeClose (internal/child_process.js:915:16)
2018-09-13T09:34:07.2706190Z 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
2018-09-13T09:34:07.2706371Z 14 verbose pkgid [email protected]
2018-09-13T09:34:07.2706572Z 15 verbose cwd D:\a\1\s
2018-09-13T09:34:07.2706709Z 16 verbose Windows_NT 6.3.9600
2018-09-13T09:34:07.2706990Z 17 verbose argv "D:\a\_tool\node\8.12.0\x64\node.exe" "D:\a\_tool\node\8.12.0\x64\node_modules\npm\bin\npm-cli.js" "run" "e2e:vsts-sauce" "--server=prod" "--browser=chrome" "--" "--specs" "e2e/tests/ui-tests/coaching/*/e2e-spec.ts"
2018-09-13T09:34:07.2707257Z 18 verbose node v8.12.0
2018-09-13T09:34:07.2707393Z 19 verbose npm v6.4.1
2018-09-13T09:34:07.2707524Z 20 error code ELIFECYCLE
2018-09-13T09:34:07.2707649Z 21 error errno 1
2018-09-13T09:34:07.2707949Z 22 error [email protected] e2e:vsts-sauce: ng e2e --no-serve --config protractor.conf.saucelabs.js "--specs" "e2e/tests/ui-tests/coaching/**/*e2e-spec.ts"
2018-09-13T09:34:07.2708153Z 22 error Exit status 1
2018-09-13T09:34:07.2708392Z 23 error Failed at the [email protected] e2e:vsts-sauce script.
2018-09-13T09:34:07.2708590Z 23 error This is probably not a problem with npm. There is likely additional logging output above.
2018-09-13T09:34:07.2709184Z 24 verbose exit [ 1, true ]
2018-09-13T09:34:07.2709291Z
2018-09-13T09:34:07.2763626Z ##[error]Error: Npm failed with return code: 1
2018-09-13T09:34:07.2786454Z ##[section]Finishing: Run Protractor Test

ArtifactsPackages Investigate

Most helpful comment

Try disabling TLS (seems to be a problem in Windows only). Worked for me.

https://stackoverflow.com/questions/8874363/npm-install-without-ssl

Ended up being that I wasn't on my VPN, if this is the case for anyone else. It's noted in a comment on this SO question and I didn't make the connection initially.

Edit: If you ended up on this because you can't get Webdriver to update, just download and copy over the chromedriver into the folder and run the command again, it'll resolve itself and make the update-config you need.

All 7 comments

Try disabling TLS (seems to be a problem in Windows only). Worked for me.

https://stackoverflow.com/questions/8874363/npm-install-without-ssl

Try disabling TLS (seems to be a problem in Windows only). Worked for me.

https://stackoverflow.com/questions/8874363/npm-install-without-ssl

Ended up being that I wasn't on my VPN, if this is the case for anyone else. It's noted in a comment on this SO question and I didn't make the connection initially.

Edit: If you ended up on this because you can't get Webdriver to update, just download and copy over the chromedriver into the folder and run the command again, it'll resolve itself and make the update-config you need.

Try disabling TLS (seems to be a problem in Windows only). Worked for me.

https://stackoverflow.com/questions/8874363/npm-install-without-ssl

I tried to disable TLS but issue persists. And, this happens randomly which is a problem for us.

@bhanu7755 @jpaa07 are you still seeing this issue occur?

@alexmullans Yes, it still happens daily.

@jpaa07 Are you still seeing this issue? If yes, can you do a more recent run with debug logs and attach the logs here?

@aasim I don't know if @jpaa07 is still facing the issue but I'm still getting that. I'm attaching logs if that helps
logs_51782.zip

Was this page helpful?
0 / 5 - 0 ratings