Error in post-job step of CacheV2 task when caching yarn packages
See original GitHub issueRequired Information
Entering this information will route you directly to the right team and expedite traction.
Question, Bug, or Feature?
Type: Bug
Enter Task Name: CacheV2 (https://github.com/microsoft/azure-pipelines-tasks/tree/master/Tasks/CacheV2)
Environment
-
Server - Azure Pipelines
- Account name: markethype
- Team project name: MarketHype
- Build ID: 1563
- URL: https://dev.azure.com/markethype/MarketHype/_build/results?buildId=1563
-
Agent - Hosted:
- Agent Queue name: Azure Pipelines (https://dev.azure.com/markethype/MarketHype/_settings/agentqueues?queueId=17&view=jobs)
Issue Description
Using the CacheV2 task to cache Yarn packages, we’re getting an error in the post-job step of the cache task.
The task is defined exactly as in the docs.
variables:
YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
steps:
- task: Cache@2
inputs:
key: 'yarn | "$(Agent.OS)" | yarn.lock'
restoreKeys: |
yarn | "$(Agent.OS)"
path: $(YARN_CACHE_FOLDER)
displayName: Cache Yarn packages
We’re using the vs2017-win2016
image.
Error logs
Starting: Cache Yarn packages
==============================================================================
Task : Cache
Description : Cache files between runs
Version : 2.0.0
Author : Microsoft Corporation
Help : https://aka.ms/pipeline-caching-docs
==============================================================================
Resolving key:
- yarn [string]
- "Windows_NT" [string]
- common/config/rush/yarn.lock [file] --> 0551FA989D7CDCB2101F1397E8E7C5468396D4C72935548B6A74BEB126F0296F
Resolved to: yarn|"Windows_NT"|57F7K6kT3NtH/ZuSuWsxueTn4wCxuYls973WEnqCJgE=
Information, ApplicationInsightsTelemetrySender will correlate events with X-TFS-Session 06101a50-81b0-41b6-ab13-b130ee5c98ae
Information, Getting a pipeline cache artifact with one of the following fingerprints:
Information, Fingerprint: `yarn|"Windows_NT"|57F7K6kT3NtH/ZuSuWsxueTn4wCxuYls973WEnqCJgE=`
Information, There is a cache miss.
tar: D\:\\a\\1\\.yarn: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
Information, ApplicationInsightsTelemetrySender correlated 1 events with X-TFS-Session 06101a50-81b0-41b6-ab13-b130ee5c98ae
##[error]Process returned non-zero exit code: 2
Finishing: Cache Yarn packages
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:23
Top Results From Across the Web
Azure Pipelines "Cache@2" fails with "##[error]The system ...
Post-job @Cache task (added implicitly): reads the npm cache found at user-provided location to store it for future reuse. User-provided ...
Read more >@Cache2 NodeJS/NPM caching no longer works on Linux ...
Hi,. We appear to be having an issue with the @Cache2 task. It's been working fine, at least up until the 4th of...
Read more >Pipeline caching - Azure - Microsoft Learn
Caching is added to a pipeline using the Cache pipeline task. This task works like any other task and is added to the...
Read more >Azure: Pipeline caching. In late 2019, Azure DevOps finally…
Once you add caching to any build pipeline, Azure automatically adds a post-job cache task. Don't be surprised by this additional automated step...
Read more >Yarn Module Not Found Error In Azure Pipelines Via Cache ...
Using the CacheV2 task to cache Yarn packages, we're getting an error in the post-job step of the cache task. The task is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@jfheins thanks for the hint.
Current configuration works for me in cloud-hosting:
Same issue here on a hosted linux agent