tag:help.appveyor.com,2012-11-13:/discussions/problems/28134-unable-to-delete-build-cacheAppVeyor: Discussion 2020-09-09T06:41:33Ztag:help.appveyor.com,2012-11-13:Comment/486075712020-09-06T16:01:05Z2020-09-06T16:01:05Zunable to delete build cache<div><p>We have been seeing some issues with corrupted mame cache preventing startaq/mame from building:<br>
<a href="https://github.com/mamedev/mame/issues/7194">https://github.com/mamedev/mame/issues/7194</a><br>
I tested deleting the build cache on my fork (belegdol/mame) by calling:<br>
$ export APPVEYOR_TOKEN="xxx" $ curl -H "Authorization: Bearer $APPVEYOR_TOKEN" -H "Content-Type: application/json" -X "DELETE" <a href="https://ci.appveyor.com/api/projects/belegdol/mame/buildcache">https://ci.appveyor.com/api/projects/belegdol/mame/buildcache</a> It unfortunately appears not to do anything, the cache is still there:<br>
<a href="https://ci.appveyor.com/project/belegdol/mame/builds/35055312/job/six5a4y456wtcfuc">https://ci.appveyor.com/project/belegdol/mame/builds/35055312/job/s...</a></p></div>belegdoltag:help.appveyor.com,2012-11-13:Comment/486075712020-09-07T00:26:28Z2020-09-07T00:26:28Zunable to delete build cache<div><p>You can set <code>APPVEYOR_CACHE_SKIP_RESTORE</code> environment variable to <code>true</code> to skip restoring cache.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/486075712020-09-07T16:40:08Z2020-09-07T16:40:09Zunable to delete build cache<div><p>The problem with this approach is that it only works for one build. In a repository with frequent commits, the build with cache restore gets skipped and superseded with a build which tries to restore cache.<br>
Is there a way to reliably invalidate the cache without committing anything to the repo?</p></div>belegdoltag:help.appveyor.com,2012-11-13:Comment/486075712020-09-07T16:59:55Z2020-09-07T16:59:55Zunable to delete build cache<div><p>Try adding cache dependency for easier invalidation/control of the cache:</p>
<pre>
<code> cache:
- C:\msys64\var\cache\pacman\pkg -> .appveyor.yml</code>
</pre>
<p>Instead of <code>.appveyor.yml</code> there can be any file. Every time <code>.appveyor.yml</code> is changed (it could be a trivial change into comments or whitespace) the cache entry will be invalidated on restore.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/486075712020-09-07T17:03:21Z2020-09-07T17:03:22Zunable to delete build cache<div><p>It would still pollute the commit history to some extent. Is it a known problem that the API call to delete the cache does not delete it? It seems to have been working at some point at least:<br>
<a href="https://github.com/appveyor/ci/issues/985">https://github.com/appveyor/ci/issues/985</a></p></div>belegdoltag:help.appveyor.com,2012-11-13:Comment/486075712020-09-07T19:38:50Z2020-09-07T19:38:50Zunable to delete build cache<div><p>What response do you get from AppVeyor when you call <code>DELETE https://ci.appveyor.com/api/projects/belegdol/mame/buildcache</code> API endpoint?</p>
<p>Could you please try doing that again and tell me the time it was called - we'll check the logs.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/486075712020-09-07T20:44:49Z2020-09-07T20:44:50Zunable to delete build cache<div><p>$ curl -i -H "Authorization: Bearer $APPVEYOR_TOKEN" -H "Content-Type: application/json" -X "DELETE" <a href="https://ci.appveyor.com/api/projects/belegdol/mame/buildcache">https://ci.appveyor.com/api/projects/belegdol/mame/buildcache</a> HTTP/2 204<br>
cache-control: no-cache<br>
pragma: no-cache<br>
expires: -1<br>
x-xss-protection: 1; mode=block<br>
x-frame-options: SAMEORIGIN<br>
strict-transport-security: max-age=31536000<br>
x-content-type-options: nosniff<br>
date: Mon, 07 Sep 2020 20:42:51 GMT</p>
<p>The call was made at the time shown, around 22:43 CEST.</p></div>belegdoltag:help.appveyor.com,2012-11-13:Comment/486075712020-09-07T21:11:43Z2020-09-07T21:11:43Zunable to delete build cache<div><p>Looks like there is a bug in cache cleanup routine. We've fixed it and going to deploy update later today and you'll try cleaning the cache again.</p>
<p>Build cache is currently unavailable, sorry about that. Engineers in our data center is working on that: <a href="https://status.appveyor.com/incidents/9msyb5z4qm4m">https://status.appveyor.com/incidents/9msyb5z4qm4m</a></p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/486075712020-09-08T07:14:48Z2020-09-08T07:14:49Zunable to delete build cache<div><p>Thanks! I don't know which timezone you are in and thus what later today means. I just tried deleting cache again and it did not work. I will try again in the evening.</p>
<p>$ curl -i -H "Authorization: Bearer $APPVEYOR_TOKEN" -H "Content-Type: application/json" -X "DELETE" <a href="https://ci.appveyor.com/api/projects/belegdol/mame/buildcache">https://ci.appveyor.com/api/projects/belegdol/mame/buildcache</a> HTTP/2 204<br>
cache-control: no-cache<br>
pragma: no-cache<br>
expires: -1<br>
x-xss-protection: 1; mode=block<br>
x-frame-options: SAMEORIGIN<br>
strict-transport-security: max-age=31536000<br>
x-content-type-options: nosniff<br>
date: Tue, 08 Sep 2020 06:59:11 GMT</p></div>belegdoltag:help.appveyor.com,2012-11-13:Comment/486075712020-09-09T00:55:05Z2020-09-09T00:55:05Zunable to delete build cache<div><p>It should be working now. Please try again.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/486075712020-09-09T06:41:31Z2020-09-09T06:41:33Zunable to delete build cache<div><p>It is working for me indeed, thanks for fixing!</p>
<p>$ curl -i -H "Authorization: Bearer $APPVEYOR_TOKEN" -H "Content-Type: application/json" -X "DELETE" <a href="https://ci.appveyor.com/api/projects/belegdol/mame/buildcache">https://ci.appveyor.com/api/projects/belegdol/mame/buildcache</a> HTTP/2 204<br>
cache-control: no-cache<br>
pragma: no-cache<br>
expires: -1<br>
x-xss-protection: 1; mode=block<br>
x-frame-options: SAMEORIGIN<br>
strict-transport-security: max-age=31536000<br>
x-content-type-options: nosniff<br>
date: Wed, 09 Sep 2020 06:38:48 GMT</p>
<p><a href="https://ci.appveyor.com/project/belegdol/mame/build/job/fvt5u7axejyg94p5">https://ci.appveyor.com/project/belegdol/mame/build/job/fvt5u7axejy...</a></p></div>belegdol