You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Github action is stuck when trying to restore the cache #207
As it appears in the screenshot I had to stop the action after 15mins.
I can see from some data points that the cache restore usually fluctuates between 5sec - 1min and the cache size: is around 150 MB .
I hope the above are helpful. 🙏
Reacted by Tor Egil Jacobsen, Christoph, Jimmi Fragkos, Anton Rieder, Will Batey and Fran Dios
Hi @joshmgross Thanks so much for you reply.
I have to admit it's quite often, pretty much in daily basis, sometimes it can be average 1 every 5 jobs but depends.
Thanks for the tip about debug logging! I'll enable this and come back with more findings if any. 🙂
It's possible this is a similar issue to #204, where the cache size kept growing steadily over time. If you can get a restore fully completed, it would be good to check what that restored cache's size.
It's possible this is a similar issue to #204, where the cache size kept growing steadily over time. If you can get a restore fully completed, it would be good to check what that restored cache's size.
Will do thanks. I had a look on cache when it got stuck and the cache size was around 150 MB which I assume is acceptable?
I'm seeing the same kind of thing impacting both Ruby tasks, with latency spikes severe enough that performance degrades worse than if there were no caching at all.
This is coming up most in a build where tasks are parallelized to run subsets of tests, with say 8 shards running in parallel (related issue with less activity: #189). In about half of the runs, one of the shards will take more time to set up the cache than it takes to run the tests, but the other 7 shards will set up the cache in a few seconds as expected. The cached folder size is ~600mb in this situation (I also see #202 about changing the compression for cached objects is still in progress).
Here's an example of expected response time (~20 seconds):
And a degraded state for the same cache read from another shard, over 4min (>10x the expected latency):
(EDIT1: A few days later, I'm seeing latency vary from 2s to hitting the 10m timeout I set. The cache size has also grown to 1.7GB!)
This is what I'd expect the worst-case failure of the cache service to look like. So perhaps there is some kind of timeout bug in the code doing cache reads, or the cache reads need additional monitoring to abort if the download rate falls much lower than expected? If the cache read action fails within 30 seconds, the job can fall back and that seems reasonable if say the caching service is down. But latency spikes this severe are worse than the service being down altogether or if there were no caching at all :\
I'm doing some more runs with debugging enabled (thanks!), and reading up on #204 more now too, but happy to share any other info that would help debug on your end, thanks! 👍
In the last ~30 minutes, I've seen some tasks successfully read the cache in 2sec, and others hit the 10m job timeout I added and have still not be able to read the cache.
I've also seen the step complete in <1 sec because the cache read failed, with the message [warning]No scopes with read permission were found on the request. This has happened across other tasks with different cache reads as well (eg, node_modules caching). This is a better failure mode than just hanging until it hits the job timeout, but of course the cache being down for long periods of time is also a problem :)
EDIT: I think the permissions is a separate issue, since I'm also seeing this on cache writes now, so going to open that separately in #251. EDIT2: turns out that root cause is from #208 (comment).
Cache reads are again stalling for >10 minutes and hitting the job timeout. Here's another example of what I see with debug logs enabled (link). These are the last few lines:
Thu, 16 Apr 2020 21:53:28 GMT ##[debug]Re-evaluate condition on job cancellation for step: 'Setup gem caching'.
Thu, 16 Apr 2020 21:53:28 GMT ##[error]The operation was canceled.
This was from a job where 8 similar cache reads run in parallel. Two timed out altogether, others took ~3min, and others took ~1min (which has been typical over the last week or two). For the jobs where the cache reads succeeded, this is what I see afterward (link):
@joshmgross sure! I've only set up GitHub Actions for one repository, and all the Ruby tasks for that repository run multiple jobs in parallel that all read from the same cache. It's to parallelize rspec tests in CI (which, when the caching is working, is amazing and cuts the total test time down to 25% of what it was before! 👍). I've run into this issue on maybe ~40% of the days I've run these tasks over the last week or two, so timeouts and latency degradation this severe have been a major recurring issue, and not isolated to a single point in time.
I've shared some links and debug logs above, but let me know whatever other info would help y'all debug. Thanks! :)
Interesting thing is that it does not happens always. It was quite stable for 3 weeks and started again last week. I've changed the workflows/main.yml to make a few extra checks if: steps.cache_bundler.outputs.cache-hit != 'true' in case cache tries to be updated while there is a cache hit. I'll post again if I have more findings.
Thanks :)
Not sure if this is the same issue, these are the logs I'm getting in one project:
Run actions/cache@v1
Cache Size: ~163 MB (171229184 B)
/bin/tar -xz -f /home/runner/work/_temp/f6902ff4-6a96-4897-9666-240b17e5e8e1/cache.tgz -C /home/runner/.cache/yarn/v6
gzip: stdin: unexpected end of file
/bin/tar: Unexpected EOF in archive
/bin/tar: Unexpected EOF in archive
/bin/tar: Error is not recoverable: exiting now
[warning]Tar failed with error: The process '/bin/tar' failed with exit code 2
It took about 20 minutes for this step to finish, and always happens when retrying the build.
There are several jobs reading from the same cache, and all of them work except one 🤔
@joshmgross This issue is still occurring frequently. The cache read either times out after it hits the 10 minute job threshold I added to work around this, or the cache read fails immediately with the error message "[warning]No scopes with read permission were found on the request." (see #251 and #208 (comment)).. I have seen both issues today.
Thanks for your work on this! It's disappointing to see core features of GitHub actions in such an unreliable state for so long, and I hope you'll resolve them! The experience with GitHub actions has been great otherwise, and I'd love to re-enable caching in the future :)
Activity
jactor-rises commentedon Mar 6, 2020
I am stringing with the same issue: #204
joshmgross commentedon Mar 24, 2020
👋 Hey @berkos,
How often are you seeing this issue? Have you seen it recently?
We've seen issues with the
hashFilesfunction and symlinks getting stuck (#95) but based on your logs it looks like your keys have valid hashesCould you Enable debug logging?
berkos commentedon Mar 25, 2020
Hi @joshmgross Thanks so much for you reply.
I have to admit it's quite often, pretty much in daily basis, sometimes it can be average 1 every 5 jobs but depends.
Thanks for the tip about debug logging! I'll enable this and come back with more findings if any. 🙂
joshmgross commentedon Mar 25, 2020
It's possible this is a similar issue to #204, where the cache size kept growing steadily over time. If you can get a restore fully completed, it would be good to check what that restored cache's size.
berkos commentedon Mar 25, 2020
Will do thanks. I had a look on cache when it got stuck and the cache size was around 150 MB which I assume is acceptable?
joshmgross commentedon Mar 25, 2020
Yep, that's a relatively small cache so I wouldn't expect anything to take very long.
kevinrobinson commentedon Apr 6, 2020
I'm seeing the same kind of thing impacting both Ruby tasks, with latency spikes severe enough that performance degrades worse than if there were no caching at all.
This is coming up most in a build where tasks are parallelized to run subsets of tests, with say 8 shards running in parallel (related issue with less activity: #189). In about half of the runs, one of the shards will take more time to set up the cache than it takes to run the tests, but the other 7 shards will set up the cache in a few seconds as expected. The cached folder size is ~600mb in this situation (I also see #202 about changing the compression for cached objects is still in progress).
Here's an example of expected response time (~20 seconds):

And a degraded state for the same cache read from another shard, over 4min (>10x the expected latency):

(EDIT1: A few days later, I'm seeing latency vary from 2s to hitting the 10m timeout I set. The cache size has also grown to 1.7GB!)
I've also previously seen that the cache read can timeout within 30 seconds (it appears this happens when it gets an ECONNRESET upstream, see https://github.com/studentinsights/studentinsights/pull/2801/checks?check_run_id=564603328 for an example):

This is what I'd expect the worst-case failure of the cache service to look like. So perhaps there is some kind of timeout bug in the code doing cache reads, or the cache reads need additional monitoring to abort if the download rate falls much lower than expected? If the cache read action fails within 30 seconds, the job can fall back and that seems reasonable if say the caching service is down. But latency spikes this severe are worse than the service being down altogether or if there were no caching at all :\
I'm doing some more runs with debugging enabled (thanks!), and reading up on #204 more now too, but happy to share any other info that would help debug on your end, thanks! 👍
kevinrobinson commentedon Apr 8, 2020
In the last ~30 minutes, I've seen some tasks successfully read the cache in 2sec, and others hit the 10m job timeout I added and have still not be able to read the cache.
I've also seen the step complete in <1 sec because the cache read failed, with the message
[warning]No scopes with read permission were found on the request.This has happened across other tasks with different cache reads as well (eg,node_modulescaching). This is a better failure mode than just hanging until it hits the job timeout, but of course the cache being down for long periods of time is also a problem :)It seems like there must be a service outage or something, but there's nothing shown at https://www.githubstatus.com/)

EDIT: I think the permissions is a separate issue, since I'm also seeing this on cache writes now, so going to open that separately in #251. EDIT2: turns out that root cause is from #208 (comment).
kevinrobinson commentedon Apr 16, 2020
Cache reads are again stalling for >10 minutes and hitting the job timeout. Here's another example of what I see with debug logs enabled (link). These are the last few lines:
Then I see this ~10 min later:
This was from a job where 8 similar cache reads run in parallel. Two timed out altogether, others took ~3min, and others took ~1min (which has been typical over the last week or two). For the jobs where the cache reads succeeded, this is what I see afterward (link):
I've seen other issues about the cache size continually growing (eg #204 for Maven and #201 (comment) for Ruby, thread on Reddit: https://www.reddit.com/r/github/comments/fsdnv6/cache_wont_work_with_github_actions_and_ruby/). But even if that's an issue I'm not sure how that explains the extreme variability in latency we're seeing.
joshmgross commentedon Apr 17, 2020
👋 Hey @kevinrobinson thanks for reporting this. We're looking into our telemetry and seeing what could cause these cache restore timeouts.
How often would you say you hit these issues? Is it always with workflows that multiple jobs pulling from the same cache?
kevinrobinson commentedon Apr 17, 2020
@joshmgross sure! I've only set up GitHub Actions for one repository, and all the Ruby tasks for that repository run multiple jobs in parallel that all read from the same cache. It's to parallelize rspec tests in CI (which, when the caching is working, is amazing and cuts the total test time down to 25% of what it was before! 👍). I've run into this issue on maybe ~40% of the days I've run these tasks over the last week or two, so timeouts and latency degradation this severe have been a major recurring issue, and not isolated to a single point in time.
I've shared some links and debug logs above, but let me know whatever other info would help y'all debug. Thanks! :)
berkos commentedon Apr 23, 2020
Hey @joshmgross I can also confirm that the cache freezes on parallel jobs that pull from the same cache that a depended job has created.
Unfortunately logs do not provide enough data. On the last line it's me cancelling the job after 11 minutes for no progression.
Interesting thing is that it does not happens always. It was quite stable for 3 weeks and started again last week. I've changed the
workflows/main.ymlto make a few extra checksif: steps.cache_bundler.outputs.cache-hit != 'true'in case cache tries to be updated while there is a cache hit. I'll post again if I have more findings.Thanks :)
frandiox commentedon Apr 30, 2020
Not sure if this is the same issue, these are the logs I'm getting in one project:
It took about 20 minutes for this step to finish, and always happens when retrying the build.
There are several jobs reading from the same cache, and all of them work except one 🤔
kevinrobinson commentedon May 7, 2020
@joshmgross This issue is still occurring frequently. The cache read either times out after it hits the 10 minute job threshold I added to work around this, or the cache read fails immediately with the error message "[warning]No scopes with read permission were found on the request." (see #251 and #208 (comment)).. I have seen both issues today.
Thanks for your work on this! It's disappointing to see core features of GitHub actions in such an unreliable state for so long, and I hope you'll resolve them! The experience with GitHub actions has been great otherwise, and I'd love to re-enable caching in the future :)
joshmgross commentedon May 7, 2020
#284 should fix some of these download issues. It's currently in the
masterand we'll port it back tov1along with some other fixes.This is a known issue with Pull Request re-runs and we're actively working on a fix.
joshmgross commentedon Aug 7, 2020
V2 of
actions/cachehas multiple improvements to cache downloads and we've fixed the issue with re-running pull requests.