cache icon indicating copy to clipboard operation
cache copied to clipboard

Warning: Failed to restore: downloadCache failed: unable to verify the first certificate

Open agepalmist opened this issue 1 year ago • 6 comments

Dear team, I apologise if I'm in the wrong place. Couldn't find any relevant link. Trying to use actions/cache@3 or actions/cache/restore@v3 got this message: image

The cache was saved with a separate workflow and on the place. image

GitHub Enterprise Server 3.8.8

Runs-on: self-hosted

Might it be a runner settings issue related? Could you please give me a hint on how to resolve this? Thanks in advance. Regards, Denis.

agepalmist avatar Nov 27 '23 09:11 agepalmist

: cleanup caches by a branch on: pull_request: types: - closed

jobs: cleanup: runs-on: ubuntu-latest steps:
- name: Cleanup run: | gh extension install actions/gh-actions-cache

      echo "Fetching list of cache key"
      cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 )

      ## Setting this to not fail the workflow while deleting cache keys. 
      set +e
      echo "Deleting caches..."
      for cacheKey in $cacheKeysForPR
      do
          gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
      done
      echo "Done"
    env:
      GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      REPO: ${{ github.repository }}
      BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge

poiupoiu17990 avatar Nov 27 '23 16:11 poiupoiu17990

: cleanup caches by a branch on: pull_request: types: - closed

jobs: cleanup: runs-on: ubuntu-latest steps:
- name: Cleanup run: | gh extension install actions/gh-actions-cache

      echo "Fetching list of cache key"
      cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 )

      ## Setting this to not fail the workflow while deleting cache keys. 
      set +e
      echo "Deleting caches..."
      for cacheKey in $cacheKeysForPR
      do
          gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
      done
      echo "Done"
    env:
      GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      REPO: ${{ github.repository }}
      BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge

poiupoiu17990 avatar Nov 27 '23 16:11 poiupoiu17990

Hello @poiupoiu17990 as far as I understood this extension doesn't allow to use of a cache, only to list or delete. The question was how to use it.

BTW, for a GHES it requires GH_ENTERPRISE_TOKEN and GH_HOST definition instead of GH_TOKEN.

 env:
   GH_ENTERPRISE_TOKEN: ${{ github.token }}
   GH_HOST: 'git.custom-host.com'
 run: |
   gh extension install https://github.com/actions/gh-actions-cache
   gh actions-cache list 

agepalmist avatar Nov 29 '23 07:11 agepalmist

@agepalmist Did you ever find a solution?

attzonko avatar Mar 05 '24 18:03 attzonko

Setting the environment variable NODE_EXTRA_CA_CERTS to /etc/ssl/certs/ca-certificates.crt (ubuntu) solved the issue for me.

mgehre-amd avatar Mar 06 '24 08:03 mgehre-amd