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

NX_DB_CACHE=true with neverConnectToCloud = true causes cacheError #28287

Closed
1 of 4 tasks
dustyhorizon opened this issue Oct 4, 2024 · 2 comments · Fixed by #28452
Closed
1 of 4 tasks

NX_DB_CACHE=true with neverConnectToCloud = true causes cacheError #28287

dustyhorizon opened this issue Oct 4, 2024 · 2 comments · Fixed by #28452
Assignees
Labels

Comments

@dustyhorizon
Copy link
Contributor

dustyhorizon commented Oct 4, 2024

Current Behavior

NX_DB_CACHE=false pnpm nx some-project:some-target --verbose has no issues.

NX_DB_CACHE=true pnpm nx some-project:some-target --verbose and neverConnectToCloud = true in nx.json throws the following error

❯ pnpm nx run nix/pkgs/fleet/4.57.0:earthly-semgrep-ci --verbose
[NX CLOUD] Verifying current cloud bundle
[NX CLOUD] A local bundle currently exists:  {
  version: '2409.26.3.hotfix3',
  fullPath: '/home/kennethtan/Documents/GitHub/opus/.nx/cache/cloud/2409.26.3.hotfix3'
}
[NX CLOUD] Last verification was within the past 30 minutes, will not verify this time
[NX CLOUD] Done:  /home/kennethtan/Documents/GitHub/opus/.nx/cache/cloud/2409.26.3.hotfix3

—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

 NX   Successfully ran target earthly-semgrep-ci for project nix/pkgs/fleet/4.57.0



 NX   Cannot read properties of undefined (reading 'cacheError')

TypeError: Cannot read properties of undefined (reading 'cacheError')
    at ud.retrieve (/home/kennethtan/Documents/GitHub/opus/.nx/cache/cloud/2409.26.3.hotfix3/index.js:38:3253)
    at DbCache.get (/home/kennethtan/Documents/GitHub/opus/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected]__@[email protected]_t_qxkv3ljcdobbuip4sajlcnzfma/node_modules/nx/src/tasks-runner/cache.js:56:48)
    at TaskOrchestrator.applyCachedResult (/home/kennethtan/Documents/GitHub/opus/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected]__@[email protected]_t_qxkv3ljcdobbuip4sajlcnzfma/node_modules/nx/src/tasks-runner/task-orchestrator.js:131:47)
    at /home/kennethtan/Documents/GitHub/opus/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected]__@[email protected]_t_qxkv3ljcdobbuip4sajlcnzfma/node_modules/nx/src/tasks-runner/task-orchestrator.js:126:70
    at Array.map (<anonymous>)
    at TaskOrchestrator.applyCachedResults (/home/kennethtan/Documents/GitHub/opus/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected]__@[email protected]_t_qxkv3ljcdobbuip4sajlcnzfma/node_modules/nx/src/tasks-runner/task-orchestrator.js:126:54)
    at TaskOrchestrator.applyFromCacheOrRunTask (/home/kennethtan/Documents/GitHub/opus/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected]__@[email protected]_t_qxkv3ljcdobbuip4sajlcnzfma/node_modules/nx/src/tasks-runner/task-orchestrator.js:219:51)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async TaskOrchestrator.executeNextBatchOfTasksUsingTaskSchedule (/home/kennethtan/Documents/GitHub/opus/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected]__@[email protected]_t_qxkv3ljcdobbuip4sajlcnzfma/node_modules/nx/src/tasks-runner/task-orchestrator.js:85:13)
    at async Promise.all (index 0)

Expected Behavior

NX_DB_CACHE=true pnpm nx some-project:some-target --verbose and neverConnectToCloud = true in nx.json should run without issues.

GitHub Repo

No response

Steps to Reproduce

  1. Configure neverConnectToCloud = true in nx.json
  2. export NX_DB_CACHE=true
  3. pnpm nx some-project:some-target --verbose

Nx Report

❯ pnpm nx report

 NX   Report complete - copy this into the issue template

Node           : 18.18.2
OS             : linux-x64
Native Target  : x86_64-linux
pnpm           : 9.9.0

nx                 : 19.8.3
@nx/js             : 19.8.3
@nx/jest           : 19.8.3
@nx/linter         : 19.8.3
@nx/eslint         : 19.8.3
@nx/workspace      : 19.8.3
@nx/devkit         : 19.8.3
@nx/eslint-plugin  : 19.8.3
@nx/node           : 19.8.3
@nrwl/tao          : 19.8.3
typescript         : 5.6.2
---------------------------------------
Registered Plugins:
opus-lib-nx-project-graph-v2

Failure Logs

No response

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

pnpm nx reset somehow generates a static cloud bundle at .nx/cache/cloud/2409.26.3.hotfix3 despite neverConnectToCloud = true, is this intended?

@dustyhorizon
Copy link
Contributor Author

Possibly related to #28150?

@jaysoo jaysoo added the scope: core core nx functionality label Oct 14, 2024
@jaysoo jaysoo closed this as completed in 45b0b7d Oct 15, 2024
jaysoo pushed a commit that referenced this issue Oct 15, 2024
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
`neverConnectToCloud` was not respected in the `isNxCloudUsed` function

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
`neverConnectToCloud` is now respected

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #28287
jaysoo pushed a commit that referenced this issue Oct 17, 2024
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
`neverConnectToCloud` was not respected in the `isNxCloudUsed` function

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
`neverConnectToCloud` is now respected

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #28287
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants