-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
cache restore on versions 3 and 4 not working #1361
Comments
|
Im currently getting:
Not sure if its related but even deleting all caches it wont recreate them... |
Same issue here. Have been wracking my brain why this doesn't work and then wanted to eventually open an issue and found out there's one already. upd: v2 works as expected |
@mark-jordanovic-lewis just to ensure, do you have exactly same value in the "path" parameter both in save and restore? I had different and restore failed too. |
Correct. Same parameters in each use of the action. |
Per actions/cache#1361 restores in v3 and v4 were not working, maybe saving is botched, too?
Per actions/cache#1361 restores in v3 and v4 were not working, maybe saving is botched, too?
We are seeing similar issues on v4 where the cache is not found despite clearly existing, only 1/5 runs are picked up correctly, is the cache action not reliable-ish? |
I encountered the same issue. Save v4 + restore v2 cannot work as well. Using save v2 + restore v2 can resolve the problem. However, it seems that Node.js 16 is going to be deprecated. |
I just found the reason: in v4, the |
@njzjz I'm encountering this problem too and the paths are the same for me |
#1
El dom, 26 de may. de 2024 19:55, Wout Mertens ***@***.***>
escribió:
… @njzjz <https://github.com/njzjz> I'm encountering this problem too and
the paths are the same for me
—
Reply to this email directly, view it on GitHub
<#1361 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BGG5ZMWZ5SQ7TVB3OGEP663ZEGINXAVCNFSM6AAAAABE574CB6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZSGEYTSMRYGQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Facing the same issue, any fix anytime soon?
restore v2 does not exist. it's only cache v2 |
I can also confirm that |
To be frank I'm surprised how a core action like "cache" is still broken and no (visible) steps are taken to fix it... At times github actions seem completely unreliable for anything beyond small open-source stuff that isn't mission-critical. |
I hit this too. I was using Variations of this issue seem to be reported in a number of other issues: |
@markfickett my paths are static and I'm experiencing this issue. The problem is that it's intermittent. |
Also confirming v4 is broken. I’m using static paths as well. I downgraded to v2 and everything works now. |
@bethanyj28 @robherley @kotewar sorry about the pings but I cant believe this has been sitting here broken for so long |
I have some workflows in which v3 and v4 work consistently and some that fail consistently. I'm not seeing the intermittant success/fail but I do see inconsistenty across workflows. |
@mark-jordanovic-lewis I am not sure about other jobs, but for |
Correct. Thanks @njzjz. |
I just realized I had a trailing slash in one of the places and not the others. Now I made sure all the path strings are exactly the same and it seems to work without issues. |
actions/cache/v3 and v4 do not work on windows. v2 is reported working. See actions/cache#1361 (comment)
# Qual: Adjust cache configuration for windows-ci actions/cache@v4 is flawed on windows, try suggestions from issue discussion to fix it. actions/cache#1361 .
# Qual: Adjust cache configuration for windows-ci actions/cache@v4 is flawed on windows, try suggestions from issue discussion to fix it. actions/cache#1361 .
I confirm that caching works after:
|
* Qual: Adjust cache configuration for windows-ci # Qual: Adjust cache configuration for windows-ci actions/cache@v4 is flawed on windows, try suggestions from issue discussion to fix it. actions/cache#1361 . * Make cache key depend on install path directory
* Qual: Adjust cache configuration for windows-ci # Qual: Adjust cache configuration for windows-ci actions/cache@v4 is flawed on windows, try suggestions from issue discussion to fix it. actions/cache#1361 . * Make cache key depend on install path directory
* Qual: Adjust cache configuration for windows-ci # Qual: Adjust cache configuration for windows-ci actions/cache@v4 is flawed on windows, try suggestions from issue discussion to fix it. actions/cache#1361 . * Make cache key depend on install path directory
actions/cache#1361 This ecosystem is a disaster.
* Update Manifest * Call resolve() in preview/publish workflows Closes #518 * Add GHA workflow to resolve Manifest file * Prefix cache path with `./` cf. actions/cache#1361
Just want to highlight that we're also having problems with v3 and v4. Our build (at a high level) does this: (1) Download dependencies (using Composer as it's a PHP app, but I don't think that detail is important) and cache them using Steps (2a) and (2b) After reverting to v2 this works as expected. Our workflow file looks something like the following: name: Tests
on:
push:
branches: [ main, develop ]
pull_request:
branches:
- '**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
composer_install:
name: Install composer dependencies
runs-on: ubuntu-latest
container:
image: jakzal/phpqa:php8.3-alpine
steps:
- uses: actions/checkout@v4
- name: Cache composer dependencies
uses: actions/cache/save@v4
id: cache-composer
with:
path: vendor
key: composer-${{ hashFiles('composer.lock') }}
- name: Install composer dependencies
run: composer install --prefer-dist --no-ansi --no-interaction --no-progress
build_frontend:
name: Build frontend
runs-on: ubuntu-latest
needs: [composer_install]
container:
image: node:20.11.0
steps:
- uses: actions/checkout@v4
- name: Cache frontend build
uses: actions/cache/save@v4
id: cache-frontend
with:
path: public/build
key: npm-${{ hashFiles('package-lock.json') }}
- name: Restore composer cache
uses: actions/cache/restore@v4
id: restore-composer-cache
with:
path: vendor
key: composer-${{ hashFiles('composer.lock') }}
fail-on-cache-miss: true
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
static_analysis_check:
name: Check static analysis
runs-on: ubuntu-latest
container:
image: jakzal/phpqa:php8.3-alpine
needs: [composer_install]
steps:
- uses: actions/checkout@v4
- name: Restore composer cache
uses: actions/cache/restore@v4
id: restore-composer-cache
with:
path: vendor
key: composer-${{ hashFiles('composer.lock') }}
fail-on-cache-miss: true
- name: Run PHPStan analysis
run: php -d memory_limit=-1 vendor/bin/phpstan analyze --error-format=github
tests:
name: Run tests
runs-on: ubuntu-latest
container:
image: jakzal/phpqa:php8.3-alpine
needs: [composer_install, build_frontend]
steps:
- uses: actions/checkout@v4
- name: Restore composer cache
uses: actions/cache/restore@v4
id: restore-composer-cache
with:
path: vendor
key: composer-${{ hashFiles('composer.lock') }}
fail-on-cache-miss: true
- name: Restore frontend cache
uses: actions/cache/restore@v4
id: restore-frontend-cache
with:
path: public/build
key: npm-${{ hashFiles('package-lock.json') }}
fail-on-cache-miss: true
# snip... not relevant after this line |
Had a similar issue as many in this thread. Can confirm that it works with an absolute path, inputted identically as Would not be an issue IMO if the documentation was clearer on this. |
So cache@v2 is going to be deprecated soon which makes this all the more difficult as there will be a required upgrade to v3/v4 now: https://github.com/actions/cache?tab=readme-ov-file#whats-new
Is GitHub really going to sit on this and let it break for everyone without trying to clarify it? |
Not sure if it helps anyone else, but just wanted to highlight that we were able to fix the issue by:
Godspeed and good luck! |
The base image (assuming this means the |
The functionality of the cache action seems to be completely broken.
Configurations attempted:
Experimental Workflow and Results
The cache is being accessed on the same branch, in the same workflow (and later, if the first set of jobs pass).
These screenshots pertain to the run of base cache action @V3, they are consistent across all configurations.
Cache version 2 works as expected.
Would definitely prefer to use the most recent versions.
The text was updated successfully, but these errors were encountered: