Fixing issue #12892 #1
Annotations
4 errors
copilot
Process returned non-zero exit code: 2\n```\n\nThis happens specifically on the first run when:\n1. There is a cache miss (no previous cache to restore)\n2. The directory specified in the `path` input doesn't exist\n3. The post-job execution tries to save the cache but fails because the directory doesn't exist\n\n## The Solution\n\nAdded a JavaScript script that runs before the agent plugin to ensure the cache directory exists:\n\n1. Created `restoreCache.js` that checks if the directory exists and creates it if needed\n2. Modified `task.json` to include Node execution targets (10, 16, and 20) while preserving the agent plugin functionality\n3. Added proper package.json for dependency management\n4. Added README.md with documentation and usage examples\n\nThis ensures that when users set up caching for Yarn packages as described in the documentation:\n\n```yaml\nvariables:\n YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn\n\nsteps:\n- task: Cache@2\n inputs:\n key: 'yarn | \"$(Agent.OS)\" | yarn.lock'\n restoreKeys: |\n yarn | \"$(Agent.OS)\"\n path: $(YARN_CACHE_FOLDER)\n displayName: Cache Yarn packages\n```\n\nThe task will now work properly even on the first run when the directory doesn't exist yet.\n\nFixes #12892."
|
copilot
Process returned non-zero exit code: 2
|
copilot
Process returned non-zero exit code: 2\r\nFinishing: Cache Yarn packages\r\n```\r\n\n## Comments on the Issue (you are @copilot in this section)\n\n<comments>\n<comment_new>\n<comment_id>1550357005</comment_id>\n<author>@johnterickson</author>\n@vixero-dev Can you share your the log from the task failure?\r\n\r\nA lot of these issues look like folks either aren't:\r\n1. Setting the correct variable (as defined by the package manager) at the pipeline-level to configure where the package manager should cache things\r\n2. Actually invoking the package manager (the cache task does not do this)\n</comment_new>\n\n</comments>\n\n","owner":"microsoft","repo":"azure-pipelines-tasks","numSnippets":10}
|
copilot
Process returned non-zero exit code: 2
|
Artifacts
Produced during runtime
Name | Size | Digest | |
---|---|---|---|
results
Expired
|
298 Bytes |
sha256:0c7a84177947c9abd2aa7428d5331bf26e333981dba9354b42911f8e668937ad
|
|