nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.84k stars 2.38k forks source link

NX parallel tasks fail with the error: "NX disk I/O error. #28424

Closed ytchenak closed 1 month ago

ytchenak commented 1 month ago

Current Behavior

Parallel tasks have started failing with the error: "NX disk I/O error"

Expected Behavior

Parallel tests have to be finished without error

GitHub Repo

No response

Steps to Reproduce

  1. Run two or more jobs that execute non-overlapping sets of NX tasks
  2. One of the jobs may fail with "NX disk I/O" error or "NX FOREIGN KEY constraint failed" or another SQLite error.

Nx Report

Node : 20.18.0 OS : win32-x64 Native Target : x86_64-windows pnpm : 9.12.1

nx (global) : 19.8.4 nx : 19.8.4 @nx/js : 19.8.4 @nx/jest : 19.8.4 @nx/linter : 19.8.4 @nx/eslint : 19.8.4 @nx/workspace : 19.8.4 @nx/angular : 19.8.4 @nx/eslint-plugin : 19.8.4 typescript : 5.5.4

Community plugins: @ngneat/spectator : 19.0.0 ng-mocks : 14.13.1 ngx-bootstrap : 18.0.2 nx-stylelint : 17.1.5

Failure Logs

Error: disk I/O error at /h/bldrtlv/jenkins/git_repo/prod/emweb_PR-1182/frontend/node_modules/.pnpm/nx@19.8.4_@swc-node+register@1.10.9_@swc+core@1.7.28_@swc+helpers@0.5.13__@swc+types@0.1.12_t_3mk5x3ieogvcrsvdo72ysw5h3m/node_modules/nx/src/utils/db-connection.js:11:93 at getEntryOrSet
 (/h/bldrtlv/jenkins/git_repo/prod/emweb_PR-1182/frontend/node_modules/.pnpm/nx@19.8.4_@swc-node+register@1.10.9_@swc+core@1.7.28_@swc+helpers@0.5.13__@swc+types@0.1.12_t_3mk5x3ieogvcrsvdo72ysw5h3m/node_modules/nx/src/utils/db-connection.js:19:17) at getDbConnection
 (/h/bldrtlv/jenkins/git_repo/prod/emweb_PR-1182/frontend/node_modules/.pnpm/nx@19.8.4_@swc-node+register@1.10.9_@swc+core@1.7.28_@swc+helpers@0.5.13__@swc+types@0.1.12_t_3mk5x3ieogvcrsvdo72ysw5h3m/node_modules/nx/src/utils/db-connection.js:11:24) at getTaskDetails
 (/h/bldrtlv/jenkins/git_repo/prod/emweb_PR-1182/frontend/node_modules/.pnpm/nx@19.8.4_@swc-node+register@1.10.9_@swc+core@1.7.28_@swc+helpers@0.5.13__@swc+types@0.1.12_t_3mk5x3ieogvcrsvdo72ysw5h3m/node_modules/nx/src/hasher/hash-task.js:19:84) at invokeTasksRunner
 (/h/bldrtlv/jenkins/git_repo/prod/emweb_PR-1182/frontend/node_modules/.pnpm/nx@19.8.4_@swc-node+register@1.10.9_@swc+core@1.7.28_@swc+helpers@0.5.13__@swc+types@0.1.12_t_3mk5x3ieogvcrsvdo72ysw5h3m/node_modules/nx/src/tasks-runner/run-command.js:367:56) at runCommandForTasks
 (/h/bldrtlv/jenkins/git_repo/prod/emweb_PR-1182/frontend/node_modules/.pnpm/nx@19.8.4_@swc-node+register@1.10.9_@swc+core@1.7.28_@swc+helpers@0.5.13__@swc+types@0.1.12_t_3mk5x3ieogvcrsvdo72ysw5h3m/node_modules/nx/src/tasks-runner/run-command.js:117:31) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async
 /h/bldrtlv/jenkins/git_repo/prod/emweb_PR-1182/frontend/node_modules/.pnpm/nx@19.8.4_@swc-node+register@1.10.9_@swc+core@1.7.28_@swc+helpers@0.5.13__@swc+types@0.1.12_t_3mk5x3ieogvcrsvdo72ysw5h3m/node_modules/nx/src/tasks-runner/run-command.js:105:29 at async handleErrors
 (/h/bldrtlv/jenkins/git_repo/prod/emweb_PR-1182/frontend/node_modules/.pnpm/nx@19.8.4_@swc-node+register@1.10.9_@swc+core@1.7.28_@swc+helpers@0.5.13__@swc+types@0.1.12_t_3mk5x3ieogvcrsvdo72ysw5h3m/node_modules/nx/src/utils/handle-errors.js:9:24) at async runCommand
 (/h/bldrtlv/jenkins/git_repo/prod/emweb_PR-1182/frontend/node_modules/.pnpm/nx@19.8.4_@swc-node+register@1.10.9_@swc+core@1.7.28_@swc+helpers@0.5.13__@swc+types@0.1.12_t_3mk5x3ieogvcrsvdo72ysw5h3m/node_modules/nx/src/tasks-runner/run-command.js:104:20)

Package Manager Version

No response

Operating System

Additional Information

The issue persists also in version 19.8.4 after fix #28035 with the error "NX disk I/O error." I believe the error originates from SQLite, which is used in the .nx/workspace-data directory. It seems the SQLite files are not well-protected against concurrent write access, even though the directory contains a lockfile.hash file.

In my scenario, I am running two separate processes: one for build and one for lint, using the following commands:

pnpm nx run-many -t build pnpm nx run-many -t lint These processes are executed from different Jenkins agents.

crowmagnumb commented 1 month ago

Confirmed. I used to be able to serve 2 different applications that rely on the same libraries at the same time (so that I can debug them simultaneously) and now when trying to launch the 2nd one I get ...

NX disk I/O error

and verbose tells me nothing except that the exit code is 1.

UPDATE: I am also on 19.8.4 UPDATE2: So now I just realized that this is affecting me as I started working on a task that requires me to run an angular web app and a node app at the same time (client/server). This time I tried to run the 2nd with --verbose and got the following....

NX disk I/O error

Error: disk I/O error at /home/ken/dev/animalus/animalus/node_modules/nx/src/utils/db-connection.js:11:93 at getEntryOrSet (/home/ken/dev/animalus/animalus/node_modules/nx/src/utils/db-connection.js:19:17) at getDbConnection (/home/ken/dev/animalus/animalus/node_modules/nx/src/utils/db-connection.js:11:24) at getTaskDetails (/home/ken/dev/animalus/animalus/node_modules/nx/src/hasher/hash-task.js:19:84) at invokeTasksRunner (/home/ken/dev/animalus/animalus/node_modules/nx/src/tasks-runner/run-command.js:367:56) at runCommandForTasks (/home/ken/dev/animalus/animalus/node_modules/nx/src/tasks-runner/run-command.js:117:31) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async /home/ken/dev/animalus/animalus/node_modules/nx/src/tasks-runner/run-command.js:105:29 at async handleErrors (/home/ken/dev/animalus/animalus/node_modules/nx/src/utils/handle-errors.js:9:24) at async runCommand (/home/ken/dev/animalus/animalus/node_modules/nx/src/tasks-runner/run-command.js:104:20)

... though I can't find a point in the db-connections.js git history for which these line numbers make sense. But maybe it's helpful to you.

crowmagnumb commented 1 month ago

I found the issue and created a pull request.

jaysoo commented 1 month ago

@ytchenak @crowmagnumb Can you try the latest 19.8.6 patch release? It includes a patch for the DB connection. https://github.com/nrwl/nx/pull/28507#issuecomment-2422917809

kustomq commented 1 month ago

happens to me as well but on v20.0.3:

Error: disk I/O error
    at /Users/fakegod/Documents/Proj/node_modules/.pnpm/nx@20.0.3_@swc-node+register@1.9.2_@swc+core@1.5.7_@swc+helpers@0.5.11__@swc+types@0.1.7_type_cxohwuiq2lf5alcyvrfldxcl4e/node_modules/nx/src/utils/db-connection.js:11:93
    at getEntryOrSet (/Users/fakegod/Documents/Proj/node_modules/.pnpm/nx@20.0.3_@swc-node+register@1.9.2_@swc+core@1.5.7_@swc+helpers@0.5.11__@swc+types@0.1.7_type_cxohwuiq2lf5alcyvrfldxcl4e/node_modules/nx/src/utils/db-connection.js:19:17)
    at getDbConnection (/Users/fakegod/Documents/Proj/node_modules/.pnpm/nx@20.0.3_@swc-node+register@1.9.2_@swc+core@1.5.7_@swc+helpers@0.5.11__@swc+types@0.1.7_type_cxohwuiq2lf5alcyvrfldxcl4e/node_modules/nx/src/utils/db-connection.js:11:24)
    at getTaskDetails (/Users/fakegod/Documents/Proj/node_modules/.pnpm/nx@20.0.3_@swc-node+register@1.9.2_@swc+core@1.5.7_@swc+helpers@0.5.11__@swc+types@0.1.7_type_cxohwuiq2lf5alcyvrfldxcl4e/node_modules/nx/src/hasher/hash-task.js:19:84)
    at invokeTasksRunner (/Users/fakegod/Documents/Proj/node_modules/.pnpm/nx@20.0.3_@swc-node+register@1.9.2_@swc+core@1.5.7_@swc+helpers@0.5.11__@swc+types@0.1.7_type_cxohwuiq2lf5alcyvrfldxcl4e/node_modules/nx/src/tasks-runner/run-command.js:367:56)
    at runCommandForTasks (/Users/fakegod/Documents/Proj/node_modules/.pnpm/nx@20.0.3_@swc-node+register@1.9.2_@swc+core@1.5.7_@swc+helpers@0.5.11__@swc+types@0.1.7_type_cxohwuiq2lf5alcyvrfldxcl4e/node_modules/nx/src/tasks-runner/run-command.js:117:31)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /Users/fakegod/Documents/Proj/node_modules/.pnpm/nx@20.0.3_@swc-node+register@1.9.2_@swc+core@1.5.7_@swc+helpers@0.5.11__@swc+types@0.1.7_type_cxohwuiq2lf5alcyvrfldxcl4e/node_modules/nx/src/tasks-runner/run-command.js:105:29
    at async handleErrors (/Users/fakegod/Documents/Proj/node_modules/.pnpm/nx@20.0.3_@swc-node+register@1.9.2_@swc+core@1.5.7_@swc+helpers@0.5.11__@swc+types@0.1.7_type_cxohwuiq2lf5alcyvrfldxcl4e/node_modules/nx/src/utils/handle-errors.js:9:24)
    at async runCommand (/Users/fakegod/Documents/Proj/node_modules/.pnpm/nx@20.0.3_@swc-node+register@1.9.2_@swc+core@1.5.7_@swc+helpers@0.5.11__@swc+types@0.1.7_type_cxohwuiq2lf5alcyvrfldxcl4e/node_modules/nx/src/tasks-runner/run-command.js:104:20)
RubenVermeulen commented 1 month ago

We are experiencing this issue as well. We updated to Nx 20.0.1 coming from 19.6.5 from that moment onwards the issue occurred. The errors are thrown when our agents are running the lint, test and build commands.

alexeysvyridov commented 1 month ago

happens to me as well but on v20.0.3:

Error: disk I/O error
    at /Users/fakegod/Documents/Proj/node_modules/.pnpm/nx@20.0.3_@swc-node+register@1.9.2_@swc+core@1.5.7_@swc+helpers@0.5.11__@swc+types@0.1.7_type_cxohwuiq2lf5alcyvrfldxcl4e/node_modules/nx/src/utils/db-connection.js:11:93
    at getEntryOrSet (/Users/fakegod/Documents/Proj/node_modules/.pnpm/nx@20.0.3_@swc-node+register@1.9.2_@swc+core@1.5.7_@swc+helpers@0.5.11__@swc+types@0.1.7_type_cxohwuiq2lf5alcyvrfldxcl4e/node_modules/nx/src/utils/db-connection.js:19:17)
    at getDbConnection (/Users/fakegod/Documents/Proj/node_modules/.pnpm/nx@20.0.3_@swc-node+register@1.9.2_@swc+core@1.5.7_@swc+helpers@0.5.11__@swc+types@0.1.7_type_cxohwuiq2lf5alcyvrfldxcl4e/node_modules/nx/src/utils/db-connection.js:11:24)
    at getTaskDetails (/Users/fakegod/Documents/Proj/node_modules/.pnpm/nx@20.0.3_@swc-node+register@1.9.2_@swc+core@1.5.7_@swc+helpers@0.5.11__@swc+types@0.1.7_type_cxohwuiq2lf5alcyvrfldxcl4e/node_modules/nx/src/hasher/hash-task.js:19:84)
    at invokeTasksRunner (/Users/fakegod/Documents/Proj/node_modules/.pnpm/nx@20.0.3_@swc-node+register@1.9.2_@swc+core@1.5.7_@swc+helpers@0.5.11__@swc+types@0.1.7_type_cxohwuiq2lf5alcyvrfldxcl4e/node_modules/nx/src/tasks-runner/run-command.js:367:56)
    at runCommandForTasks (/Users/fakegod/Documents/Proj/node_modules/.pnpm/nx@20.0.3_@swc-node+register@1.9.2_@swc+core@1.5.7_@swc+helpers@0.5.11__@swc+types@0.1.7_type_cxohwuiq2lf5alcyvrfldxcl4e/node_modules/nx/src/tasks-runner/run-command.js:117:31)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /Users/fakegod/Documents/Proj/node_modules/.pnpm/nx@20.0.3_@swc-node+register@1.9.2_@swc+core@1.5.7_@swc+helpers@0.5.11__@swc+types@0.1.7_type_cxohwuiq2lf5alcyvrfldxcl4e/node_modules/nx/src/tasks-runner/run-command.js:105:29
    at async handleErrors (/Users/fakegod/Documents/Proj/node_modules/.pnpm/nx@20.0.3_@swc-node+register@1.9.2_@swc+core@1.5.7_@swc+helpers@0.5.11__@swc+types@0.1.7_type_cxohwuiq2lf5alcyvrfldxcl4e/node_modules/nx/src/utils/handle-errors.js:9:24)
    at async runCommand (/Users/fakegod/Documents/Proj/node_modules/.pnpm/nx@20.0.3_@swc-node+register@1.9.2_@swc+core@1.5.7_@swc+helpers@0.5.11__@swc+types@0.1.7_type_cxohwuiq2lf5alcyvrfldxcl4e/node_modules/nx/src/tasks-runner/run-command.js:104:20)

we are experiencing this as well when running tasks

idangu commented 1 month ago

I'm experiencing the same issue, but on version 20.0.3.

`Error: disk I/O error

at /Users/fakegod/Documents/Proj/node_modules/.pnpm/nx@20.0.3_@swc-node+register@1.9.2_@swc+core@1.5.7_@swc+helpers@0.5.11__@swc+types@0.1.7_type_cxohwuiq2lf5alcyvrfldxcl4e/node_modules/nx/src/utils/db-connection.js:11:93
at getEntryOrSet (/Users/fakegod/Documents/Proj/node_modules/.pnpm/nx@20.0.3_@swc-node+register@1.9.2_@swc+core@1.5.7_@swc+helpers@0.5.11__@swc+types@0.1.7_type_cxohwuiq2lf5alcyvrfldxcl4e/node_modules/nx/src/utils/db-connection.js:19:17)
at getDbConnection (/Users/fakegod/Documents/Proj/node_modules/.pnpm/nx@20.0.3_@swc-node+register@1.9.2_@swc+core@1.5.7_@swc+helpers@0.5.11__@swc+types@0.1.7_type_cxohwuiq2lf5alcyvrfldxcl4e/node_modules/nx/src/utils/db-connection.js:11:24)
at getTaskDetails (/Users/fakegod/Documents/Proj/node_modules/.pnpm/nx@20.0.3_@swc-node+register@1.9.2_@swc+core@1.5.7_@swc+helpers@0.5.11__@swc+types@0.1.7_type_cxohwuiq2lf5alcyvrfldxcl4e/node_modules/nx/src/hasher/hash-task.js:19:84)
at invokeTasksRunner (/Users/fakegod/Documents/Proj/node_modules/.pnpm/nx@20.0.3_@swc-node+register@1.9.2_@swc+core@1.5.7_@swc+helpers@0.5.11__@swc+types@0.1.7_type_cxohwuiq2lf5alcyvrfldxcl4e/node_modules/nx/src/tasks-runner/run-command.js:367:56)
at runCommandForTasks (/Users/fakegod/Documents/Proj/node_modules/.pnpm/nx@20.0.3_@swc-node+register@1.9.2_@swc+core@1.5.7_@swc+helpers@0.5.11__@swc+types@0.1.7_type_cxohwuiq2lf5alcyvrfldxcl4e/node_modules/nx/src/tasks-runner/run-command.js:117:31)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async /Users/fakegod/Documents/Proj/node_modules/.pnpm/nx@20.0.3_@swc-node+register@1.9.2_@swc+core@1.5.7_@swc+helpers@0.5.11__@swc+types@0.1.7_type_cxohwuiq2lf5alcyvrfldxcl4e/node_modules/nx/src/tasks-runner/run-command.js:105:29
at async handleErrors (/Users/fakegod/Documents/Proj/node_modules/.pnpm/nx@20.0.3_@swc-node+register@1.9.2_@swc+core@1.5.7_@swc+helpers@0.5.11__@swc+types@0.1.7_type_cxohwuiq2lf5alcyvrfldxcl4e/node_modules/nx/src/utils/handle-errors.js:9:24)
at async runCommand (/Users/fakegod/Documents/Proj/node_modules/.pnpm/nx@20.0.3_@swc-node+register@1.9.2_@swc+core@1.5.7_@swc+helpers@0.5.11__@swc+types@0.1.7_type_cxohwuiq2lf5alcyvrfldxcl4e/node_modules/nx/src/tasks-runner/run-command.js:104:20)`
Cammisuli commented 1 month ago

Hey all, can you try using this version and see if the issue still persists? nx@0.0.0-pr-28544-c9de3c0

Also, can you run the nx commands with this set NX_NATIVE_LOGGING=nx. There will be a bunch of logs when running any nx commands, so try saving the output to a file.

crowmagnumb commented 1 month ago

My dependencies are ... "@nx/angular": "19.8.6", "@nx/cypress": "19.8.6", "@nx/esbuild": "19.8.6", "@nx/eslint": "19.8.6", "@nx/eslint-plugin": "19.8.6", "@nx/express": "19.8.6", "@nx/jest": "19.8.6", "@nx/js": "19.8.6", "@nx/node": "19.8.6", "@nx/workspace": "19.8.6", ... which would I have to upgrade to your version above? Just nx/workspace?

kustomq commented 1 month ago

Also, can you run the nx commands with this set NX_NATIVE_LOGGING=nx. There will be a bunch of logs when running any nx commands, so try saving the output to a file.

Installed nx@0.0.0-pr-28544-c9de3c0, attaching below the end of the output file, now it seems that I'm getting a different error TypeError: Cannot read properties of undefined (reading 'cacheError').

TRACE nx::native::cache::cache: GET 4568491116804863582
TRACE nx::native::db::connection: Error in query_row: QueryReturnedNoRows
TRACE nx::native::cache::cache: GET 4568491116804863582 47.084µs
TRACE nx::native::cache::cache: GET 1116164664999884731
TRACE nx::native::db::connection: Error in query_row: QueryReturnedNoRows
TRACE nx::native::cache::cache: GET 1116164664999884731 22µs
TRACE nx::native::cache::cache: GET 17502134106171772157
TRACE nx::native::db::connection: Error in query_row: QueryReturnedNoRows
TRACE nx::native::cache::cache: GET 17502134106171772157 18.833µs

 NX   Successfully ran target lint for 63 projects

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

Pass --verbose to see the stacktrace.

 ELIFECYCLE  Command failed with exit code 1.
leggomuhgreggo commented 1 month ago

Also seeing this issue

`nx report` output ``` pnpm nx report > sg-monorepo@0.63.0 nx /Users/gregorywestneat/projects/work/sg-monorepo > nx "report" NX Report complete - copy this into the issue template Node : 20.17.0 OS : darwin-arm64 Native Target : aarch64-macos pnpm : 9.3.0 nx : 20.0.3 @nx/js : 20.0.3 @nrwl/js : 19.5.6 @nx/jest : 20.0.3 @nx/linter : 19.5.6 @nx/eslint : 20.0.3 @nx/workspace : 20.0.3 @nrwl/workspace : 19.5.6 @nx/cypress : 19.5.6 @nx/detox : 20.0.3 @nx/devkit : 20.0.3 @nrwl/devkit : 19.5.6 @nx/esbuild : 20.0.3 @nx/eslint-plugin : 20.0.3 @nx/expo : 20.0.3 @nx/nest : 20.0.3 @nx/node : 20.0.3 @nx/playwright : 20.0.3 @nx/plugin : 20.0.3 @nx/react : 20.0.3 @nx/storybook : 19.5.6 @nrwl/tao : 19.5.6 @nx/vite : 20.0.3 @nx/web : 20.0.3 @nx/webpack : 20.0.3 typescript : 5.5.3 --------------------------------------- Community plugins: @nx-go/nx-go : 2.7.0 @nx-tools/nx-container : 5.1.0 @nxkit/playwright : 3.0.2 @nxrs/cargo : 0.3.4 --------------------------------------- Local workspace plugins: @workspace/sg-codepipeline-plugin @workspace/sg-codedeploy-plugin @workspace/sg-typeorm-plugin @workspace/sg-rover-plugin @workspace/sg-expo-plugin @workspace/repo @workspace/sg-vite-plugin @sg-monorepo/workspace-plugin --------------------------------------- The following packages should match the installed version of nx - @nrwl/js@19.5.6 - @nx/linter@19.5.6 - @nrwl/workspace@19.5.6 - @nx/cypress@19.5.6 - @nrwl/cypress@19.5.6 - @nrwl/devkit@19.5.6 - @nx/storybook@19.5.6 - @nrwl/storybook@19.5.6 - @nrwl/tao@19.5.6 To fix this, run `nx migrate nx@20.0.3` ```
error details I ran: ``` export NX_NATIVE_LOGGING=nx && pnpm nx run order:start --verbose --skip-nx-cache ``` Seeing this output ``` [NX CLOUD] Verifying current cloud bundle [NX CLOUD] A local bundle currently exists: { version: '2409.26.3.hotfix20', fullPath: '/Users/worklaptop/projects/work/sg-monorepo/.nx/cache/cloud/2409.26.3.hotfix20' } [NX CLOUD] Last verification was within the past 30 minutes, will not verify this time [NX CLOUD] Done: /Users/worklaptop/projects/work/sg-monorepo/.nx/cache/cloud/2409.26.3.hotfix20 Was not able to require.resolve module nx/src/utils/app-root from the following paths: /Users/worklaptop/projects/work/sg-monorepo/node_modules/nx/node_modules,/Users/worklaptop/projects/work/sg-monorepo/node_modules. This may be expected. Was not able to require.resolve module nx/src/utils/app-root from the following paths: /Users/worklaptop/projects/work/sg-monorepo/node_modules/nx/node_modules,/Users/worklaptop/projects/work/sg-monorepo/node_modules. This may be expected. ``` And further along ``` Error: database is locked at /Users/worklaptop/projects/work/sg-monorepo/node_modules/nx/src/utils/db-connection.js:11:93 at getEntryOrSet (/Users/worklaptop/projects/work/sg-monorepo/node_modules/nx/src/utils/db-connection.js:19:17) at getDbConnection (/Users/worklaptop/projects/work/sg-monorepo/node_modules/nx/src/utils/db-connection.js:11:24) at getTaskDetails (/Users/worklaptop/projects/work/sg-monorepo/node_modules/nx/src/hasher/hash-task.js:19:84) at invokeTasksRunner (/Users/worklaptop/projects/work/sg-monorepo/node_modules/nx/src/tasks-runner/run-command.js:367:56) at runCommandForTasks (/Users/worklaptop/projects/work/sg-monorepo/node_modules/nx/src/tasks-runner/run-command.js:117:31) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async /Users/worklaptop/projects/work/sg-monorepo/node_modules/nx/src/tasks-runner/run-command.js:105:29 at async handleErrors (/Users/worklaptop/projects/work/sg-monorepo/node_modules/nx/src/utils/handle-errors.js:9:24) at async runCommand (/Users/worklaptop/projects/work/sg-monorepo/node_modules/nx/src/tasks-runner/run-command.js:104:20) ```

UPDATE: Installing nx@0.0.0-pr-28544-c9de3c0 seems to have done the trick! 🎉

Cammisuli commented 1 month ago

My dependencies are ... "@nx/angular": "19.8.6", "@nx/cypress": "19.8.6", "@nx/esbuild": "19.8.6", "@nx/eslint": "19.8.6", "@nx/eslint-plugin": "19.8.6", "@nx/express": "19.8.6", "@nx/jest": "19.8.6", "@nx/js": "19.8.6", "@nx/node": "19.8.6", "@nx/workspace": "19.8.6", ... which would I have to upgrade to your version above? Just nx/workspace?

Keep all of the nx packages in sync.

Cammisuli commented 1 month ago

Also, can you run the nx commands with this set NX_NATIVE_LOGGING=nx. There will be a bunch of logs when running any nx commands, so try saving the output to a file.

Installed nx@0.0.0-pr-28544-c9de3c0, attaching below the end of the output file, now it seems that I'm getting a different error TypeError: Cannot read properties of undefined (reading 'cacheError').

TRACE nx::native::cache::cache: GET 4568491116804863582
TRACE nx::native::db::connection: Error in query_row: QueryReturnedNoRows
TRACE nx::native::cache::cache: GET 4568491116804863582 47.084µs
TRACE nx::native::cache::cache: GET 1116164664999884731
TRACE nx::native::db::connection: Error in query_row: QueryReturnedNoRows
TRACE nx::native::cache::cache: GET 1116164664999884731 22µs
TRACE nx::native::cache::cache: GET 17502134106171772157
TRACE nx::native::db::connection: Error in query_row: QueryReturnedNoRows
TRACE nx::native::cache::cache: GET 17502134106171772157 18.833µs

�[0m�[7m�[1m�[32m NX �[39m�[22m�[27m�[0m  �[32mSuccessfully ran target �[1mlint�[22m for 63 projects�[39m

�[0m�[7m�[1m�[31m NX �[39m�[22m�[27m�[0m  �[31mCannot read properties of undefined (reading 'cacheError')�[39m

Pass --verbose to see the stacktrace.

 ELIFECYCLE  Command failed with exit code 1.

This looks like you might have the nx-cloud package installed in your deps. You should be able to remove that dep, and things should be working. Nx Cloud will automatically download the latest bundle, so all fixes are in sync with the client and the app.

crowmagnumb commented 1 month ago

Aaah, If I install 19.8.6 of all the @nx/XXX (as noted above) it implicitly installs nx version 20.0.2 and I have the problem.

If I add another explicit line to install nx@19.8.6 then the problem goes away. So 19.8.6 does fix it for me after all. I guess I should keep this explicit nx version to match my @nx/XXX versions.

By the way, if I use the pr version above, I have a problem, albeit a different one (again while running a 2nd task only). But I'm not sure I'm worried about that? But maybe you are? :) Here is what that gives me.

TypeError: Cannot read properties of undefined (reading 'cacheError') at td.retrieve (/home/ken/dev/animalus/animalus2/.nx/cache/cloud/2409.26.3.hotfix20/index.js:32:3253) at DbCache.get (/home/ken/dev/animalus/animalus2/node_modules/nx/src/tasks-runner/cache.js:61:48) at TaskOrchestrator.applyCachedResult (/home/ken/dev/animalus/animalus2/node_modules/nx/src/tasks-runner/task-orchestrator.js:131:47) at /home/ken/dev/animalus/animalus2/node_modules/nx/src/tasks-runner/task-orchestrator.js:126:70 at Array.map () at TaskOrchestrator.applyCachedResults (/home/ken/dev/animalus/animalus2/node_modules/nx/src/tasks-runner/task-orchestrator.js:126:54) at TaskOrchestrator.applyFromCacheOrRunTask (/home/ken/dev/animalus/animalus2/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/ken/dev/animalus/animalus2/node_modules/nx/src/tasks-runner/task-orchestrator.js:85:13) at async Promise.all (index 0)

crowmagnumb commented 1 month ago

Aaah, If I install 19.8.6 of all the @nx/XXX (as noted above) it implicitly installs nx version 20.0.2 and I have the problem.

If I add another explicit line to install nx@19.8.6 then the problem goes away. So 19.8.6 does fix it for me after all. I guess I should keep this explicit nx version to match my @nx/XXX versions.

By the way, if I use the pr version above, I have a problem, albeit a different one (again while running a 2nd task only). But I'm not sure I'm worried about that? But maybe you are? :) Here is what that gives me.

TypeError: Cannot read properties of undefined (reading 'cacheError') at td.retrieve (/home/ken/dev/animalus/animalus2/.nx/cache/cloud/2409.26.3.hotfix20/index.js:32:3253) at DbCache.get (/home/ken/dev/animalus/animalus2/node_modules/nx/src/tasks-runner/cache.js:61:48) at TaskOrchestrator.applyCachedResult (/home/ken/dev/animalus/animalus2/node_modules/nx/src/tasks-runner/task-orchestrator.js:131:47) at /home/ken/dev/animalus/animalus2/node_modules/nx/src/tasks-runner/task-orchestrator.js:126:70 at Array.map () at TaskOrchestrator.applyCachedResults (/home/ken/dev/animalus/animalus2/node_modules/nx/src/tasks-runner/task-orchestrator.js:126:54) at TaskOrchestrator.applyFromCacheOrRunTask (/home/ken/dev/animalus/animalus2/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/ken/dev/animalus/animalus2/node_modules/nx/src/tasks-runner/task-orchestrator.js:85:13) at async Promise.all (index 0)

Also, I am nowhere explicitly installing nx-cloud. The only reference that I can find to that in my code is an "nxCloudAccessToken" in the nx.json file.

afurculita commented 1 month ago

I've had the same error. The fix was to delete the .nx folder.