actions / actions/cache

Failed to Restore Cache with zstd: Unsupported Format for a Saved Cache

Open
#1,555 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
5.6k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

Environment:

  • CI/CD System: Gitea Actions using a custom runner on Docker via Portainer
  • Code Repository: Hosted on Gitea v1.23.3 running on an Ubuntu machine (Proxmox VM)
  • External Cache Server: FalconDev OSS GitHub Actions Cache Server
  • Project Context: Cache issues in the CI/CD pipeline for the project

Issue Description:
I am encountering repeated failures during the cache restoration step in my Gitea Actions workflow. Despite successful cache storage (as indicated by the CI logs), attempts to restore the cache result in errors related to "unsupported format".

Error Logs:
Here are snippets from the CI/CD logs that show both the successful cache save and the failed restore attempts:

Cache Save Log:

[command]/usr/bin/tar --posix -cf cache.tzst --exclude cache.tzst -P -C /workspace/vedus/mlaw-backend --files-from manifest.txt --use-compress-program zstdmt
Cache Size: ~32 MB (33435083 B)
Cache saved successfully
Cache saved with key: linux-bun-cache
✅ Success - Post Restore cache

Cache Restore Log:

Cache Size: ~0 MB (231 B)
[command]/usr/bin/tar -xf /tmp/fe9e3ad9-458c-43d2-9f4b-d24750b2c798/cache.tzst -P -C /workspace/vedus/mlaw-backend --use-compress-program unzstd
zstd: /*stdin*\: unsupported format
/usr/bin/tar: Child returned status 1
/usr/bin/tar: Error is not recoverable: exiting now
::warning::Failed to restore: "/usr/bin/tar" failed with error: The process '/usr/bin/tar' failed with exit code 2
Cache not found for input keys: linux-bun-cache

Workflow Configuration for Cache:

- name: Restore cache
  id: cache-bun
  uses: actions/cache@v4
  with:
    path: |
      ~/.bun/install/cache
      ./node_modules
    key: linux-bun-cache

Steps to Reproduce:

  1. Trigger the GitHub Actions workflow.
  2. Observe the caching step fails during the execution of the restore cache action.

Expected Behavior:
Cache should be restored without any format or decompression errors, utilizing the earlier saved cache to fast-track the build and test processes.

Actual Behavior:
Cache restoration fails owing to an "unsupported format" error from zstd and consequential failures from tar, blocking the utilization of the cached data.

Troubleshooting Done:

  • Checked and confirmed zstd is operational and consistent across environments.
  • Manual decompression tests of cache file mimicking the CI environment.

Request for Assistance:
Could anyone provide insights or suggestions on resolving these decompression issues? It's unclear if this problem stems from how the data is being compressed/stored by our third-party cache server or if it might be a configuration mishap on our end involving zstd and tar.


Attachments:

  • CI/CD complete logs for the cache storage and restoration process.

deploy-test-14.log

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the attached deploy-test-14.log and the actions/cache@v4 workflow step, comparing the saved archive with the restored cache response from FalconDev OSS GitHub Actions Cache Server. Verify whether the returned archive matches the zstd format expected by tar and unzstd in the Gitea Actions environment; done means the cache restores successfully without the unsupported-format error.

Written by the indexing model from the issue text.

Assessment

Tech stack
bun, docker, github-actions, typescript, yaml
Domain
ci-cd, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.