Cache: Warning: Cache service responded with 403

Created on 4 Dec 2020  路  11Comments  路  Source: actions/cache

Hello Team,

Im getting "Warning: Cache service responded with 403". Its not caching the filepath as well.

Run actions/cache@v2
with:
path: /tmp/M2

key: Linux-webapp-build-m2-folder-cache-2785bfb041454a6cf71a9ef1f470ad37c54f89ac472600a3c22d2258ff1ea188
restore-keys: Linux-webapp-build-m2-folder-cache-
Linux-webapp-build-

Most helpful comment

Hi,
We have the same problem when a pull request is closed, for example:

image

image

This warning only happens in events of type closed PR

Note that in my case, this warning appears in github hosted, for example: ubuntu-latest.

All 11 comments

have the same issue

Hi,
We have the same problem when a pull request is closed, for example:

image

image

This warning only happens in events of type closed PR

Note that in my case, this warning appears in github hosted, for example: ubuntu-latest.

I see the same problem using actions/cache@v1:
Warning: downloadCache failed: tunneling socket could not be established, statusCode=403

The self-hosted runner is running inside a lxd container and the proxy is properly set. I already checked the proxy settings and the log are showing neither denials nor 403

We're seeing this on closed pull_request as well.

We are seeing the same exact issue

same issue for us

You can easily reproduce the error with the following workflow file:

name: test-cache-403
on:
  pull_request:
    types: [closed]
    branches: [main, master]



jobs:
  test-cache:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - name: Output env
        run: env
      - name: Store cache
        uses: actions/cache@v2
        continue-on-error: true
        with:
          path: ~/.test/
          key: ${{ runner.os }}-test-
          restore-keys: |
            ${{ runner.os }}-test-

You need to create a PR and merge it to trigger the failure, the changed file does not matter.

Possible explanation

My understanding is that we are using the variable GITHUB_REF (which upon merging is "MASTER" or "MAIN", e.g: the branch where your changes are being merged to).
The problem appears to be that the workflow is associated with the source branch:
image

And the cache consistently returns a 403:

image

What I understand is that:

  • The cache action is trying to save the cache associated to the branch "master" (in my example).
  • The cache run is associated with the origin branch, in my example: MarcosCela-patch-3
  • The cache service returns a 403 because we are trying to save something to the master branch but we are running in the context of a different branch.

I might be completely wrong here tho, can anyone confirm?

We're having the same issue with closed type pull_request as well. We recently refactored to use this configuration without any other major changes.

UPDATE

We just tried with the most recent version (2.1.4) and are still seeing this behavior.

We also have this issue through bahmutov/npm-install@v1, in our case it's erroring our action on the 403 error. Also on pull_request closed event.

We have the exact same behavior here. It's simply impossible to use this action in a closed PR event.

Same here.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sergeyzwezdin picture sergeyzwezdin  路  5Comments

Fatme picture Fatme  路  3Comments

thisismydesign picture thisismydesign  路  4Comments

Cerberus picture Cerberus  路  5Comments

KhaledSakr picture KhaledSakr  路  3Comments