cache icon indicating copy to clipboard operation
cache copied to clipboard

Errors out on pip cache (no changes, worked fine until now)

Open DFi-DeepakMishra opened this issue 8 months ago • 1 comments

In the actions workflow the below snippet is present to cache the pip dependencies, now getting the below error while inserting anything in the mentioned directory. This was working fine till now, from today onwards it is throwing the error.

Code snippet: runs: using: "composite" steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v3 with: python-version: "3.9" cache: "pip" - name: dependencies shell: bash working-directory: mechanic/snowflake/snowddl run: pip install -r requirements.txt

Error:

Run actions/setup-python@v3
Successfully setup CPython (3.9.21)
/opt/hostedtoolcache/Python/3.9.21/x64/bin/pip cache dir
/home/runner/.cache/pip
Error: Cache service responded with 422

Is there any supported cache service shutdown happened recently?

DFi-DeepakMishra avatar Apr 16 '25 13:04 DFi-DeepakMishra

In the actions workflow the below snippet is present to cache the pip dependencies, now getting the below error while inserting anything in the mentioned directory. This was working fine till now, from today onwards it is throwing the error.

Code snippet: runs: using: "composite" steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v3 with: python-version: "3.9" cache: "pip" - name: dependencies shell: bash working-directory: mechanic/snowflake/snowddl run: pip install -r requirements.txt

Error:

Run actions/setup-python@v3
Successfully setup CPython (3.9.21)
/opt/hostedtoolcache/Python/3.9.21/x64/bin/pip cache dir
/home/runner/.cache/pip
Error: Cache service responded with 422

Is there any supported cache service shutdown happened recently?

TLDR: Update to setup-python v4 or v5, GitHub deprecated the old cache backend and any actions using caching that use the old cache library will fail.

See https://github.com/actions/cache/discussions/1510#discussioncomment-12726521. I tried asking if they were backporting to older versions but they did not see heavy usage.

GitHub backported the cache code to the following versions:

actions/setup-dotnet	v3
actions/setup-go	v4
actions/setup-go	v3
actions/setup-go	v5
actions/setup-java	v3
actions/setup-java	v4
actions/setup-node	v3
actions/setup-node	v4
actions/setup-python	v4
actions/setup-python	v5

Any older versions will fail. I actually thought the failure would be more graceful, e.g. caching fails but the job still completes. They def should have formally announced a deprecation of the older setup-* versions.

AdnaneKhan avatar Apr 16 '25 17:04 AdnaneKhan