GitHub Actions actions/cache "Cache Service Url not found"
actions/cache talks to a cache service whose URL is injected into the job environment by GitHub. When that variable is missing - on some self-hosted setups or with an action version mismatched to the backend - the cache step cannot find the service.
What this error means
A cache save or restore step fails saying the Cache Service Url was not found, sometimes after a backend version change (v1 vs v2 cache service).
github-actions
Error: Cache Service Url not found, unable to restore cache.Common causes
Cache service env var not injected
Self-hosted or proxied runners may not receive ACTIONS_CACHE_URL / ACTIONS_RESULTS_URL, so the action has no endpoint.
Action version mismatched to the cache backend
An old actions/cache version against the newer cache service (or vice versa) cannot resolve the URL.
How to fix it
Update the action and verify the runner environment
- Upgrade to the current actions/cache (v4) that targets the v2 cache service.
- On self-hosted runners, ensure the runner version is recent enough to inject the cache URL.
- Confirm any proxy preserves the cache service environment variables.
.github/workflows/ci.yml
- uses: actions/cache@v4
with:
path: ~/.npm
key: npm-${{ hashFiles('**/package-lock.json') }}How to prevent it
- Keep actions/cache and the runner agent up to date together.
- On Latchkey managed runners the cache service URL is always present and transient cache-service hiccups are auto-retried, so cache steps do not fail the build over an infra blip.
Related guides
GitHub Actions actions/cache "tar exited with 2" on restoreFix actions/cache restore "tar exited with error code 2" - extraction of a cached archive failed, often a cor…
GitHub Actions setup-node cache "path glob not matched"Fix actions/setup-node cache failures - with cache: npm/yarn/pnpm enabled, no lockfile matched the expected p…
actions/cache: Save & Restore Build CachesReference for actions/cache: cache dependencies and build outputs across runs using key and restore-keys, wit…