tag:help.appveyor.com,2012-11-13:/discussions/problems/16920-builds-failing-on-chromedriver-download-angular-6-cli-e2e-tests-stepAppVeyor: Discussion 2018-10-24T16:44:24Ztag:help.appveyor.com,2012-11-13:Comment/461082602018-09-19T09:16:47Z2018-09-20T02:25:49ZBuilds failing on Chromedriver download (Angular 6 CLI e2e tests step)<div><p>We have two Angular 6 CLI projects where the e2e tests step fails on AppVeyor:</p>
<p>This is the anonymized tail of the log:</p>
<pre>
<code>[13:43:00] I/file_manager - creating folder C:\projects\projectnamehere\node_modules\protractor\node_modules\webdriver-manager\selenium
[13:43:00] I/config_source - curl -oC:\projects\projectnamehere\node_modules\protractor\node_modules\webdriver-manager\selenium\chrome-response.xml https://chromedriver.storage.googleapis.com/
ℹ 「wdm」: Compiled successfully.
events.js:183
throw er; // Unhandled 'error' event
^
Error: read ECONNRESET
at TLSWrap.onread (net.js:622:25)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! projectnamehere@0.0.0 e2e: `node git-version.js && ng e2e`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the projectnamehere@0.0.0 e2e script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\appveyor\AppData\Roaming\npm-cache\_logs\2018-09-18T13_43_01_245Z-debug.log
Command exited with code 1</code>
</pre>
<p>At the point where AppVeyor now fails, it previously (and locally for the current commits) showed:</p>
<pre>
<code>[13:43:21] I/file_manager - creating folder C:\projects\projectnamehere\node_modules\protractor\node_modules\webdriver-manager\selenium
[13:43:21] I/config_source - curl -oC:\projects\projectnamehere\node_modules\protractor\node_modules\webdriver-manager\selenium\chrome-response.xml https://chromedriver.storage.googleapis.com/
ℹ 「wdm」: Compiled successfully.
[13:43:22] I/downloader - curl -oC:\projects\projectnamehere\node_modules\protractor\node_modules\webdriver-manager\selenium/chromedriver_2.42.zip https://chromedriver.storage.googleapis.com/2.42/chromedriver_win32.zip
[13:43:22] I/update - chromedriver: unzipping chromedriver_2.42.zip
[13:43:23] I/launcher - Running 1 instances of WebDriver
[13:43:23] I/direct - Using ChromeDriver directly...
Jasmine started
etc.</code>
</pre>
<p>This happens intermittently: sometimes we try a fix/workaround (upgrading Node, putting a curl command in the test_scripts) and it <em>seems</em> to work, but the same commit might fail a build if re-run.</p>
<p>Given that the same commit sometimes fails, and sometimes doesn't, I presume this is an AppVeyor issue?</p>
<p>Here's our <code>appveyor.yml</code> relevant parts:</p>
<pre>
<code>version: 1.0.{build}
image: Visual Studio 2017
skip_branch_with_pr: true
environment:
nodejs_version: "8"
cache:
- node_modules -> package.json
install:
- ps: Install-Product node $env:nodejs_version
- npm install npm@6 -g
- npm ci --silent
- node --version
- npm --version
- choco install googlechrome --limit-output --ignore-checksum
build: off
test_script:
- npm run lint
- npm test -- --progress=false
- npm run e2e</code>
</pre>
<p>We tried switching to the "Previous Visual Studio 2017" image, to no avail.</p>
<p>I tried <a href="https://twitter.com/jeroenheijmans/status/1042041106509320192">contacting webcare</a> but got no response.</p>
<p>Any advice?</p></div>jeroen.heijmanstag:help.appveyor.com,2012-11-13:Comment/461082602018-09-19T11:54:08Z2018-09-19T12:01:44ZBuilds failing on Chromedriver download (Angular 6 CLI e2e tests step)<div><p>I've reproduced said issue in an MCVE.</p>
<ul>
<li>Repository: <a href="https://github.com/jeroenhinfi/experiments-appveyor">https://github.com/jeroenhinfi/experiments-appveyor</a></li>
<li>Failing build: <a href="https://ci.appveyor.com/project/JeroenHeijmans61392/experiments-appveyor/build/1.0.2">https://ci.appveyor.com/project/JeroenHeijmans61392/experiments-app...</a></li>
</ul>
<p>This repository was nothing else but:</p>
<ol>
<li>New repo<br></li>
<li><code>ng new app --inline-style</code><br></li>
<li>Add the <code>yml</code> file (see repo)<br></li>
<li>Create AppVeyor build</li>
</ol>
<p>The build works locally. So I think the issue is with the AppVeyor VM image?</p></div>jeroen.heijmanstag:help.appveyor.com,2012-11-13:Comment/461082602018-09-20T02:38:51Z2018-09-20T02:38:51ZBuilds failing on Chromedriver download (Angular 6 CLI e2e tests step)<div><p>As a temporary work-around as we investigate can you try adding <code>appveyor-retry</code> before the problematic command.</p>
<pre>
<code> - appveyor-retry npm run e2e</code>
</pre></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/461082602018-09-20T07:52:46Z2018-09-20T07:52:46ZBuilds failing on Chromedriver download (Angular 6 CLI e2e tests step)<div><p>The temporary workaround seems to have worked (at least on my MCVE repository, mentioned above), so that'll help for now.</p>
<p>Looking forward to a more permanent solution.</p></div>jeroen.heijmanstag:help.appveyor.com,2012-11-13:Comment/461082602018-10-11T10:04:01Z2018-10-11T10:04:01ZBuilds failing on Chromedriver download (Angular 6 CLI e2e tests step)<div><p>It's been three weeks, the workaround is starting to become less "temporary" :-)</p>
<p>Any news on this issue @OwenMcDonnel and colleagues?</p></div>jeroen.heijmanstag:help.appveyor.com,2012-11-13:Comment/461082602018-10-12T07:34:55Z2018-10-12T07:34:55ZBuilds failing on Chromedriver download (Angular 6 CLI e2e tests step)<div><p>You mention putting a curl command in the <code>test_script</code> section which made it <em>seem</em> to work. What command was that?</p></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/461082602018-10-12T11:35:08Z2018-10-12T11:35:08ZBuilds failing on Chromedriver download (Angular 6 CLI e2e tests step)<div><p>The <code>curl</code> command in the logs I posted (the one just before the failure). However, I don't recall if that was a <em>reliable</em> fix or not.</p></div>jeroen.heijmanstag:help.appveyor.com,2012-11-13:Comment/461082602018-10-12T16:27:16Z2018-10-12T16:27:16ZBuilds failing on Chromedriver download (Angular 6 CLI e2e tests step)<div><p>I was able to get reliable builds by making the following changes.<br>
To <em>package.json</em> scripts,</p>
<pre>
<code> "pree2e": "webdriver-manager update --standalone false --gecko false",
"e2e": "ng e2e --no-webdriver-update"</code>
</pre>
<p>and to <em>appveyor.yml</em> at the end of <code>install:</code> stage,</p>
<pre>
<code>- mkdir C:\projects\experiments-appveyor\node_modules\protractor\node_modules\webdriver-manager\selenium
- curl -oC:\projects\experiments-appveyor\node_modules\protractor\node_modules\webdriver-manager\selenium\chrome-response.xml https://chromedriver.storage.googleapis.com/</code>
</pre></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/461082602018-10-15T08:41:39Z2018-10-15T08:41:39ZBuilds failing on Chromedriver download (Angular 6 CLI e2e tests step)<div><p>Thank you for your response Owen.</p>
<p>Those changes seem to me like another <em>workaround</em> though, not really a solution. Compared to the earlie "retry" solution, it not only tightly couples my yml file to AppVeyor (which is okay, of course), but it also introduces complexity in my package.json file specific to the build server.</p>
<p>Given the type of workaround it is, I feel even more strongly that the root cause is inside the build images? I'd prefer to see a fix there. (Or, perhaps I'm wrong, and one of my NPM packages has a bug?)</p>
<p>Of the two workarounds, I guess the 'retry' version is the lesser evil, so I'll stick with that until a proper solution is available.</p></div>jeroen.heijmanstag:help.appveyor.com,2012-11-13:Comment/461082602018-10-15T22:50:53Z2018-10-15T22:50:53ZBuilds failing on Chromedriver download (Angular 6 CLI e2e tests step)<div><p>I agree that it doesn't seem like a true solution. However, i'm not yet convinced this is a build image problem.</p>
<p>In researching the problem I came across numerous problems (and various workarounds) with respect to webdriver-manager.</p>
<p>I didn't mean to propose this as a final solution but rather an update on our findings (though alternative workarounds can be helpful as well).</p>
<p>We will continue to investigate, as we hope you will.</p></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/461082602018-10-16T07:08:09Z2018-10-16T07:08:09ZBuilds failing on Chromedriver download (Angular 6 CLI e2e tests step)<div><p>Allright, I understand. Thanks for the updates!</p>
<p>I will be honest and admit that I am using the first workaround and no longer investigating. Since I cannot reproduce this locally I don't have any convenient means (as far as I know) to further troubleshoot this.</p>
<p>Though I guess I could try and run the same thing on other CI tools (perhaps my own GitLab CI environment) to see if the issue truly is AppVeyor-specific.</p></div>jeroen.heijmanstag:help.appveyor.com,2012-11-13:Comment/461082602018-10-23T23:39:12Z2018-10-23T23:39:12ZBuilds failing on Chromedriver download (Angular 6 CLI e2e tests step)<div><p>I think this is likely some network latency issue since it looks like the <em>webdriver-manager</em> module is downloading an xml then immediately parsing it and making another request for the latest drivers.<br>
As such, it is not really revelatory to try other CI machines and compare results. But if you're interested, I've enabled building from GCE workers so if you want to try some builds on those machines just add <code>appveyor_build_worker_cloud: gce</code> to your environment variables. Be aware that GCE workers take a little longer to provision so your build may take a few minutes to begin.</p>
<p>I think short of making a pull request to said npm module, I would consider the "workaround" as a resolution.</p></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/461082602018-10-24T06:44:06Z2018-10-24T06:44:06ZBuilds failing on Chromedriver download (Angular 6 CLI e2e tests step)<div><p>Thanks for your response. I'm not entirely sure yet why the package would be the cause (since for me, this issue only occurs on AppVeyor, and I'd also think that 'network latency' issues are specific to the environment, not the used code?).</p>
<p>But I also trust that you know more about these things than I do :D - so I've <a href="https://github.com/angular/webdriver-manager/issues/329">asked the webdriver-manager community for help</a> as you suggested.</p>
<p>Thanks for your time and effort. Will wait and see if the community there can come up with another solution.</p></div>jeroen.heijmanstag:help.appveyor.com,2012-11-13:Comment/461082602018-10-24T15:53:38Z2018-10-24T15:53:38ZBuilds failing on Chromedriver download (Angular 6 CLI e2e tests step)<div><p>Package <em>could</em> be the cause <strong><em>within a certain environment</em></strong>. I.e. the package may not be resilient to network latency. Its a matter of semantics whether we assign that problem to the package or the environment.<br>
For example, you can have a build chain that produces errors when threads are scarce, but runs fine on a more powerful machine. Whether you declare the machine or the code in error depends on what you are able to remedy.</p>
<p>Most important to us is that your build is not blocked : )</p></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/461082602018-10-24T15:58:26Z2018-10-24T15:58:26ZBuilds failing on Chromedriver download (Angular 6 CLI e2e tests step)<div><p>Yes, of course, you're right.</p>
<p>In any case I appreciate all the help you've provided!</p>
<p>And with said workarounds I can carry on of course. Let's wait and see what the package maintainers/community have to offer.</p></div>jeroen.heijmans