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

Cloud agent crashing when new caching is enabled #28806

Open
3 of 4 tasks
tmercswims opened this issue Nov 5, 2024 · 2 comments
Open
3 of 4 tasks

Cloud agent crashing when new caching is enabled #28806

tmercswims opened this issue Nov 5, 2024 · 2 comments
Assignees
Labels
scope: core core nx functionality type: bug

Comments

@tmercswims
Copy link

tmercswims commented Nov 5, 2024

Current Behavior

After upgrading to Nx 20 (from 19), and enabling the new database-based caching by removing the useLegacyCache flag from my nx.json, most (but not all) of my CIPE runs are failing with error that look like this:

Agent 'job-67292d4f767f6f3d87a1cbad-0-agent-2' exited with the error: Missing field code.

One of my team members was able to reproduce this issue locally, and when running with --verbose he obtained the following stack trace:

Error: Missing field `code`
    at DbCache.applyRemoteCacheResults (.../node_modules/nx/src/tasks-runner/cache.js:80:27)
    at DbCache.get (.../node_modules/nx/src/tasks-runner/cache.js:65:22)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async TaskOrchestrator.applyCachedResult (.../node_modules/nx/src/tasks-runner/task-orchestrator.js:131:30)
    at async Promise.all (index 0)
    at async TaskOrchestrator.applyCachedResults (.../node_modules/nx/src/tasks-runner/task-orchestrator.js:126:21)
    at async TaskOrchestrator.applyFromCacheOrRunTask (.../node_modules/nx/src/tasks-runner/task-orchestrator.js:219:40)
    at async TaskOrchestrator.executeNextBatchOfTasksUsingTaskSchedule (.../node_modules/nx/src/tasks-runner/task-orchestrator.js:85:13)       
    at async Promise.all (index 2)
    at async TaskOrchestrator.run (.../node_modules/nx/src/tasks-runner/task-orchestrator.js:61:9)

This was with Nx 20.0.7, but as I said, it seems to be somewhat intermittent. Some of our CIPE runs went just fine, but many failed. Adding useLegacyCache: true back into the nx.json stopped this issue completely, so it appears to be related to the new caching.

I also have a support ticket open which contains more information, including a link to a CIPE.

Nx Report

Node : 22.11.0
yarn : 4.5.1

nx : 20.0.7
@nx/js : 20.0.7
@nx/jest : 20.0.7
@nx/eslint : 20.0.7
@nx/workspace : 20.0.7
@nx/angular : 20.0.7
@nx/devkit : 20.0.7
@nx/eslint-plugin : 20.0.7
@nx/nest : 20.0.7
@nx/node : 20.0.7
@nx/web : 20.0.7
@nx/webpack : 20.0.7
typescript : 5.4.5

Package Manager Version

yarn 4.5.1

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)
@FrozenPandaz FrozenPandaz added the scope: core core nx functionality label Nov 12, 2024
@Cammisuli
Copy link
Member

Thanks for your report. I'm actively looking at what could be causing the issue.

valentinpalkovic added a commit to storybookjs/storybook that referenced this issue Dec 15, 2024
Due to the following issue nrwl/nx#28806, which we encounter in the GitHub Window Unit Test Job regularly, we have to opt-in to NX's legacy cache mechanism. That will use the file system instead of a file DB for caching.
@valentinpalkovic
Copy link

We have the exact same issue in Storybook's mono repository:
https://github.com/storybookjs/storybook/actions/runs/12338536418/job/34433600345

Unfortunately, we were not able to reproduce it locally. Maybe it has something to do with the GitHub Action actually performing on a Windows OS.

ghengeveld pushed a commit to storybookjs/storybook that referenced this issue Dec 16, 2024
Due to the following issue nrwl/nx#28806, which we encounter in the GitHub Window Unit Test Job regularly, we have to opt-in to NX's legacy cache mechanism. That will use the file system instead of a file DB for caching.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: core core nx functionality type: bug
Projects
None yet
Development

No branches or pull requests

4 participants