Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: getCacheEntry failed: Cache service responded with 503 #80

Open
gr2m opened this issue Jan 21, 2021 · 54 comments
Open

Error: getCacheEntry failed: Cache service responded with 503 #80

gr2m opened this issue Jan 21, 2021 · 54 comments

Comments

@gr2m
Copy link

gr2m commented Jan 21, 2021

I have seen this error pop up several times in the past few days

image

The error seems to originate from this code, which does not seem to be part of this repository

function retry(name, method, getStatusCode, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay, onError = undefined) {
    return __awaiter(this, void 0, void 0, function* () {
        let errorMessage = '';
        let attempt = 1;
        while (attempt <= maxAttempts) {
            let response = undefined;
            let statusCode = undefined;
            let isRetryable = false;
            try {
                response = yield method();
            }
            catch (error) {
                if (onError) {
                    response = onError(error);
                }
                isRetryable = true;
                errorMessage = error.message;
            }
            if (response) {
                statusCode = getStatusCode(response);
                if (!isServerErrorStatusCode(statusCode)) {
                    return response;
                }
            }
            if (statusCode) {
                isRetryable = isRetryableStatusCode(statusCode);
                errorMessage = `Cache service responded with ${statusCode}`;
            }
            core.debug(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`);
            if (!isRetryable) {
                core.debug(`${name} - Error is not retryable`);
                break;
            }
            yield sleep(delay);
            attempt++;
        }
        throw Error(`${name} failed: ${errorMessage}`);
    });
}

I've set ACTIONS_STEP_DEBUG to true for future runs and will let you know if that yields any helpful information.

The source code above suggests that maxAttempts might be configurable? Is there an option I can set to retry requests in case of a 503?

@bitttttten
Copy link

bitttttten commented Feb 8, 2021

I'm getting a similar error but with 403:

Run bahmutov/npm-install@v1
running npm-install GitHub Action
trying to restore cached NPM modules
Error: Cache service responded with 403
    at Object.<anonymous> (/home/runner/work/_actions/bahmutov/npm-install/v1/dist/index.js:3503:19)
    at Generator.next (<anonymous>)
    at fulfilled (/home/runner/work/_actions/bahmutov/npm-install/v1/dist/index.js:3427:58)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
Error: Cache service responded with 403

@jgoux
Copy link

jgoux commented Mar 10, 2021

I have the same error as @bitttttten when trying to run my action on a pull_request closed event

@aryella-lacerda
Copy link

I'm getting the 403 error on pull_request closed too 👍🏼

Run bahmutov/npm-install@v1
running npm-install GitHub Action
trying to restore cached NPM modules
Error: Cache service responded with 403
    at Object.<anonymous> (/home/runner/work/_actions/bahmutov/npm-install/v1/dist/index.js:3503:19)
    at Generator.next (<anonymous>)
    at fulfilled (/home/runner/work/_actions/bahmutov/npm-install/v1/dist/index.js:3427:58)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
Error: Cache service responded with 403

If it makes any difference, I'm checking out the HEAD branch of the pull_request:

      - name: Checkout repository
        uses: actions/checkout@v2
        with:
          fetch-depth: 0
          ref: ${{ github.head_ref }}

@hhimanshu
Copy link

I am hitting the same issue today on one of the jobs, but not deployment_status

@pjakubczyk
Copy link

I'm doing transition to Github Actions and this error

Run bahmutov/npm-install@v1
running npm-install GitHub Action
trying to restore cached NPM modules
Error: Cache service responded with 429
    at Object.<anonymous> (/home/runner/work/_actions/bahmutov/npm-install/v1/dist/index.js:3503:19)
    at Generator.next (<anonymous>)
    at fulfilled (/home/runner/work/_actions/bahmutov/npm-install/v1/dist/index.js:3427:58)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
Error: Cache service responded with 429

shows up more than often. I feel that in case of reading the cache it should fallback with installing the dependency, not fail the build, right?

@anshulsahni
Copy link

anshulsahni commented Nov 17, 2021

I'm getting this error when the event is deployment, is this is because in some events because of the absence of some parameter retrieving cache is not possible? 🤔

@nickofthyme
Copy link

@anshulsahni I'm hitting the same thing as you in a deployment workflow. I think you are correct, it's not meant for that flow and likely something is missing. I'd say it's best to just run the install manually until then.

@fransf-wtax
Copy link

Just got this error now: Error: getCacheEntry failed: Cache service responded with 503 from the setup-java@v2 action. Failed again when I retried. 503 suggests this is a problem with GitHub Actions, not with my workflow.

@nbonavia
Copy link

Can there be a failover so that if the Cache fails to be retrieved, the standard npm install command gets executed instead. This will be able to still run the job if github actions have issues with caches.

@afrokick
Copy link

afrokick commented Jun 13, 2022

Just got this error now: Error: getCacheEntry failed: Cache service responded with 503 from the setup-java@v2 action. Failed again when I retried. 503 suggests this is a problem with GitHub Actions, not with my workflow.

Me too, but with setup-node@v2 for 16.x

Found in cache @ /opt/hostedtoolcache/node/16.15.1/x64
/opt/hostedtoolcache/node/16.15.1/x64/bin/npm config get cache
/home/runner/.npm
Error: getCacheEntry failed: Cache service responded with 503

14.x works great:
Found in cache @ /home/ghrunner/actions-runner/_work/_tool/node/14.18.2/x64

UPD: See a workaround below: #80 (comment)

@perrin4869
Copy link
Contributor

Yeah all my actions are failing now, too...

@dannyk03
Copy link

Same here What's going on? We have production build failed, which is critical

@Ginxo
Copy link

Ginxo commented Jun 13, 2022

@afrokick
Copy link

afrokick commented Jun 13, 2022

Me too, but with setup-node@v2 for 16.x

Found in cache @ /opt/hostedtoolcache/node/16.15.1/x64
/opt/hostedtoolcache/node/16.15.1/x64/bin/npm config get cache
/home/runner/.npm
Error: getCacheEntry failed: Cache service responded with 503

14.x works great: Found in cache @ /home/ghrunner/actions-runner/_work/_tool/node/14.18.2/x64

[For NodeJS] So, I had an investigation. It doesn't work if cache was enabled. Try to disable cache by commenting cache key in your job.

Warning: It'll slowdown your action. It is just temporary solution!!!

jobs:
  check-format:
    runs-on: self-hosted
    steps:
      - uses: actions/checkout@v2
      - name: Use Node.js 16.x
        uses: actions/setup-node@v2
        with:
          node-version: 16.x
#          cache: 'npm'   <--- Action works only if cache disabled.
      - run: npm i
      - name: Check format
        run: npm run check-format
      - name: Linting
        run: npm run lint

@Tonio-lavanda
Copy link

It wasn't working for me 5min ago (503 error), I retried now and it's working

@yatuvy
Copy link

yatuvy commented Jun 13, 2022

same here, looks like a github failure ...

@mnicol93
Copy link

Me too, but with setup-node@v2 for 16.x

Found in cache @ /opt/hostedtoolcache/node/16.15.1/x64
/opt/hostedtoolcache/node/16.15.1/x64/bin/npm config get cache
/home/runner/.npm
Error: getCacheEntry failed: Cache service responded with 503

14.x works great: Found in cache @ /home/ghrunner/actions-runner/_work/_tool/node/14.18.2/x64

[For NodeJS] So, I had an investigation. It doesn't work if cache was enabled. Try to disable cache by commenting cache key.

Warning: It'll slowdown your action. It is just temporary solution!!!

jobs:
  check-format:
    runs-on: self-hosted
    steps:
      - uses: actions/checkout@v2
      - name: Use Node.js 16.x
        uses: actions/setup-node@v2
        with:
          node-version: 16.x
#          cache: 'npm'   <--- Action works only if cache disabled.
      - run: npm i
      - name: Check format
        run: npm run check-format
      - name: Linting
        run: npm run lint

This worked for me, thanks @afrokick

@IamViditAgarwal
Copy link

I was also facing the same issue , I checked the github repo for the actions/setup-node and found out they have release a v3 upgrade .
So i changed my code to use
actions/setup-node@v3

and now its working 👍🏻 ..

May be you guys also try this method . And also its good practice to keep upgrading the version of the github action step

@afrokick
Copy link

I was also facing the same issue , I checked the github repo for the actions/setup-node and found out they have release a v3 upgrade . So i changed my code to use actions/setup-node@v3

and now its working 👍🏻 ..

May be you guys also try this method . And also its good practice to keep upgrading the version of the github action step

Run actions/setup-node@v3
Found in cache @ /home/ghrunner/actions-runner/_work/_tool/node/16.15.1/x64
/home/ghrunner/actions-runner/_work/_tool/node/16.15.1/x64/bin/npm config get cache
/home/ghrunner/.npm
Error: getCacheEntry failed: Cache service responded with 503

Just tried, doesn't work for v3. Only works with disabled cache.

@vinayakkulkarni
Copy link

Yep, facing issue with cache: 'npm' but removing it fixes it...

      ....
      - name: Setup node env 📦
        uses: actions/setup-node@v3
        with:
          node-version: ${{ matrix.node }}
          check-latest: true
-          cache: 'npm' 
      ....

@TaenFN
Copy link

TaenFN commented Jun 13, 2022

We're facing the same issue.

Error: getCacheEntry failed: Cache service responded with 503
- name: Install Node Deps
  uses: bahmutov/npm-install@v1

No cache key is specified.

@Ulset
Copy link

Ulset commented Jun 13, 2022

Same issue here

Run actions/setup-node@v2
Found in cache @ /opt/hostedtoolcache/node/16.15.1/x64
/opt/hostedtoolcache/node/16.15.1/x64/bin/npm config get cache
/home/runner/.npm
Error: getCacheEntry failed: Cache service responded with 503

@lossless1
Copy link

I added the following to my package.json

"resolutions": {
    "@types/react": "17.0.14",
    "@types/react-dom": "17.0.14"
  }

worked for me :)))

how is it related to cache issue?

@riffraff
Copy link

@lossless1 it's probably invalidating the cache

@ChristianBell1995
Copy link

Getting the same error here for actions/setup-node@v2

@sdsa-cci
Copy link

##[debug]getCacheEntry - Attempt 2 of 2 failed with error: Cache service responded with 503
Error: getCacheEntry failed: Cache service responded with 503

Getting this issue from past 10 mins now.

@kimjngyun
Copy link

Getting the same error here for actions/setup-node@v3

Attempting to download 17.x...
Not found in manifest.  Falling back to download directly from Node
Acquiring 17.[9](https://github.com/kimjngyun/kimjngyun.github.io/runs/6859207416?check_suite_focus=true#step:3:10).1 - x64 from https://nodejs.org/dist/v17.9.1/node-v17.9.1-linux-x64.tar.gz
Extracting ...
/usr/bin/tar xz --strip 1 --warning=no-unknown-keyword -C /home/runner/work/_temp/42346de7-0551-426c-8ac4-088aec477c41 -f /home/runner/work/_temp/171d2419-fa2c-464b-8235-cca6d234c4bc
Adding to the cache ...
Done
/usr/local/bin/yarn --version
1.22.18
/usr/local/bin/yarn cache dir
/home/runner/.cache/yarn/v6
Error: getCacheEntry failed: Cache service responded with 503

Noorts added a commit to onramper/widget that referenced this issue Jun 13, 2022
@akindo
Copy link

akindo commented Jun 13, 2022

Updating to Checkout v. 3 didn't help. Didn't try updating setup-node to v. 3, but disabling npm cache did the trick.

@dmarinere
Copy link

Updating to Checkout v. 3 didn't help. Didn't try updating setup-node to v. 3, but disabling npm cache did the trick.

How do I disable cache

@yras5869
Copy link

Disable the cache. It should work

@afrokick
Copy link

Updating to Checkout v. 3 didn't help. Didn't try updating setup-node to v. 3, but disabling npm cache did the trick.

How do I disable cache

Read above.

#80 (comment)

@dmarinere
Copy link

Updating to Checkout v. 3 didn't help. Didn't try updating setup-node to v. 3, but disabling npm cache did the trick.

How do I disable cache

Read above.

#80 (comment)

Thank you

@sm1990
Copy link

sm1990 commented Jun 13, 2022

I was also facing the same issue , I checked the github repo for the actions/setup-node and found out they have release a v3 upgrade . So i changed my code to use actions/setup-node@v3

and now its working 👍🏻 ..

May be you guys also try this method . And also its good practice to keep upgrading the version of the github action step

I have setup-node@v3 and still got the issue. Commenting cache:npm worked for me.

@sdsa-cci
Copy link

No need to upgrade anything. Just re-run you failed jobs. I tried this and worked for me. Seems like it was a service issues from Github's side.

Klaas-Ritense added a commit to Gemeente-DenHaag/nl-portal-libraries that referenced this issue Jun 13, 2022
@topleft1562
Copy link

still failing for me.

@kudaleganesh
Copy link

Disabling the cache:npm works for me.

@sirJiggles
Copy link

are you all turning the cache on again and it works after? as I don't really want to just "turn off the cache" ideally 🙈

@christos97
Copy link

christos97 commented Jun 13, 2022

Yes disabling (commenting out) the cache works.

It's not about the setup-* version.

Re-running failed jobs may work (tested) but it's not reliable.

If you HAVE to release today, just remove the cache but they will get it to work eventually I guess.

The thing here is, we need a way to disable cache without commiting t master branch imho
if the cache action is un-reliable.

Is this happening because of the underlying actions/cache action?

If so we need to know, we use actions/cache to cache angular build files too.

@mateoqac
Copy link

Ruby budnle-cache is failing too! :(

@kudaleganesh
Copy link

kudaleganesh commented Jun 13, 2022

are you all turning the cache on again and it works after? as I don't really want to just "turn off the cache" ideally 🙈

After turning the cache on again, it failed. It is a temp solution.

@kudaleganesh
Copy link

It is a service issue.
https://www.githubstatus.com/

@stdimitrovv
Copy link

No production releases today, boys 😃

@mwmw7
Copy link

mwmw7 commented Jun 13, 2022

Oh my god... We have to do hotfix...our team is still wating

@Indronil
Copy link

Hi,

I am having the same issue in my CI system just started occurring today for the first time. It was working fine without any issue until Friday.

Run actions/setup-node@v2
Found in cache @ /opt/hostedtoolcache/node/14.19.3/x64
/usr/local/bin/yarn --version
1.22.18
/usr/local/bin/yarn cache dir
/home/runner/.cache/yarn/v6
Error: getCacheEntry failed: Cache service responded with 503

Is it an issue from github side and will it be solved soon? We can live without cache until then if that is the case?

@afrokick
Copy link

Hi,

I am having the same issue in my CI system just started occurring today for the first time. It was working fine without any issue until Friday.

Run actions/setup-node@v2 Found in cache @ /opt/hostedtoolcache/node/14.19.3/x64 /usr/local/bin/yarn --version 1.22.18 /usr/local/bin/yarn cache dir /home/runner/.cache/yarn/v6 Error: getCacheEntry failed: Cache service responded with 503

Is it an issue from github side and will it be solved soon? We can live without cache until then if that is the case?

Yes, just disable cache for some time while Github fixing this issue

@sherif-farid
Copy link

sherif-farid commented Jun 13, 2022

updating from v2 to v3 solved my problem

steps:
      - uses: actions/checkout@v3
      - name: set up JDK 11
        uses: actions/setup-java@v3
        with:
          java-version: 11
          distribution: corretto

@stdimitrovv
Copy link

It's up again, boys, the dream is alive

@sergiovanacloig
Copy link

sergiovanacloig commented Jun 13, 2022

The issue should be solved, it seemed a problem in the github actions side. You can check here for the status: https://www.githubstatus.com/

@christos97
Copy link

Can you please add the ability to disable the cache without commiting to master ?
Maybe directly from the actions tab if cache is mentioned in the yaml file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests