Skip to content
Latchkey

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

  1. Upgrade to the current actions/cache (v4) that targets the v2 cache service.
  2. On self-hosted runners, ensure the runner version is recent enough to inject the cache URL.
  3. 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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →