Skip to content

Debugging common CI failures

Kendal Harland edited this page Jul 1, 2024 · 5 revisions

Error: sccache 'Error removing file from cache'

The GitHub action at hendrikmuhs/ccache-action includes a post-step that creates a GitHub cache using our supplied key pattern: ${{ matrix.os }}-${{ matrix.arch }}-<suffix>. Sometimes the cache can become corrupted [1] which generates an error message like this:

sccache: encountered fatal error
sccache: error: thread 'tokio-runtime-worker' panicked at src\lru_disk_cache\mod.rs:204:17: Error removing file from cache: `"C:\\a\\swift-build\\swift-build/.sccache\\preprocessor\\8\\f\\2\\8f2e7d1b9af7ff2cc23c6829fc3cae3044c631d88bf597901be5e04795779aad"`: failed to remove file `C:\a\swift-build\swift-build/.sccache\preprocessor\8\f\2\8f2e7d1b9af7ff2cc23c6829fc3cae3044c631d88bf597901be5e04795779aad`
sccache: caused by: thread 'tokio-runtime-worker' panicked at src\lru_disk_cache\mod.rs:204:17: Error removing file from cache: `"C:\\a\\swift-build\\swift-build/.sccache\\preprocessor\\8\\f\\2\\8f2e7d1b9af7ff2cc23c6829fc3cae3044c631d88bf597901be5e04795779aad"`: failed to remove file `C:\a\swift-build\swift-build/.sccache\preprocessor\8\f\2\8f2e7d1b9af7ff2cc23c6829fc3cae3044c631d88bf597901be5e04795779aad`

To fix this, delete the corrupted caches from GitHub. This can be done from the [caches page})(https://github.com/thebrowsercompany/swift-build/actions/caches) or the command line using gh. Here's an example of deleting caches related to Android ICU build steps in Powershell:

gh cache list -k sccache-Android- --limit 100 --json key --jq '.[] | .key' | `
    Select-String -Pattern "-icu" | `
    %{ gh cache delete $_ }

Clone this wiki locally