Skip to content
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

Strange sporadic "Could not get yarn cache folder path" with v3 #887

Open
2 of 5 tasks
xcq1 opened this issue Nov 7, 2023 · 13 comments
Open
2 of 5 tasks

Strange sporadic "Could not get yarn cache folder path" with v3 #887

xcq1 opened this issue Nov 7, 2023 · 13 comments
Assignees
Labels
bug Something isn't working

Comments

@xcq1
Copy link

xcq1 commented Nov 7, 2023

Description:
We currently encounter sporadic issues in our CI pipelines that make use of setup-node@v3 with Yarn 1 Caching. During setup-node the command yarn cache dir fails for only one (apparently) random project folder with exit code 1, at least the error message Could not get yarn cache folder path for ... is printed, and the build fails. This started around the time we migrated the CI to Node 20 in mid-October.

These issues are not easily reproducible since it works fine most of the time, but then fails in only one very specific place only. The GHA workflow contains multiple very similar jobs that perform the same setup, and of these only one job fails the command in only one particular folder. After one to a few rebuilds the issue has usually resolved itself. Unfortunately, with enough repositories, CI jobs and project folders, it's only a question of time until it pops up again.

Sometimes, the error message is accompanied by what appears to be a V8/nodejs Stacktrace crashing somewhere about v8::internal::Deserializer called by node::contextify::ContextifyScript::New(v8::FunctionCallbackInfo<v8::Value> const&) [node] with either

# Fatal error in , line 0
# Check failed: current == end_slot_index.

or

# Fatal error in , line 0
# unreachable code

Clearing the caches from Management > Caches in the Actions UI did not help, and after looking through all the code that gets executed until this point and could (or could not) cause such issues, and being unable to find anyone else with the same issue, I'm having a really hard time understanding how this can happen.

In one build I noticed something else rather odd: the debug output of /usr/local/bin/yarn --version was inconsistent and printed 1.18.0 instead of 1.22.19. In all other builds however, they all report the same version (1.22.19).

So my best guess is we're experiencing some sort of very specific setup race condition or so, although I can't say what is causing this. I'm open for any suggestions how to further debug/resolve this.

Action version:
v3, last occurred with 'actions/setup-node@v3' (SHA:1a4442cacd436585916779262731d5b162bc6ec7)

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:
ubuntu-latest Runners (Ubuntu 22.04.3)
node: v20.9.0
npm: 10.1.0
yarn: 1.22.19

Repro steps:
Unfortunately the repos where this happens are private, but I have caught one instance with ACTIONS_RUNNER_DEBUG: true and ACTIONS_STEP_DEBUG: true set in this workflow:

ci-build.yaml

name: CI Build
on:
  pull_request:
  push:
    branches: [ master, hotfix/* ]
permissions:
  id-token: write
  checks: write
  packages: write
  actions: read
  contents: write
  issues: read
  pull-requests: write
jobs:
  build-webfrontend:
    runs-on: ubuntu-latest
    env:
      NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: "20"
          cache: 'yarn'
          cache-dependency-path: '**/yarn.lock'
      - run: 'echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc'
      - run: make webfrontend-build
      - uses: actions/upload-artifact@v3
        with:
          name: webfrontend
          path: service/webfrontend/build/

  test-webfrontend:
    runs-on: ubuntu-latest
    env:
      NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: "20"
          cache: 'yarn'
          cache-dependency-path: '**/yarn.lock'
      - run: 'echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc'
      - run: make webfrontend-test
      - name: Upload Test Results (webfrontend)
        if: always()
        uses: actions/upload-artifact@v3
        with:
          name: webfrontend-test-results
          path: "**/webfrontend/junit.xml"

# ... more similar jobs ...

Now here are the logs of test-webfrontend/1_Set up job:

Set up job

2023-11-07T11:43:40.6576920Z ##[debug]Starting: Set up job
2023-11-07T11:43:40.6577618Z Current runner version: '2.311.0'
2023-11-07T11:43:40.6604334Z ##[group]Operating System
2023-11-07T11:43:40.6605198Z Ubuntu
2023-11-07T11:43:40.6605625Z 22.04.3
2023-11-07T11:43:40.6605972Z LTS
2023-11-07T11:43:40.6606452Z ##[endgroup]
2023-11-07T11:43:40.6606940Z ##[group]Runner Image
2023-11-07T11:43:40.6607522Z Image: ubuntu-22.04
2023-11-07T11:43:40.6607968Z Version: 20231030.2.0
2023-11-07T11:43:40.6609082Z Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20231030.2/images/linux/Ubuntu2204-Readme.md
2023-11-07T11:43:40.6610724Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20231030.2
2023-11-07T11:43:40.6611700Z ##[endgroup]
2023-11-07T11:43:40.6612134Z ##[group]Runner Image Provisioner
2023-11-07T11:43:40.6612770Z 2.0.312.1
2023-11-07T11:43:40.6613356Z ##[endgroup]
2023-11-07T11:43:40.6615214Z ##[group]GITHUB_TOKEN Permissions
2023-11-07T11:43:40.6617302Z Actions: read
2023-11-07T11:43:40.6618244Z Checks: write
2023-11-07T11:43:40.6618711Z Contents: write
2023-11-07T11:43:40.6619162Z Issues: read
2023-11-07T11:43:40.6619619Z Metadata: read
2023-11-07T11:43:40.6620080Z Packages: write
2023-11-07T11:43:40.6620542Z PullRequests: write
2023-11-07T11:43:40.6621114Z ##[endgroup]
2023-11-07T11:43:40.6624984Z Secret source: Actions
2023-11-07T11:43:40.6625846Z ##[debug]Primary repository: private-organization/private-repository
2023-11-07T11:43:40.6626776Z Prepare workflow directory
2023-11-07T11:43:40.6708257Z ##[debug]Creating pipeline directory: '/home/runner/work/private-repository'
2023-11-07T11:43:40.6711979Z ##[debug]Creating workspace directory: '/home/runner/work/private-repository/private-repository'
2023-11-07T11:43:40.6713709Z ##[debug]Update context data
2023-11-07T11:43:40.6718099Z ##[debug]Evaluating job-level environment variables
2023-11-07T11:43:40.7566438Z ##[debug]Evaluating: secrets.NPM_TOKEN
2023-11-07T11:43:40.7573351Z ##[debug]Evaluating Index:
2023-11-07T11:43:40.7576250Z ##[debug]..Evaluating secrets:
2023-11-07T11:43:40.7594028Z ##[debug]..=> Object
2023-11-07T11:43:40.7611594Z ##[debug]..Evaluating String:
2023-11-07T11:43:40.7612720Z ##[debug]..=> 'NPM_TOKEN'
2023-11-07T11:43:40.7618196Z ##[debug]=> '***'
2023-11-07T11:43:40.7621875Z ##[debug]Result: '***'
2023-11-07T11:43:40.7661192Z ##[debug]Evaluating job container
2023-11-07T11:43:40.7664907Z ##[debug]Evaluating job service containers
2023-11-07T11:43:40.7667700Z ##[debug]Evaluating job defaults
2023-11-07T11:43:40.7752512Z Prepare all required actions
2023-11-07T11:43:40.7948837Z Getting action download info
2023-11-07T11:43:41.0202459Z Download action repository 'actions/checkout@v3' (SHA:f43a0e5ff2bd294095638e18286ca9a3d1956744)
2023-11-07T11:43:41.0243083Z ##[debug]Copied action archive '/opt/actionarchivecache/actions_checkout/f43a0e5ff2bd294095638e18286ca9a3d1956744.tar.gz' to '/home/runner/work/_actions/_temp_0e99b505-3a68-41aa-8544-79b62067eff2/3bf1eaf3-b702-48da-8d52-275824b40cff.tar.gz'
2023-11-07T11:43:41.1304104Z ##[debug]Unwrap 'actions-checkout-f43a0e5' to '/home/runner/work/_actions/actions/checkout/v3'
2023-11-07T11:43:41.1435608Z ##[debug]Archive '/home/runner/work/_actions/_temp_0e99b505-3a68-41aa-8544-79b62067eff2/3bf1eaf3-b702-48da-8d52-275824b40cff.tar.gz' has been unzipped into '/home/runner/work/_actions/actions/checkout/v3'.
2023-11-07T11:43:41.1573944Z Download action repository 'actions/setup-node@v3' (SHA:1a4442cacd436585916779262731d5b162bc6ec7)
2023-11-07T11:43:41.1630975Z ##[debug]Copied action archive '/opt/actionarchivecache/actions_setup-node/1a4442cacd436585916779262731d5b162bc6ec7.tar.gz' to '/home/runner/work/_actions/_temp_c2d9dfeb-a5e9-4924-a65a-e361b3a4eb5c/f35200d1-4ba3-4ed4-ad00-39a880065f65.tar.gz'
2023-11-07T11:43:41.2341599Z ##[debug]Unwrap 'actions-setup-node-1a4442c' to '/home/runner/work/_actions/actions/setup-node/v3'
2023-11-07T11:43:41.2612360Z ##[debug]Archive '/home/runner/work/_actions/_temp_c2d9dfeb-a5e9-4924-a65a-e361b3a4eb5c/f35200d1-4ba3-4ed4-ad00-39a880065f65.tar.gz' has been unzipped into '/home/runner/work/_actions/actions/setup-node/v3'.
2023-11-07T11:43:41.2671419Z Download action repository 'actions/upload-artifact@v3' (SHA:a8a3f3ad30e3422c9c7b888a15615d19a852ae32)
2023-11-07T11:43:41.2694520Z ##[debug]Copied action archive '/opt/actionarchivecache/actions_upload-artifact/a8a3f3ad30e3422c9c7b888a15615d19a852ae32.tar.gz' to '/home/runner/work/_actions/_temp_5214a219-533e-4554-86dd-aec804f36c73/9148a6d1-c4a3-4e79-97b9-53a6ce55d3e9.tar.gz'
2023-11-07T11:43:41.2994867Z ##[debug]Unwrap 'actions-upload-artifact-a8a3f3a' to '/home/runner/work/_actions/actions/upload-artifact/v3'
2023-11-07T11:43:41.3051804Z ##[debug]Archive '/home/runner/work/_actions/_temp_5214a219-533e-4554-86dd-aec804f36c73/9148a6d1-c4a3-4e79-97b9-53a6ce55d3e9.tar.gz' has been unzipped into '/home/runner/work/_actions/actions/upload-artifact/v3'.
2023-11-07T11:43:41.3123417Z ##[debug]action.yml for action: '/home/runner/work/_actions/actions/checkout/v3/action.yml'.
2023-11-07T11:43:41.3958299Z ##[debug]action.yml for action: '/home/runner/work/_actions/actions/setup-node/v3/action.yml'.
2023-11-07T11:43:41.4026327Z ##[debug]action.yml for action: '/home/runner/work/_actions/actions/upload-artifact/v3/action.yml'.
2023-11-07T11:43:41.4126261Z ##[debug]Set step '__actions_checkout' display name to: 'Run actions/checkout@v3'
2023-11-07T11:43:41.4128906Z ##[debug]Set step '__actions_setup-node' display name to: 'Run actions/setup-node@v3'
2023-11-07T11:43:41.4132867Z ##[debug]Set step '__run' display name to: 'Run echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc'
2023-11-07T11:43:41.4134920Z ##[debug]Set step '__run_2' display name to: 'Run make webfrontend-test'
2023-11-07T11:43:41.4136977Z ##[debug]Set step '__actions_upload-artifact' display name to: 'Upload Test Results (webfrontend)'
2023-11-07T11:43:41.4138479Z Complete job name: test-webfrontend
2023-11-07T11:43:41.4161142Z ##[debug]Collect running processes for tracking orphan processes.
2023-11-07T11:43:41.4384275Z ##[debug]Finishing: Set up job

And then it fails in test-webfrontend/3_Run actionssetup-node@v3:

Run actionssetup-node@v3 with error

2023-11-07T11:43:42.9003997Z ##[debug]Evaluating condition for step: 'Run actions/setup-node@v3'
2023-11-07T11:43:42.9007657Z ##[debug]Evaluating: success()
2023-11-07T11:43:42.9008259Z ##[debug]Evaluating success:
2023-11-07T11:43:42.9008972Z ##[debug]=> true
2023-11-07T11:43:42.9009656Z ##[debug]Result: true
2023-11-07T11:43:42.9010574Z ##[debug]Starting: Run actions/setup-node@v3
2023-11-07T11:43:42.9038655Z ##[debug]Register post job cleanup for action: actions/setup-node@v3
2023-11-07T11:43:42.9056589Z ##[debug]Loading inputs
2023-11-07T11:43:42.9076162Z ##[debug]Evaluating: (((github.server_url == 'https://github.com') && github.token) || '')
2023-11-07T11:43:42.9077055Z ##[debug]Evaluating Or:
2023-11-07T11:43:42.9081498Z ##[debug]..Evaluating And:
2023-11-07T11:43:42.9086163Z ##[debug]....Evaluating Equal:
2023-11-07T11:43:42.9087682Z ##[debug]......Evaluating Index:
2023-11-07T11:43:42.9088171Z ##[debug]........Evaluating github:
2023-11-07T11:43:42.9088699Z ##[debug]........=> Object
2023-11-07T11:43:42.9089123Z ##[debug]........Evaluating String:
2023-11-07T11:43:42.9089663Z ##[debug]........=> 'server_url'
2023-11-07T11:43:42.9090492Z ##[debug]......=> 'https://github.com'
2023-11-07T11:43:42.9091013Z ##[debug]......Evaluating String:
2023-11-07T11:43:42.9091487Z ##[debug]......=> 'https://github.com'
2023-11-07T11:43:42.9096001Z ##[debug]....=> true
2023-11-07T11:43:42.9096655Z ##[debug]....Evaluating Index:
2023-11-07T11:43:42.9097109Z ##[debug]......Evaluating github:
2023-11-07T11:43:42.9097593Z ##[debug]......=> Object
2023-11-07T11:43:42.9098015Z ##[debug]......Evaluating String:
2023-11-07T11:43:42.9098465Z ##[debug]......=> 'token'
2023-11-07T11:43:42.9099241Z ##[debug]....=> '***'
2023-11-07T11:43:42.9099841Z ##[debug]..=> '***'
2023-11-07T11:43:42.9100576Z ##[debug]=> '***'
2023-11-07T11:43:42.9106924Z ##[debug]Expanded: ((('https://github.com' == 'https://github.com') && '***') || '')
2023-11-07T11:43:42.9107920Z ##[debug]Result: '***'
2023-11-07T11:43:42.9109579Z ##[debug]Loading env
2023-11-07T11:43:42.9117043Z ##[group]Run actions/setup-node@v3
2023-11-07T11:43:42.9117502Z with:
2023-11-07T11:43:42.9117814Z   node-version: 20
2023-11-07T11:43:42.9118138Z   cache: yarn
2023-11-07T11:43:42.9118500Z   cache-dependency-path: **/yarn.lock
2023-11-07T11:43:42.9118975Z   always-auth: false
2023-11-07T11:43:42.9119340Z   check-latest: false
2023-11-07T11:43:42.9119882Z   token: ***
2023-11-07T11:43:42.9120189Z env:
2023-11-07T11:43:42.9120593Z   NPM_TOKEN: ***
2023-11-07T11:43:42.9120922Z ##[endgroup]
2023-11-07T11:43:43.1658305Z ##[debug]isExplicit: 
2023-11-07T11:43:43.1665777Z ##[debug]explicit? false
2023-11-07T11:43:43.1674294Z ##[debug]isExplicit: 14.21.3
2023-11-07T11:43:43.1676393Z ##[debug]explicit? true
2023-11-07T11:43:43.1679713Z ##[debug]isExplicit: 16.20.2
2023-11-07T11:43:43.1681858Z ##[debug]explicit? true
2023-11-07T11:43:43.1684360Z ##[debug]isExplicit: 18.18.2
2023-11-07T11:43:43.1686446Z ##[debug]explicit? true
2023-11-07T11:43:43.1688911Z ##[debug]isExplicit: 20.9.0
2023-11-07T11:43:43.1692079Z ##[debug]explicit? true
2023-11-07T11:43:43.1695703Z ##[debug]evaluating 4 versions
2023-11-07T11:43:43.1723570Z ##[debug]matched: 20.9.0
2023-11-07T11:43:43.1732932Z ##[debug]checking cache: /opt/hostedtoolcache/node/20.9.0/x64
2023-11-07T11:43:43.1734359Z ##[debug]Found tool in cache node 20.9.0 x64
2023-11-07T11:43:43.1737408Z Found in cache @ /opt/hostedtoolcache/node/20.9.0/x64
2023-11-07T11:43:43.1739590Z ::group::Environment details
2023-11-07T11:43:43.1740033Z ##[group]Environment details
2023-11-07T11:43:43.8937028Z node: v20.9.0
2023-11-07T11:43:43.8938129Z npm: 10.1.0
2023-11-07T11:43:43.8938517Z yarn: 1.22.19
2023-11-07T11:43:43.8939300Z ::endgroup::
2023-11-07T11:43:43.8939631Z ##[endgroup]
2023-11-07T11:43:43.8951679Z ##[debug]followSymbolicLinks 'true'
2023-11-07T11:43:43.8952673Z ##[debug]implicitDescendants 'true'
2023-11-07T11:43:43.8955271Z ##[debug]matchDirectories 'true'
2023-11-07T11:43:43.8956047Z ##[debug]omitBrokenSymbolicLinks 'true'
2023-11-07T11:43:43.8965082Z ##[debug]Search path '/home/runner/work/private-repository/private-repository'
2023-11-07T11:43:44.0603605Z [command]/usr/local/bin/yarn --version
2023-11-07T11:43:44.0604864Z [command]/usr/local/bin/yarn --version
2023-11-07T11:43:44.0606342Z [command]/usr/local/bin/yarn --version
2023-11-07T11:43:44.0607731Z [command]/usr/local/bin/yarn --version
2023-11-07T11:43:44.0608579Z [command]/usr/local/bin/yarn --version
2023-11-07T11:43:44.0609449Z [command]/usr/local/bin/yarn --version
2023-11-07T11:43:44.4698330Z 1.22.19
2023-11-07T11:43:44.5425956Z ##[debug]Consumed yarn version is 1.22.19 (working dir: "/home/runner/work/private-repository/private-repository/service/microfrontend")
2023-11-07T11:43:44.5436488Z [command]/usr/local/bin/yarn cache dir
2023-11-07T11:43:44.6228683Z 1.22.19
2023-11-07T11:43:44.6647428Z ##[debug]Consumed yarn version is 1.22.19 (working dir: "/home/runner/work/private-repository/private-repository/service")
2023-11-07T11:43:44.6658255Z [command]/usr/local/bin/yarn cache dir
2023-11-07T11:43:44.6822781Z 1.22.19
2023-11-07T11:43:44.6823634Z 1.22.19
2023-11-07T11:43:44.6937502Z ##[debug]Consumed yarn version is 1.22.19 (working dir: "/home/runner/work/private-repository/private-repository/service/library-utils")
2023-11-07T11:43:44.6973852Z [command]/usr/local/bin/yarn cache dir
2023-11-07T11:43:44.7065675Z 1.22.19
2023-11-07T11:43:44.7066390Z 1.22.19
2023-11-07T11:43:44.7201400Z ##[debug]Consumed yarn version is 1.22.19 (working dir: "/home/runner/work/private-repository/private-repository/service/library")
2023-11-07T11:43:44.7218325Z [command]/usr/local/bin/yarn cache dir
2023-11-07T11:43:44.7427305Z ##[debug]Consumed yarn version is 1.22.19 (working dir: "/home/runner/work/private-repository/private-repository/service/webfrontend")
2023-11-07T11:43:44.7442250Z [command]/usr/local/bin/yarn cache dir
2023-11-07T11:43:44.7518826Z ##[debug]Consumed yarn version is 1.22.19 (working dir: "/home/runner/work/private-repository/private-repository/service/microfrontend-wrapper")
2023-11-07T11:43:44.7526882Z [command]/usr/local/bin/yarn cache dir
2023-11-07T11:43:45.5178973Z /home/runner/.cache/yarn/v6
2023-11-07T11:43:45.5701292Z ##[debug]yarn's cache folder "/home/runner/.cache/yarn/v6" configured for the directory "/home/runner/work/private-repository/private-repository/service/library-utils"
2023-11-07T11:43:45.6308358Z /home/runner/.cache/yarn/v6
2023-11-07T11:43:45.6917922Z ##[debug]yarn's cache folder "/home/runner/.cache/yarn/v6" configured for the directory "/home/runner/work/private-repository/private-repository/service/webfrontend"
2023-11-07T11:43:45.7178811Z /home/runner/.cache/yarn/v6
2023-11-07T11:43:45.7500285Z ##[debug]yarn's cache folder "/home/runner/.cache/yarn/v6" configured for the directory "/home/runner/work/private-repository/private-repository/service"
2023-11-07T11:43:45.7822267Z /home/runner/.cache/yarn/v6
2023-11-07T11:43:45.8324690Z ##[debug]yarn's cache folder "/home/runner/.cache/yarn/v6" configured for the directory "/home/runner/work/private-repository/private-repository/service/library"
2023-11-07T11:43:45.8961896Z /home/runner/.cache/yarn/v6
2023-11-07T11:43:45.9307755Z ##[debug]yarn's cache folder "/home/runner/.cache/yarn/v6" configured for the directory "/home/runner/work/private-repository/private-repository/service/microfrontend-wrapper"
2023-11-07T11:43:47.0912218Z ##[error]Could not get yarn cache folder path for /home/runner/work/private-repository/private-repository/service/microfrontend
2023-11-07T11:43:47.0985552Z ##[debug]Node Action run completed with exit code 1
2023-11-07T11:43:47.0990738Z ##[debug]Save intra-action state SETUP_NODE_CACHE_PACKAGE_MANAGER = yarn
2023-11-07T11:43:47.0993089Z ##[debug]Set output node-version = v20.9.0
2023-11-07T11:43:47.0996878Z ##[debug]Finishing: Run actions/setup-node@v3

Compare this to the start of build-webfrontend/3_Run actionssetup-node@v3 where the very same command works just fine:

Run actionssetup-node@v3 without error

2023-11-07T11:43:42.5045134Z ##[debug]Evaluating condition for step: 'Run actions/setup-node@v3'
2023-11-07T11:43:42.5048077Z ##[debug]Evaluating: success()
2023-11-07T11:43:42.5048672Z ##[debug]Evaluating success:
2023-11-07T11:43:42.5049377Z ##[debug]=> true
2023-11-07T11:43:42.5050034Z ##[debug]Result: true
2023-11-07T11:43:42.5050928Z ##[debug]Starting: Run actions/setup-node@v3
2023-11-07T11:43:42.5081732Z ##[debug]Register post job cleanup for action: actions/setup-node@v3
2023-11-07T11:43:42.5101416Z ##[debug]Loading inputs
2023-11-07T11:43:42.5122474Z ##[debug]Evaluating: (((github.server_url == 'https://github.com') && github.token) || '')
2023-11-07T11:43:42.5123431Z ##[debug]Evaluating Or:
2023-11-07T11:43:42.5127668Z ##[debug]..Evaluating And:
2023-11-07T11:43:42.5133686Z ##[debug]....Evaluating Equal:
2023-11-07T11:43:42.5135490Z ##[debug]......Evaluating Index:
2023-11-07T11:43:42.5136070Z ##[debug]........Evaluating github:
2023-11-07T11:43:42.5136687Z ##[debug]........=> Object
2023-11-07T11:43:42.5137202Z ##[debug]........Evaluating String:
2023-11-07T11:43:42.5137841Z ##[debug]........=> 'server_url'
2023-11-07T11:43:42.5138743Z ##[debug]......=> 'https://github.com'
2023-11-07T11:43:42.5139381Z ##[debug]......Evaluating String:
2023-11-07T11:43:42.5139947Z ##[debug]......=> 'https://github.com'
2023-11-07T11:43:42.5144728Z ##[debug]....=> true
2023-11-07T11:43:42.5145412Z ##[debug]....Evaluating Index:
2023-11-07T11:43:42.5145932Z ##[debug]......Evaluating github:
2023-11-07T11:43:42.5146457Z ##[debug]......=> Object
2023-11-07T11:43:42.5146925Z ##[debug]......Evaluating String:
2023-11-07T11:43:42.5147428Z ##[debug]......=> 'token'
2023-11-07T11:43:42.5148875Z ##[debug]....=> '***'
2023-11-07T11:43:42.5149579Z ##[debug]..=> '***'
2023-11-07T11:43:42.5150571Z ##[debug]=> '***'
2023-11-07T11:43:42.5158222Z ##[debug]Expanded: ((('https://github.com' == 'https://github.com') && '***') || '')
2023-11-07T11:43:42.5159447Z ##[debug]Result: '***'
2023-11-07T11:43:42.5161213Z ##[debug]Loading env
2023-11-07T11:43:42.5169326Z ##[group]Run actions/setup-node@v3
2023-11-07T11:43:42.5169758Z with:
2023-11-07T11:43:42.5170057Z   node-version: 20
2023-11-07T11:43:42.5170392Z   cache: yarn
2023-11-07T11:43:42.5170899Z   cache-dependency-path: **/yarn.lock
2023-11-07T11:43:42.5171427Z   always-auth: false
2023-11-07T11:43:42.5171834Z   check-latest: false
2023-11-07T11:43:42.5172389Z   token: ***
2023-11-07T11:43:42.5172700Z env:
2023-11-07T11:43:42.5173132Z   NPM_TOKEN: ***
2023-11-07T11:43:42.5173496Z ##[endgroup]
2023-11-07T11:43:42.8325370Z ##[debug]isExplicit: 
2023-11-07T11:43:42.8397876Z ##[debug]explicit? false
2023-11-07T11:43:42.8400290Z ##[debug]isExplicit: 14.21.3
2023-11-07T11:43:42.8402350Z ##[debug]explicit? true
2023-11-07T11:43:42.8404354Z ##[debug]isExplicit: 16.20.2
2023-11-07T11:43:42.8436608Z ##[debug]explicit? true
2023-11-07T11:43:42.8437562Z ##[debug]isExplicit: 18.18.2
2023-11-07T11:43:42.8438358Z ##[debug]explicit? true
2023-11-07T11:43:42.8439105Z ##[debug]isExplicit: 20.9.0
2023-11-07T11:43:42.8439878Z ##[debug]explicit? true
2023-11-07T11:43:42.8440653Z ##[debug]evaluating 4 versions
2023-11-07T11:43:42.8441572Z ##[debug]matched: 20.9.0
2023-11-07T11:43:42.8442433Z ##[debug]checking cache: /opt/hostedtoolcache/node/20.9.0/x64
2023-11-07T11:43:42.8443450Z ##[debug]Found tool in cache node 20.9.0 x64
2023-11-07T11:43:42.8444153Z Found in cache @ /opt/hostedtoolcache/node/20.9.0/x64
2023-11-07T11:43:42.8445105Z ::group::Environment details
2023-11-07T11:43:42.8445572Z ##[group]Environment details
2023-11-07T11:43:46.3695280Z node: v20.9.0
2023-11-07T11:43:46.3696376Z npm: 10.1.0
2023-11-07T11:43:46.3697531Z yarn: 1.22.19
2023-11-07T11:43:46.3698630Z ::endgroup::
2023-11-07T11:43:46.3699043Z ##[endgroup]
2023-11-07T11:43:46.3741355Z ##[debug]followSymbolicLinks 'true'
2023-11-07T11:43:46.3743128Z ##[debug]implicitDescendants 'true'
2023-11-07T11:43:46.3744458Z ##[debug]matchDirectories 'true'
2023-11-07T11:43:46.3746228Z ##[debug]omitBrokenSymbolicLinks 'true'
2023-11-07T11:43:46.3757885Z ##[debug]Search path '/home/runner/work/private-repository/private-repository'
2023-11-07T11:43:46.5754300Z [command]/usr/local/bin/yarn --version
2023-11-07T11:43:46.5760862Z [command]/usr/local/bin/yarn --version
2023-11-07T11:43:46.5764553Z [command]/usr/local/bin/yarn --version
2023-11-07T11:43:46.5767907Z [command]/usr/local/bin/yarn --version
2023-11-07T11:43:46.5771188Z [command]/usr/local/bin/yarn --version
2023-11-07T11:43:46.5774583Z [command]/usr/local/bin/yarn --version
2023-11-07T11:43:47.1231648Z 1.22.19
2023-11-07T11:43:47.1746162Z 1.22.19
2023-11-07T11:43:47.1799246Z ##[debug]Consumed yarn version is 1.22.19 (working dir: "/home/runner/work/private-repository/private-repository/service/microfrontend")
2023-11-07T11:43:47.1814683Z [command]/usr/local/bin/yarn cache dir
2023-11-07T11:43:47.1952668Z 1.22.19
2023-11-07T11:43:47.1953522Z 1.22.19
2023-11-07T11:43:47.1954149Z 1.22.19
2023-11-07T11:43:47.2243607Z ##[debug]Consumed yarn version is 1.22.19 (working dir: "/home/runner/work/private-repository/private-repository/service/microfrontend-wrapper")
2023-11-07T11:43:47.2267594Z [command]/usr/local/bin/yarn cache dir
2023-11-07T11:43:47.2577740Z ##[debug]Consumed yarn version is 1.22.19 (working dir: "/home/runner/work/private-repository/private-repository/service/webfrontend")
2023-11-07T11:43:47.2580755Z ##[debug]Consumed yarn version is 1.22.19 (working dir: "/home/runner/work/private-repository/private-repository/service/library")
2023-11-07T11:43:47.2583460Z ##[debug]Consumed yarn version is 1.22.19 (working dir: "/home/runner/work/private-repository/private-repository/service/library-utils")
2023-11-07T11:43:47.2614624Z [command]/usr/local/bin/yarn cache dir
2023-11-07T11:43:47.2619847Z [command]/usr/local/bin/yarn cache dir
2023-11-07T11:43:47.2624789Z [command]/usr/local/bin/yarn cache dir
2023-11-07T11:43:47.2910735Z 1.22.19
2023-11-07T11:43:47.3200340Z ##[debug]Consumed yarn version is 1.22.19 (working dir: "/home/runner/work/private-repository/private-repository/service")
2023-11-07T11:43:47.3215325Z [command]/usr/local/bin/yarn cache dir
2023-11-07T11:43:47.9026477Z /home/runner/.cache/yarn/v6
2023-11-07T11:43:47.9790941Z ##[debug]yarn's cache folder "/home/runner/.cache/yarn/v6" configured for the directory "/home/runner/work/private-repository/private-repository/service/microfrontend"
2023-11-07T11:43:48.0026024Z /home/runner/.cache/yarn/v6
2023-11-07T11:43:48.0425940Z ##[debug]yarn's cache folder "/home/runner/.cache/yarn/v6" configured for the directory "/home/runner/work/private-repository/private-repository/service"
2023-11-07T11:43:48.0831076Z /home/runner/.cache/yarn/v6
2023-11-07T11:43:48.1041621Z /home/runner/.cache/yarn/v6
2023-11-07T11:43:48.1261033Z ##[debug]yarn's cache folder "/home/runner/.cache/yarn/v6" configured for the directory "/home/runner/work/private-repository/private-repository/service/webfrontend"
2023-11-07T11:43:48.1311110Z /home/runner/.cache/yarn/v6
2023-11-07T11:43:48.1415387Z /home/runner/.cache/yarn/v6
2023-11-07T11:43:48.1550742Z ##[debug]yarn's cache folder "/home/runner/.cache/yarn/v6" configured for the directory "/home/runner/work/private-repository/private-repository/service/library"
2023-11-07T11:43:48.1699081Z ##[debug]yarn's cache folder "/home/runner/.cache/yarn/v6" configured for the directory "/home/runner/work/private-repository/private-repository/service/microfrontend-wrapper"
2023-11-07T11:43:48.1824172Z ##[debug]yarn's cache folder "/home/runner/.cache/yarn/v6" configured for the directory "/home/runner/work/private-repository/private-repository/service/library-utils"
2023-11-07T11:43:48.1827292Z ##[debug]followSymbolicLinks 'true'
2023-11-07T11:43:48.1839324Z ##[debug]followSymbolicLinks 'true'
2023-11-07T11:43:48.1840591Z ##[debug]implicitDescendants 'true'
2023-11-07T11:43:48.1841831Z ##[debug]matchDirectories 'true'
2023-11-07T11:43:48.1843937Z ##[debug]omitBrokenSymbolicLinks 'true'
2023-11-07T11:43:48.1864822Z ##[debug]Search path '/home/runner/work/private-repository/private-repository'
2023-11-07T11:43:48.2190989Z ##[debug]/home/runner/work/private-repository/private-repository/service/library/yarn.lock
2023-11-07T11:43:48.2356218Z ##[debug]/home/runner/work/private-repository/private-repository/service/library-utils/yarn.lock
2023-11-07T11:43:48.2700733Z ##[debug]/home/runner/work/private-repository/private-repository/service/microfrontend/yarn.lock
2023-11-07T11:43:48.2753487Z ##[debug]/home/runner/work/private-repository/private-repository/service/microfrontend-wrapper/yarn.lock
2023-11-07T11:43:48.3601324Z ##[debug]/home/runner/work/private-repository/private-repository/service/webfrontend/yarn.lock
2023-11-07T11:43:48.3638358Z ##[debug]/home/runner/work/private-repository/private-repository/service/yarn.lock
2023-11-07T11:43:48.3645588Z ##[debug]Found 6 files to hash.
--- snip ---

Expected behavior:
Action completes setting up the cache and not failing the build.

Actual behavior:
Action nondeterministically fails the build due to the issue described.

@xcq1 xcq1 added bug Something isn't working needs triage labels Nov 7, 2023
@nikolai-laevskii
Copy link
Contributor

Thank you for the detailed issue description! We will investigate the problem and come back to you with the details.

@arlendarcy
Copy link

For posterity, have been experiencing the sporadic issue as well. Started noticing it after an upgrade to node 20. I then updated the setup-node action to v4 as I saw the runtime of that action was node-20. The upgrade to v4 reduced the amount of times we see the error but it still happens, just less than on v3.

@ildella
Copy link

ildella commented Dec 31, 2023

yarn cache apparently not working for the same Ubuntu / hosted setup with node 20 and actions v4

Configuration:

- uses: actions/setup-node@v4
  with:
    node-version: ${{ matrix.node-version }}
    cache: 'yarn'

Log:

actions/setup-node@v4

node: v20.10.0
npm: 10.2.3
yarn: 4.0.2

/usr/local/bin/yarn --version
4.0.2
/usr/local/bin/yarn config get cacheFolder
/home/runner/.yarn/berry/cache
/usr/local/bin/yarn config get enableGlobalCache
true
yarn cache is not found

@frederic-saunier
Copy link

I can notice the same sporadic problem since a recent update to Node 20 + actions/setup-node@v4.

@xcq1 Do you have found any way to bypass the problem since the creation of the report?

@pbrisbin
Copy link

pbrisbin commented Feb 22, 2024

We're running into this issue consistently since a few days ago. Here is the Runner info:

Operating System
  Ubuntu
  22.04.4
  LTS
Runner Image
  Image: ubuntu-22.04
  Version: 20240218.1.0
  Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20240218.1/images/ubuntu/Ubuntu2204-Readme.md
  Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20240218.1

Our config:

  with:
    node-version-file: frontend/educator/.nvmrc
    cache: yarn
    cache-dependency-path: frontend/educator/**/yarn.lock
    always-auth: false
    check-latest: false
    token: ***
And the full logs of the error
Node version file is not JSON file
Resolved frontend/educator/.nvmrc as 20.11.0
Attempting to download 20.11.0...
Acquiring 20.11.0 - x64 from https://github.com/actions/node-versions/releases/download/20.11.0-7531642937/node-20.11.0-linux-x64.tar.gz
Extracting ...
/usr/bin/tar xz --strip 1 --warning=no-unknown-keyword --overwrite -C /home/runner/work/_temp/60ba62af-c4da-4b28-99c2-2bb8e026f756 -f /home/runner/work/_temp/20446054-63e0-4bae-b004-d1b194ed7439
Adding to the cache ...
Environment details
/usr/local/bin/yarn --version
/usr/local/bin/yarn --version
/usr/local/bin/yarn --version
/usr/local/bin/yarn --version
/usr/local/bin/yarn --version
/usr/local/bin/yarn --version
/usr/local/bin/yarn --version
3.2.3
/usr/local/bin/yarn config get cacheFolder
3.2.3
3.2.3
3.2.3
3.2.3
/usr/local/bin/yarn config get cacheFolder
3.2.3
/usr/local/bin/yarn config get cacheFolder
/usr/local/bin/yarn config get cacheFolder
3.2.3
/usr/local/bin/yarn config get cacheFolder
/usr/local/bin/yarn config get cacheFolder
/usr/local/bin/yarn config get cacheFolder


#
# Fatal error in , line 0
# unreachable code
#
#
#
#FailureMessage Object: 0x7ffd5a1dd080
----- Native stack trace -----

 1: 0xd20211  [node]
 2: 0x2118e21 V8_Fatal(char const*, ...) [node]
 3: 0x1542284 int v8::internal::Deserializer<v8::internal::Isolate>::ReadSingleBytecodeData<v8::internal::SlotAccessorForHandle<v8::internal::Isolate> >(unsigned char, v8::internal::SlotAccessorForHandle<v8::internal::Isolate>) [node]
 4: 0x154247f v8::internal::Deserializer<v8::internal::Isolate>::ReadObject() [node]
 5: 0x15417c6 v8::internal::Deserializer<v8::internal::Isolate>::ReadObject(v8::internal::SnapshotSpace) [node]
 6: 0x1541b79 int v8::internal::Deserializer<v8::internal::Isolate>::ReadSingleBytecodeData<v8::internal::SlotAccessorForHandle<v8::internal::Isolate> >(unsigned char, v8::internal::SlotAccessorForHandle<v8::internal::Isolate>) [node]
 7: 0x154247f v8::internal::Deserializer<v8::internal::Isolate>::ReadObject() [node]
 8: 0x15417c6 v8::internal::Deserializer<v8::internal::Isolate>::ReadObject(v8::internal::SnapshotSpace) [node]
 9: 0x1541b79 int v8::internal::Deserializer<v8::internal::Isolate>::ReadSingleBytecodeData<v8::internal::SlotAccessorForHandle<v8::internal::Isolate> >(unsigned char, v8::internal::SlotAccessorForHandle<v8::internal::Isolate>) [node]
10: 0x154247f v8::internal::Deserializer<v8::internal::Isolate>::ReadObject() [node]
11: 0x15417c6 v8::internal::Deserializer<v8::internal::Isolate>::ReadObject(v8::internal::SnapshotSpace) [node]
12: 0x1541b79 int v8::internal::Deserializer<v8::internal::Isolate>::ReadSingleBytecodeData<v8::internal::SlotAccessorForHandle<v8::internal::Isolate> >(unsigned char, v8::internal::SlotAccessorForHandle<v8::internal::Isolate>) [node]
13: 0x154247f v8::internal::Deserializer<v8::internal::Isolate>::ReadObject() [node]
14: 0x15417c6 v8::internal::Deserializer<v8::internal::Isolate>::ReadObject(v8::internal::SnapshotSpace) [node]
15: 0x1541b79 int v8::internal::Deserializer<v8::internal::Isolate>::ReadSingleBytecodeData<v8::internal::SlotAccessorForHandle<v8::internal::Isolate> >(unsigned char, v8::internal::SlotAccessorForHandle<v8::internal::Isolate>) [node]
16: 0x154247f v8::internal::Deserializer<v8::internal::Isolate>::ReadObject() [node]
17: 0x15417c6 v8::internal::Deserializer<v8::internal::Isolate>::ReadObject(v8::internal::SnapshotSpace) [node]
18: 0x1541b79 int v8::internal::Deserializer<v8::internal::Isolate>::ReadSingleBytecodeData<v8::internal::SlotAccessorForHandle<v8::internal::Isolate> >(unsigned char, v8::internal::SlotAccessorForHandle<v8::internal::Isolate>) [node]
19: 0x154247f v8::internal::Deserializer<v8::internal::Isolate>::ReadObject() [node]
20: 0x15417c6 v8::internal::Deserializer<v8::internal::Isolate>::ReadObject(v8::internal::SnapshotSpace) [node]
21: 0x1541b79 int v8::internal::Deserializer<v8::internal::Isolate>::ReadSingleBytecodeData<v8::internal::SlotAccessorForHandle<v8::internal::Isolate> >(unsigned char, v8::internal::SlotAccessorForHandle<v8::internal::Isolate>) [node]
22: 0x154247f v8::internal::Deserializer<v8::internal::Isolate>::ReadObject() [node]
23: 0x15417c6 v8::internal::Deserializer<v8::internal::Isolate>::ReadObject(v8::internal::SnapshotSpace) [node]
24: 0x1541b79 int v8::internal::Deserializer<v8::internal::Isolate>::ReadSingleBytecodeData<v8::internal::SlotAccessorForHandle<v8::internal::Isolate> >(unsigned char, v8::internal::SlotAccessorForHandle<v8::internal::Isolate>) [node]
25: 0x154247f v8::internal::Deserializer<v8::internal::Isolate>::ReadObject() [node]
26: 0x15417c6 v8::internal::Deserializer<v8::internal::Isolate>::ReadObject(v8::internal::SnapshotSpace) [node]
27: 0x1541b79 int v8::internal::Deserializer<v8::internal::Isolate>::ReadSingleBytecodeData<v8::internal::SlotAccessorForHandle<v8::internal::Isolate> >(unsigned char, v8::internal::SlotAccessorForHandle<v8::internal::Isolate>) [node]
28: 0x154247f v8::internal::Deserializer<v8::internal::Isolate>::ReadObject() [node]
29: 0x15417c6 v8::internal::Deserializer<v8::internal::Isolate>::ReadObject(v8::internal::SnapshotSpace) [node]
30: 0x154049b int v8::internal::Deserializer<v8::internal::Isolate>::ReadSingleBytecodeData<v8::internal::SlotAccessorForHeapObject>(unsigned char, v8::internal::SlotAccessorForHeapObject) [node]
31: 0x15415d1 v8::internal::Deserializer<v8::internal::Isolate>::ReadData(v8::internal::Handle<v8::internal::HeapObject>, int, int) [node]
32: 0x1541898 v8::internal::Deserializer<v8::internal::Isolate>::ReadObject(v8::internal::SnapshotSpace) [node]
33: 0x154049b int v8::internal::Deserializer<v8::internal::Isolate>::ReadSingleBytecodeData<v8::internal::SlotAccessorForHeapObject>(unsigned char, v8::internal::SlotAccessorForHeapObject) [node]
34: 0x15415d1 v8::internal::Deserializer<v8::internal::Isolate>::ReadData(v8::internal::Handle<v8::internal::HeapObject>, int, int) [node]
35: 0x1541898 v8::internal::Deserializer<v8::internal::Isolate>::ReadObject(v8::internal::SnapshotSpace) [node]
36: 0x154049b int v8::internal::Deserializer<v8::internal::Isolate>::ReadSingleBytecodeData<v8::internal::SlotAccessorForHeapObject>(unsigned char, v8::internal::SlotAccessorForHeapObject) [node]
37: 0x15415d1 v8::internal::Deserializer<v8::internal::Isolate>::ReadData(v8::internal::Handle<v8::internal::HeapObject>, int, int) [node]
38: 0x1541898 v8::internal::Deserializer<v8::internal::Isolate>::ReadObject(v8::internal::SnapshotSpace) [node]
39: 0x154049b int v8::internal::Deserializer<v8::internal::Isolate>::ReadSingleBytecodeData<v8::internal::SlotAccessorForHeapObject>(unsigned char, v8::internal::SlotAccessorForHeapObject) [node]
40: 0x15415d1 v8::internal::Deserializer<v8::internal::Isolate>::ReadData(v8::internal::Handle<v8::internal::HeapObject>, int, int) [node]
41: 0x1541898 v8::internal::Deserializer<v8::internal::Isolate>::ReadObject(v8::internal::SnapshotSpace) [node]
42: 0x154049b int v8::internal::Deserializer<v8::internal::Isolate>::ReadSingleBytecodeData<v8::internal::SlotAccessorForHeapObject>(unsigned char, v8::internal::SlotAccessorForHeapObject) [node]
43: 0x15415d1 v8::internal::Deserializer<v8::internal::Isolate>::ReadData(v8::internal::Handle<v8::internal::HeapObject>, int, int) [node]
44: 0x1541898 v8::internal::Deserializer<v8::internal::Isolate>::ReadObject(v8::internal::SnapshotSpace) [node]
45: 0x154049b int v8::internal::Deserializer<v8::internal::Isolate>::ReadSingleBytecodeData<v8::internal::SlotAccessorForHeapObject>(unsigned char, v8::internal::SlotAccessorForHeapObject) [node]
46: 0x15415d1 v8::internal::Deserializer<v8::internal::Isolate>::ReadData(v8::internal::Handle<v8::internal::HeapObject>, int, int) [node]
47: 0x1541898 v8::internal::Deserializer<v8::internal::Isolate>::ReadObject(v8::internal::SnapshotSpace) [node]
48: 0x154049b int v8::internal::Deserializer<v8::internal::Isolate>::ReadSingleBytecodeData<v8::internal::SlotAccessorForHeapObject>(unsigned char, v8::internal::SlotAccessorForHeapObject) [node]
49: 0x15415d1 v8::internal::Deserializer<v8::internal::Isolate>::ReadData(v8::internal::Handle<v8::internal::HeapObject>, int, int) [node]
50: 0x1541898 v8::internal::Deserializer<v8::internal::Isolate>::ReadObject(v8::internal::SnapshotSpace) [node]
51: 0x154049b int v8::internal::Deserializer<v8::internal::Isolate>::ReadSingleBytecodeData<v8::internal::SlotAccessorForHeapObject>(unsigned char, v8::internal::SlotAccessorForHeapObject) [node]
52: 0x15415d1 v8::internal::Deserializer<v8::internal::Isolate>::ReadData(v8::internal::Handle<v8::internal::HeapObject>, int, int) [node]
53: 0x1541898 v8::internal::Deserializer<v8::internal::Isolate>::ReadObject(v8::internal::SnapshotSpace) [node]
54: 0x154049b int v8::internal::Deserializer<v8::internal::Isolate>::ReadSingleBytecodeData<v8::internal::SlotAccessorForHeapObject>(unsigned char, v8::internal::SlotAccessorForHeapObject) [node]
55: 0x15415d1 v8::internal::Deserializer<v8::internal::Isolate>::ReadData(v8::internal::Handle<v8::internal::HeapObject>, int, int) [node]
56: 0x1541898 v8::internal::Deserializer<v8::internal::Isolate>::ReadObject(v8::internal::SnapshotSpace) [node]
57: 0x154049b int v8::internal::Deserializer<v8::internal::Isolate>::ReadSingleBytecodeData<v8::internal::SlotAccessorForHeapObject>(unsigned char, v8::internal::SlotAccessorForHeapObject) [node]
58: 0x15415d1 v8::internal::Deserializer<v8::internal::Isolate>::ReadData(v8::internal::Handle<v8::internal::HeapObject>, int, int) [node]
59: 0x1541898 v8::internal::Deserializer<v8::internal::Isolate>::ReadObject(v8::internal::SnapshotSpace) [node]
60: 0x154049b int v8::internal::Deserializer<v8::internal::Isolate>::ReadSingleBytecodeData<v8::internal::SlotAccessorForHeapObject>(unsigned char, v8::internal::SlotAccessorForHeapObject) [node]
61: 0x15415d1 v8::internal::Deserializer<v8::internal::Isolate>::ReadData(v8::internal::Handle<v8::internal::HeapObject>, int, int) [node]
62: 0x1541898 v8::internal::Deserializer<v8::internal::Isolate>::ReadObject(v8::internal::SnapshotSpace) [node]
63: 0x154049b int v8::internal::Deserializer<v8::internal::Isolate>::ReadSingleBytecodeData<v8::internal::SlotAccessorForHeapObject>(unsigned char, v8::internal::SlotAccessorForHeapObject) [node]
64: 0x15415d1 v8::internal::Deserializer<v8::internal::Isolate>::ReadData(v8::internal::Handle<v8::internal::HeapObject>, int, int) [node]
65: 0x1541898 v8::internal::Deserializer<v8::internal::Isolate>::ReadObject(v8::internal::SnapshotSpace) [node]
66: 0x154049b int v8::internal::Deserializer<v8::internal::Isolate>::ReadSingleBytecodeData<v8::internal::SlotAccessorForHeapObject>(unsigned char, v8::internal::SlotAccessorForHeapObject) [node]
67: 0x15415d1 v8::internal::Deserializer<v8::internal::Isolate>::ReadData(v8::internal::Handle<v8::internal::HeapObject>, int, int) [node]
68: 0x1541898 v8::internal::Deserializer<v8::internal::Isolate>::ReadObject(v8::internal::SnapshotSpace) [node]
69: 0x154049b int v8::internal::Deserializer<v8::internal::Isolate>::ReadSingleBytecodeData<v8::internal::SlotAccessorForHeapObject>(unsigned char, v8::internal::SlotAccessorForHeapObject) [node]
70: 0x15415d1 v8::internal::Deserializer<v8::internal::Isolate>::ReadData(v8::internal::Handle<v8::internal::HeapObject>, int, int) [node]
71: 0x1541898 v8::internal::Deserializer<v8::internal::Isolate>::ReadObject(v8::internal::SnapshotSpace) [node]
72: 0x154049b int v8::internal::Deserializer<v8::internal::Isolate>::ReadSingleBytecodeData<v8::internal::SlotAccessorForHeapObject>(unsigned char, v8::internal::SlotAccessorForHeapObject) [node]
73: 0x15415d1 v8::internal::Deserializer<v8::internal::Isolate>::ReadData(v8::internal::Handle<v8::internal::HeapObject>, int, int) [node]
74: 0x1541898 v8::internal::Deserializer<v8::internal::Isolate>::ReadObject(v8::internal::SnapshotSpace) [node]
75: 0x154049b int v8::internal::Deserializer<v8::internal::Isolate>::ReadSingleBytecodeData<v8::internal::SlotAccessorForHeapObject>(unsigned char, v8::internal::SlotAccessorForHeapObject) [node]
76: 0x15415d1 v8::internal::Deserializer<v8::internal::Isolate>::ReadData(v8::internal::Handle<v8::internal::HeapObject>, int, int) [node]
77: 0x1541898 v8::internal::Deserializer<v8::internal::Isolate>::ReadObject(v8::internal::SnapshotSpace) [node]
78: 0x154049b int v8::internal::Deserializer<v8::internal::Isolate>::ReadSingleBytecodeData<v8::internal::SlotAccessorForHeapObject>(unsigned char, v8::internal::SlotAccessorForHeapObject) [node]
79: 0x15415d1 v8::internal::Deserializer<v8::internal::Isolate>::ReadData(v8::internal::Handle<v8::internal::HeapObject>, int, int) [node]
80: 0x1541898 v8::internal::Deserializer<v8::internal::Isolate>::ReadObject(v8::internal::SnapshotSpace) [node]
81: 0x1541b79 int v8::internal::Deserializer<v8::internal::Isolate>::ReadSingleBytecodeData<v8::internal::SlotAccessorForHandle<v8::internal::Isolate> >(unsigned char, v8::internal::SlotAccessorForHandle<v8::internal::Isolate>) [node]
82: 0x154247f v8::internal::Deserializer<v8::internal::Isolate>::ReadObject() [node]
83: 0x1547012 v8::internal::ObjectDeserializer::Deserialize() [node]
84: 0x1547224 v8::internal::ObjectDeserializer::DeserializeSharedFunctionInfo(v8::internal::Isolate*, v8::internal::SerializedCodeData const*, v8::internal::Handle<v8::internal::String>) [node]
85: 0x1539f62 v8::internal::CodeSerializer::Deserialize(v8::internal::Isolate*, v8::internal::AlignedCachedData*, v8::internal::Handle<v8::internal::String>, v8::ScriptOriginOptions, v8::internal::MaybeHandle<v8::internal::Script>) [node]
86: 0xf942db  [node]
87: 0xf945bd v8::internal::Compiler::GetSharedFunctionInfoForScriptWithCachedData(v8::internal::Isolate*, v8::internal::Handle<v8::internal::String>, v8::internal::ScriptDetails const&, v8::internal::AlignedCachedData*, v8::ScriptCompiler::CompileOptions, v8::ScriptCompiler::NoCacheReason, v8::internal::NativesFlag) [node]
88: 0xef479c  [node]
89: 0xef48a8 v8::ScriptCompiler::CompileUnboundScript(v8::Isolate*, v8::ScriptCompiler::Source*, v8::ScriptCompiler::CompileOptions, v8::ScriptCompiler::NoCacheReason) [node]
90: 0xc930ae node::contextify::ContextifyScript::New(v8::FunctionCallbackInfo<v8::Value> const&) [node]
91: 0xf324bf v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) [node]
92: 0xf32a75  [node]
93: 0xf33193 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [node]
94: 0x193cdf6  [node]
Error: Could not get yarn cache folder path for /home/runner/work/megarepo/megarepo/frontend/educator/docs
/home/runner/work/megarepo/megarepo/frontend/educator/classroom/.yarn/cache
/home/runner/work/megarepo/megarepo/frontend/educator/school/.yarn/cache
/home/runner/work/megarepo/megarepo/frontend/educator/sso/.yarn/cache
/home/runner/work/megarepo/megarepo/frontend/educator/materials/.yarn/cache
/home/runner/work/megarepo/megarepo/frontend/educator/entities/.yarn/cache
/home/runner/work/megarepo/megarepo/frontend/educator/qa/.yarn/cache

Annoyingly, it seems to print the correct cache folders at the end, that it said it was unable to find? It seems to fail to get the cache for one of the folders while succeeding for the rest.

@xcq1
Copy link
Author

xcq1 commented Feb 22, 2024

@frederic-saunier Unfortunately not. As far as I know upgrading to v4 did reduce the frequency, but the problem is definitely still there.

@chuzarski
Copy link

chuzarski commented Mar 1, 2024

Hello!

I'm facing a similar issue, however not with setup-node. I'm facing this with Nx/pnpm/Atlassian Bamboo. There is an issue filed with nodejs for similar crashes (nodejs/node#51555). So I'm presuming this may be occuring outside of setup-node.

@aaronclong
Copy link

I think I am running into this as well, but it doesn't seem to be intermittent though

@grepfruit19
Copy link

I'm still running into this issue, I've tried the above steps but no dice.

@james-bowers
Copy link

We're seeing these sporadic failures too

@grepfruit19
Copy link

I'm guessing there are probably multiple causes of this issue, but I managed to fix it on my own repositories by specifying the yarn.lock file

In other words, I changed
cache-dependency-path: nested-directory/

to
cache-dependency-path: nested-directory/yarn.lock

I see someone above already specified yarn.lock so this probably isn't the only reason for failure, but it worked for me.

@aparnajyothi-y
Copy link
Contributor

Hello @xcq1, Thank you for bringing this issue to our attention. We have thoroughly investigated the situation and were unable to reproduce the problem you're experiencing with the actions/setup-node workflow.
We have successfully run the setup with caching for Yarn dependencies without encountering the error. It seems that the issue might be environment-specific or related to a particular configuration.
Based on the logs and the setup-node current logic, the process for retrieving the Yarn cache directory is working correctly in most cases, but it encounters an error for the specific project directory /home/runner/work/private-repository/private-repository/service/microfrontend. As per the investigation the setup-node logic successfully retrieves the Yarn version (1.22.19) and correctly decides to use the yarn cache dir command. For the directory /home/runner/work/private-repository/private-repository/service/microfrontend, the process fails with the error message: Could not get yarn cache folder path for /home/runner/work/private-repository/private-repository/service/microfrontend. This indicates that the command to fetch the cache directory is likely not returning the expected output for this specific project directory.
Please find the below screenshot for reference.
Potential Causes:

  • the microfrontend directory should properly set up and contains a valid yarn.lock file. If it's missing or incorrectly configured, it might affect how Yarn resolves its cache directory.
  • If there are any permission-related issues that might be preventing Yarn from accessing or creating the cache in that directory. Certain environment variables or configurations might affect how Yarn behaves.
  • We should make sure that any relevant configurations are consistent across the projects.

If you could provide more details with public repro link about your setup or any specific error messages you're receiving, it would be helpful for further investigation.
image

@aparnajyothi-y
Copy link
Contributor

Hello @xcq1, Please provide more details with public repro link about your setup or any specific error messages you're receiving, it would be helpful for further investigation as we are unable to reproduce the issue from our end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests