tag:help.appveyor.com,2012-11-13:/discussions/problems/7295-build-cache-not-always-retrievedAppVeyor: Discussion 2018-10-19T08:18:27Ztag:help.appveyor.com,2012-11-13:Comment/431732422017-08-09T13:45:59Z2017-08-09T13:45:59ZBuild cache not always retrieved <div><p>Hey, @madmax! I've been having pretty much the same problem yesterday and today, only that no matter how many times I build/rebuild, cache is never restored. For reference, all our builds were fine last week. I'll keep watching this to see if you figure it out, but wanted to give you my +1 for this issue!</p></div>richard.dubaytag:help.appveyor.com,2012-11-13:Comment/431732422017-08-09T15:52:18Z2017-08-09T15:52:19ZBuild cache not always retrieved <div><p>And just like that, the build caches started working again. ¯_(ツ)_/¯</p></div>richard.dubaytag:help.appveyor.com,2012-11-13:Comment/431732422017-08-09T20:07:03Z2017-08-09T20:07:03ZBuild cache not always retrieved <div><p>We are expanding to new datacenter, which has its own cache storage. If your build happens to be executed in that datacenter, first time it is nothing to restore, but after successful build cache is saved in hew datacenter for you as well. If you do not want to depend on the build success to save cache, you can set <code>APPVEYOR_SAVE_CACHE_ON_ERROR</code> environment variable to <code>true</code>.</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/431732422017-08-13T13:08:10Z2017-08-13T13:08:10ZBuild cache not always retrieved <div><p>This issue is really bad for this project <a href="https://ci.appveyor.com/project/MaNGOS/server-80qcn/">https://ci.appveyor.com/project/MaNGOS/server-80qcn/</a></p>
<p>I've restarted about 30times just now and not getting a cache and RDP is not always working. (fails to connect).</p></div>madmaxtag:help.appveyor.com,2012-11-13:Comment/431732422017-08-13T13:18:13Z2017-08-13T13:18:13ZBuild cache not always retrieved <div><p>This is completely broken for us, i have sat here for 25minutes attempting to rebuild pull request on this project <a href="https://ci.appveyor.com/project/MaNGOS/server-80qcn">https://ci.appveyor.com/project/MaNGOS/server-80qcn</a><br>
will need a member of staff to take a look for us.<br>
I cannot even get into remote desktop, anything on the 67.x.x.x IP range just times out.</p></div>madmaxtag:help.appveyor.com,2012-11-13:Comment/431732422017-08-13T13:35:21Z2017-08-13T13:35:21ZBuild cache not always retrieved <div><p>It looks like after around 40 attempts the build cache was able to restore. Remote desktop is still very flakey.<br>
The time i did get in the o/s asked me if i wanted to discover computers on the local network?!</p>
<p>I wonder if the servers in the new datacenter are opening the right ports for remote desktop?</p></div>madmaxtag:help.appveyor.com,2012-11-13:Comment/431732422017-08-15T01:40:39Z2017-08-15T01:40:39ZBuild cache not always retrieved <div><p>This is definitely not right, we fixed cache issue. We identified issue with RDP, should be fiuxed soon. For than nasty "Networks" dialog we have <a href="https://github.com/appveyor/ci/issues/1715">this</a> issue. However it should not affect you, if you are not using UI testing scenarios. Sorry for the trouble.</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/431732422017-08-15T11:58:08Z2017-08-15T11:58:08ZBuild cache not always retrieved <div><p>Hi,</p>
<p>This morning it took me 6 attempts to get the build cache to restore! Did you say this is already fixed or a fix is coming?</p>
<p>You can see each of the builds, i manually use the rebuild pull request option and cancel when i see no cache restored, repeat until it does.</p>
<p><a href="https://ci.appveyor.com/project/MaNGOS/server-80qcn/build/0.21.205">https://ci.appveyor.com/project/MaNGOS/server-80qcn/build/0.21.205</a><br>
<a href="https://ci.appveyor.com/project/MaNGOS/server-80qcn/build/0.21.206">https://ci.appveyor.com/project/MaNGOS/server-80qcn/build/0.21.206</a><br>
<a href="https://ci.appveyor.com/project/MaNGOS/server-80qcn/build/0.21.207">https://ci.appveyor.com/project/MaNGOS/server-80qcn/build/0.21.207</a><br>
<a href="https://ci.appveyor.com/project/MaNGOS/server-80qcn/build/0.21.208">https://ci.appveyor.com/project/MaNGOS/server-80qcn/build/0.21.208</a><br>
<a href="https://ci.appveyor.com/project/MaNGOS/server-80qcn/build/0.21.209">https://ci.appveyor.com/project/MaNGOS/server-80qcn/build/0.21.209</a><br>
This one worked?! <a href="https://ci.appveyor.com/project/MaNGOS/server-80qcn/build/0.21.210">https://ci.appveyor.com/project/MaNGOS/server-80qcn/build/0.21.210</a></p></div>madmaxtag:help.appveyor.com,2012-11-13:Comment/431732422017-08-16T01:56:53Z2017-08-16T01:56:53ZBuild cache not always retrieved <div><p><strong>@madmax</strong> problem is that cache saving is disabled on Pull Request (to prevent outsiders from spoiling the cache). If non-pr build happens to run in new environment, then cache is saved. I filed <a href="https://github.com/appveyor/ci/issues/1730">this</a> GitHub issue and will try to fix it soon.</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/431732422017-08-16T07:07:38Z2017-08-16T07:07:38ZBuild cache not always retrieved <div><p>So it sounds like the cache should restore on pull requests and instead add an option to ignore updating/saving the cache on pull requests? That way a PR could do what it likes to the cache files but they would be safe.</p></div>madmaxtag:help.appveyor.com,2012-11-13:Comment/431732422017-08-17T00:25:58Z2017-08-17T00:25:58ZBuild cache not always retrieved <div><p>Cache is being restored in pull request. But as long as build happens in new datacenter it is nothing to restore. After we add saving cache on pull requests (soon), after single PR build save cache in new datacenter, subsequent ones have what to restore.</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/431732422018-01-10T22:57:32Z2018-01-10T22:57:32ZBuild cache not always retrieved <div><p>Hey, We are still getting issues with this, you can see from our build history that only some of the time the cache gets restored, this is even with just normal commits. Example: <a href="https://ci.appveyor.com/project/MaNGOS/server-wtbhv">https://ci.appveyor.com/project/MaNGOS/server-wtbhv</a></p></div>madmaxtag:help.appveyor.com,2012-11-13:Comment/431732422018-01-12T03:21:21Z2018-01-12T03:21:21ZBuild cache not always retrieved <div><p><strong>@madmax</strong> seems that your project cache is corrupted in one of our datacenters. You need to delete the cache using <a href="https://www.appveyor.com/docs/build-cache/#rest-api">this</a> API (<a href="https://gist.github.com/IlyaFinkelshteyn/fca312491c2363625095cbc7c5f80ab9">samples</a>). Unfortunately it will delete cache in the both datacenters so it will take a several builds to repopulate it everywhere. Sorry for the trouble.</p>
<p>By the way we implemented option to save cache in PR builds, you can set it in UI, General settings (<code>Save build cache in Pull Requests</code>).</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/431732422018-01-12T21:02:15Z2018-01-12T21:02:15ZBuild cache not always retrieved <div><p>Hey, I tried this on our main project - <a href="https://ci.appveyor.com/project/MaNGOS/server-9fytl">https://ci.appveyor.com/project/MaNGOS/server-9fytl</a><br>
Just before I ran build 0.21.989 I used a powershell script to wipe the cache. Then during this build i used remote desktop to set the mysql files we want and let it continue which you can see it saved the cache files at the end.<br>
You can see on each build history if the cache restores or not. We had several failures followed by 5 or so sucessful restores of the cache, then the cache was not restored, in fact it does not even mention cache restoring in build 0.21.998.</p>
<p>Can you look into this some more for us and see what the issue is?</p>
<p>Thanks :)</p></div>madmaxtag:help.appveyor.com,2012-11-13:Comment/431732422018-01-13T02:48:24Z2018-01-13T02:48:24ZBuild cache not always retrieved <div><p>Build <code>0.21.989</code> happened in one datacenter, so cache saved in that datacenter cache server, but build <code>0.21.998</code> happened in another datacenter where in never saved.</p>
<p>Generally it is not supposed to work this way. Cache (like generally any other cache in other systems) provides high speed access to some data, but it never the only way to get that data. If cache is broken it should always be some way to re-populate it.</p>
<p>In your case populating cache manually over RDP is very fragile and unsupported scenario. We cannot guarantee that cache will be always available. We can replace cache server, or open new datacenter location with empty cache server. You need to write a script which checks cached folders and if they are empty or contains stale data, download that data from some location again. There are a lot of ways to <a href="https://www.appveyor.com/docs/how-to/download-file/">download files</a> on AppVeyor.</p>
<p>Usually cache folders used by package managers (nuget, npm, etc.) and those package managers implement logic described above. But in this case you need to implement that logic yourself.</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/431732422018-01-13T16:08:25Z2018-01-13T16:08:25ZBuild cache not always retrieved <div><p>Hey, So I think I figured what I need to do in powershell... Hoping my developers can figure out how to script this (I'm not a dev).</p>
<p>OK so heres what we need to do using powershell...</p>
<p>Use Test-Path "C:\Program Files (x86)\MySql\MySQL Server 5.7" -pathType container<br>
If this folder does not exist, we need to:<br>
Invoke-WebRequest "<a href="http://assets.getmangos.eu/mysql-5.7.20-win32.zip">http://assets.getmangos.eu/mysql-5.7.20-win32.zip</a>" -OutFile c:\mysql.zip</p>
<p>Then run:<br>
7z -bso0 -bsp0 e -y c:\mysql.zip lib -o"C:\Program Files (x86)\MySql\MySQL Server 5.7\lib"<br>
7z -bso0 -bsp0 e -y c:\mysql.zip include -o"C:\Program Files (x86)\MySql\MySQL Server 5.7\include"</p>
<p>But those only need to happen if the first comes back false (i.e the test path is false).</p>
<p>This way we will not be reliant on the cache if it does not restore :)</p></div>madmaxtag:help.appveyor.com,2012-11-13:Comment/431732422018-01-13T18:57:47Z2018-01-13T18:57:47ZBuild cache not always retrieved <div><p>We got this scripted now, if the cache does not restore we will download from our server and extract. :)</p></div>madmax