Skip to content

If a workflow is canceled during cache/restore then cache/save writes a corrupt cache (Windows) #1729

@andreasabel

Description

@andreasabel

See https://github.com/agda/agda/actions/runs/22600812056/job/65482024259.
This workflow was canceled during cache/restore, but nevertheless saved the cache in cache/save which is executed always().

Run actions/cache/restore@v5
Cache hit for: cabal.yml-Windows-ghc-9.12.2-cabal-3.16.1.0-a135ab72b208a1f99c97091571421a28209922afd2be2544fe48f46c7d47d74a
Received 38715069 of 38715069 (100.0%), 58.9 MBs/sec
Cache Size: ~37 MB (38715069 B)
"C:\Program Files\Git\usr\bin\tar.exe" -xf D:/a/_temp/35412300-b751-41b2-b55b-d29751c76acc/cache.tzst -P -C D:/a/agda/agda --force-local --use-compress-program "zstd -d"
Error: The operation was canceled.
....
Run actions/cache/save@v5
"C:\Program Files\Git\usr\bin\tar.exe" --posix -cf cache.tzst --exclude cache.tzst -P -C D:/a/agda/agda --files-from manifest.txt --force-local --use-compress-program "zstd -T0"
Sent 34931855 of 34931855 (100.0%), 34.2 MBs/sec
Cache saved with key: cabal.yml-Windows-ghc-9.12.2-cabal-3.16.1.0-a135ab72b208a1f99c97091571421a28209922afd2be2544fe48f46c7d47d74a
Image

Subsequent workflow runs failed due to this corrupt cache:
https://github.com/agda/agda/actions/runs/22600933645/job/65482411063#step:10:24

Run actions/cache/restore@v5
Cache hit for: cabal.yml-Windows-ghc-9.12.2-cabal-3.16.1.0-a135ab72b208a1f99c97091571421a28209922afd2be2544fe48f46c7d47d74a
Received 34931855 of 34931855 (100.0%), 106.8 MBs/sec
Cache Size: ~33 MB (34931855 B)
"C:\Program Files\Git\usr\bin\tar.exe" -xf D:/a/_temp/2c1845a5-74e9-4ad3-a959-dc6dc4fcc884/cache.tzst -P -C D:/a/agda/agda --force-local --use-compress-program "zstd -d"
Cache restored successfully
Cache restored from key: cabal.yml-Windows-ghc-9.12.2-cabal-3.16.1.0-a135ab72b208a1f99c97091571421a28209922afd2be2544fe48f46c7d47d74a

Run # shellcheck disable=SC2086
Build profile: -w ghc-9.12.2 -O0
In order, the following will be built (use -v for more details):
 - text-short-0.1.6.1 (lib) (requires download & build)
 - th-abstraction-0.7.2.0 (lib) (requires download & build)
 - th-compat-0.1.7 (lib) (requires download & build)
 - these-1.2.1 (lib) (requires download & build)
 - time-compat-1.9.9 (lib) (requires download & build)
 - transformers-compat-0.7.2 (lib) (requires download & build)
 - unix-compat-0.7.4.1 (lib) (requires download & build)
 - unordered-containers-0.2.21 (lib) (requires download & build)
 - utf8-string-1.0.2 (lib) (requires download & build)
 - uuid-types-1.0.6 (lib) (requires download & build)
 - vector-stream-0.1.0.1 (lib) (requires download & build)
 - zstd-0.1.3.0 (lib) (requires download & build)
internal error in InstallPlan.completed: not in configured state: Installed generic-deriv_-1.14.7-684fb3507ca8094b57c32c2ff59a2a2da94f22ce
CallStack (from HasCallStack):
  error, called at src\Distribution\Client\InstallPlan.hs:284:3 in cabal-install-3.16.1.0-inplace:Distribution.Client.InstallPlan
  internalError, called at src\Distribution\Client\InstallPlan.hs:748:26 in cabal-install-3.16.1.0-inplace:Distribution.Client.InstallPlan
Error: Process completed with exit code 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions