unable to delete build cache

belegdol's Avatar

belegdol

06 Sep, 2020 04:01 PM

We have been seeing some issues with corrupted mame cache preventing startaq/mame from building:
https://github.com/mamedev/mame/issues/7194
I tested deleting the build cache on my fork (belegdol/mame) by calling:
$ export APPVEYOR_TOKEN="xxx"
$ curl -H "Authorization: Bearer $APPVEYOR_TOKEN" -H "Content-Type: application/json" -X "DELETE" https://ci.appveyor.com/api/projects/belegdol/mame/buildcache
It unfortunately appears not to do anything, the cache is still there:
https://ci.appveyor.com/project/belegdol/mame/builds/35055312/job/six5a4y456wtcfuc

  1. Support Staff 1 Posted by Feodor Fitsner on 07 Sep, 2020 12:26 AM

    Feodor Fitsner's Avatar

    You can set APPVEYOR_CACHE_SKIP_RESTORE environment variable to true to skip restoring cache.

  2. 2 Posted by belegdol on 07 Sep, 2020 04:40 PM

    belegdol's Avatar

    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.
    Is there a way to reliably invalidate the cache without committing anything to the repo?

  3. Support Staff 3 Posted by Feodor Fitsner on 07 Sep, 2020 04:59 PM

    Feodor Fitsner's Avatar

    Try adding cache dependency for easier invalidation/control of the cache:

        cache:
          - C:\msys64\var\cache\pacman\pkg -> .appveyor.yml
    

    Instead of .appveyor.yml there can be any file. Every time .appveyor.yml is changed (it could be a trivial change into comments or whitespace) the cache entry will be invalidated on restore.

  4. 4 Posted by belegdol on 07 Sep, 2020 05:03 PM

    belegdol's Avatar

    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:
    https://github.com/appveyor/ci/issues/985

  5. Support Staff 5 Posted by Feodor Fitsner on 07 Sep, 2020 07:38 PM

    Feodor Fitsner's Avatar

    What response do you get from AppVeyor when you call DELETE https://ci.appveyor.com/api/projects/belegdol/mame/buildcache API endpoint?

    Could you please try doing that again and tell me the time it was called - we'll check the logs.

  6. 6 Posted by belegdol on 07 Sep, 2020 08:44 PM

    belegdol's Avatar

    $ curl -i -H "Authorization: Bearer $APPVEYOR_TOKEN" -H "Content-Type: application/json" -X "DELETE" https://ci.appveyor.com/api/projects/belegdol/mame/buildcache
    HTTP/2 204
    cache-control: no-cache
    pragma: no-cache
    expires: -1
    x-xss-protection: 1; mode=block
    x-frame-options: SAMEORIGIN
    strict-transport-security: max-age=31536000
    x-content-type-options: nosniff
    date: Mon, 07 Sep 2020 20:42:51 GMT

    The call was made at the time shown, around 22:43 CEST.

  7. Support Staff 7 Posted by Feodor Fitsner on 07 Sep, 2020 09:11 PM

    Feodor Fitsner's Avatar

    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.

    Build cache is currently unavailable, sorry about that. Engineers in our data center is working on that: https://status.appveyor.com/incidents/9msyb5z4qm4m

  8. 8 Posted by belegdol on 08 Sep, 2020 07:14 AM

    belegdol's Avatar

    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.

    $ curl -i -H "Authorization: Bearer $APPVEYOR_TOKEN" -H "Content-Type: application/json" -X "DELETE" https://ci.appveyor.com/api/projects/belegdol/mame/buildcache
    HTTP/2 204
    cache-control: no-cache
    pragma: no-cache
    expires: -1
    x-xss-protection: 1; mode=block
    x-frame-options: SAMEORIGIN
    strict-transport-security: max-age=31536000
    x-content-type-options: nosniff
    date: Tue, 08 Sep 2020 06:59:11 GMT

  9. Support Staff 9 Posted by Feodor Fitsner on 09 Sep, 2020 12:55 AM

    Feodor Fitsner's Avatar

    It should be working now. Please try again.

  10. 10 Posted by belegdol on 09 Sep, 2020 06:41 AM

    belegdol's Avatar

    It is working for me indeed, thanks for fixing!

    $ curl -i -H "Authorization: Bearer $APPVEYOR_TOKEN" -H "Content-Type: application/json" -X "DELETE" https://ci.appveyor.com/api/projects/belegdol/mame/buildcache
    HTTP/2 204
    cache-control: no-cache
    pragma: no-cache
    expires: -1
    x-xss-protection: 1; mode=block
    x-frame-options: SAMEORIGIN
    strict-transport-security: max-age=31536000
    x-content-type-options: nosniff
    date: Wed, 09 Sep 2020 06:38:48 GMT

    https://ci.appveyor.com/project/belegdol/mame/build/job/fvt5u7axejyg94p5

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

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