nx icon indicating copy to clipboard operation
nx copied to clipboard

dbName was null trying to connect. fixes issue #28424

Open crowmagnumb opened this issue 1 year ago • 4 comments

Current Behavior

If you try to run a 2nd process in parallel you get ...

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)

Expected Behavior

Ability to run a 2nd process in parallel

Related Issue(s)

#28424

Fixes #

crowmagnumb avatar Oct 17 '24 23:10 crowmagnumb

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Oct 17, 2024 11:15pm

vercel[bot] avatar Oct 17 '24 23:10 vercel[bot]

@crowmagnumb Can you try the latest 19.8.6 patch version? It includes a fix for DB connection: https://github.com/nrwl/nx/releases/tag/19.8.5

jaysoo avatar Oct 18 '24 17:10 jaysoo

@crowmagnumb Can you try the latest 19.8.6 patch version? It includes a fix for DB connection: https://github.com/nrwl/nx/releases/tag/19.8.5

Nope. same issue. Had to apply my patch locally to get it to work.

crowmagnumb avatar Oct 18 '24 18:10 crowmagnumb

This fixing some of your issues is interesting to me. The connectToNxDb function can handle opts.dbName being null or undefined. https://github.com/nrwl/nx/blob/25e3bdde9cad46660db160129b02dbd326d1f7da/packages/nx/src/native/db/mod.rs#L18

Assigning default to opts.dbName wouldn't be correct. We'll lose out on the database name being the machine id.

This definitely has me thinking...

Cammisuli avatar Oct 21 '24 13:10 Cammisuli

Interesting. Well, let me know if I can help you debug in any way.

crowmagnumb avatar Oct 21 '24 16:10 crowmagnumb

I have a potential fix thats in #28544, and I have it published here: 0.0.0-pr-28544-c9de3c0 can you try updating to that and see if the issue is still reproducible for you?

Cammisuli avatar Oct 21 '24 17:10 Cammisuli

Sorry, as I just posted in #28424 I was not explicitly installing nx version 19.8.6 just the @nx/XXX modules. This led to nx version 20.0.2 being installed and with that I was getting this error. Now that I am also explicitly installing nx version 19.8.6 it works fine. Sorry for the confusion. I'm curious why the matching nx is not auto-installed but not going to worry about that. :) So I'm going to close this.

crowmagnumb avatar Oct 22 '24 17:10 crowmagnumb

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

github-actions[bot] avatar Oct 28 '24 00:10 github-actions[bot]