nx: NX Daemon server erroring out after moving to 13.7.1
I upgraded our workspace to latest NX version (13.7.1). However, I am getting following error with NX Daemon server
> NX Nx Daemon was not able to compute the project graph.
Here is the detailed log:
Messages from the log:
[NX Daemon Server] - 2022-01-31T22:54:54.560Z - Time taken for 'incremental hashing' 0.008351ms
[NX Daemon Server] - 2022-01-31T22:54:54.560Z - Error detected when recomputing project file map: ENOENT: no such file or directory, open '/Users/utsav.kapoor/thoughtspot/node_modules/@nrwl/workspace/presets/npm.json'
[NX Daemon Server] - 2022-01-31T22:54:57.389Z - [WATCHER]: 1 file(s) created or restored, 0 file(s) modified, 1 file(s) deleted
[NX Daemon Server] - 2022-01-31T22:54:57.709Z - Time taken for 'hash changed files from watcher' 118.756722ms
[NX Daemon Server] - 2022-01-31T22:54:57.709Z - Time taken for 'incremental hashing' 0.048084ms
[NX Daemon Server] - 2022-01-31T22:54:57.710Z - Error detected when recomputing project file map: ENOENT: no such file or directory, open '/Users/utsav.kapoor/thoughtspot/node_modules/@nrwl/workspace/presets/npm.json'
[NX Daemon Server] - 2022-01-31T22:55:01.667Z - Time taken for 'init hashing' 3956.459025ms
[NX Daemon Server] - 2022-01-31T22:55:03.502Z - Time taken for 'init hashing' 5791.451747ms
[NX Daemon Server] - 2022-01-31T23:06:33.319Z - [WATCHER]: js/ts-packages/create-ts-app/bin/create-ts-app was modified
[NX Daemon Server] - 2022-01-31T23:06:33.554Z - Time taken for 'hash changed files from watcher' 130.294604ms
[NX Daemon Server] - 2022-01-31T23:06:33.554Z - Time taken for 'incremental hashing' 0.117201ms
[NX Daemon Server] - 2022-01-31T23:06:33.619Z - [REQUEST]: Updated file-hasher based on watched changes, recomputing project graph...
[NX Daemon Server] - 2022-01-31T23:06:34.204Z - Time taken for 'read cache' 150.347964ms
[NX Daemon Server] - 2022-01-31T23:06:34.496Z - Time taken for 'build project graph' 165.5334ms
[NX Daemon Server] - 2022-01-31T23:06:34.516Z - Time taken for 'write cache' 19.723137ms
[NX Daemon Server] - 2022-01-31T23:06:34.516Z - Time taken for 'total execution time for createProjectGraph()' 494.093343ms
[NX Daemon Server] - 2022-01-31T23:06:34.595Z - Time taken for 'serialize graph' 79.272129ms
[NX Daemon Server] - 2022-01-31T23:07:45.573Z - [WATCHER]: Unsubscribed from changes within: /Users/utsav.kapoor/thoughtspot
[NX Daemon Server] - 2022-01-31T23:07:45.573Z - Server stopped because: "Lock file changed"```
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 21
- Comments: 109 (3 by maintainers)
Commits related to this issue
- Update is-ci.ts This takes care of https://github.com/nrwl/nx/issues/8796. in CI mode, you shouldn't be running Nx Daemon to check on graphs while building your apps. Source: https://github.com... — committed to ErickRodrCodes/nx by deleted user 2 years ago
- fix(core): fix local error : https://github.com/nrwl/nx/issues/8796#issuecomment-1349316444 — committed to betagouv/api-subventions-asso by alice-telescoop 2 years ago
- build: :green_heart: disable nx deamon disabled nx deamon for a bug related to it https://github.com/nrwl/nx/issues/8796 — committed to nabla-studio/nablajs by DavideSegullo 2 years ago
Ok, I found some docs on the Daemon: https://nx.dev/guides/nx-daemon
The workaround:
export NX_DAEMON=false;or in nx.json in tasksRunnerOptions.options you can disable the daemon:"useDaemonProcess": false.Happy to help debugging this and enable the daemon anytime to tests fixes!
I was able to fix this with
npm i -g nxThis happens to me after updating nx but only on ubuntu linux (my macos setup is fine). Disabling the nx daemon “fixes” the issue but this should definitely be fixed
This did not fix it for me
Hi,
I was also facing the “NX Bad file descriptor” issue with latest nx “15.8.7” (I have upgraded to see if issue was fixed with no luck).
tl;dr:
–
I was doing ok using the useDaemonProcess: false setting on nx.json. But "NX Bad file descriptor, would keep showing up eventually 😑
I have researched into nx code, coming to the conclusion that the error “Bad file descriptor” error comes from @parcel/watcher package.
This package watches for FS changes, except for .gitignore / .nxignore exceptions.
This issue on @parcel/watcher has put me on the track…
I have checked and some of the files on my docker/volumes folder belongs to other users.
My .gitignore file looked like this
Changing it to this:
just made the “Bad file descriptor” disappear 🥳🥳🥳.
Hope it helps someone since at least to me, it is a very frustrating error.
nothing? even with the latest version it keep stopping
Exactly the same issue since I clean my node_modules, fresh
yarn installand now impossible to start nx command.EDIT: Found a way to make it work again:
But if I close my terminal (or in another terminal tabs) I have same issues:
NX Bad file descriptorThe JSON seems not be complete:
For me it is a permission issue on Ubuntu. I had a standard node on which running nx commands with sudo worked fine but without i had this daemon issue. Now i’m trying to use a local install with nvm and thus i can’t sudo anymore and the only way is to deactivate daemon with NX_DAEMON=false
The solution is quite simple and it is related to CI.
If you are building stuff in your pipeline and
export NX_DAEMON=false; or in nx.json in tasksRunnerOptions.options you can disable the daemon: "useDaemonProcess": false.does not work, the solution is using CI option.you can use cross-env and use as follows:
That gave me a clean build without running the nx daemon at all.
works on nx 14 and nx 15.3:
People accept every “solution” that is removing the error messages… but maybe this Deamon thing has any reason to be implemented? maybe its not smart to just disable it? i still hope that someone from NX team care about this ticket any day.
We have the same issue but only in the docker compilation:
No errors inside daemon-error.log
No errors inside daemon.log
For me, after updating to 13.8.5 and re-install globally (
npm i -g nx@13.8.5) I no longer have the errorSimilar issue (I think).
Logs:
More logs:
Nx report:
I created the issue here: https://github.com/nrwl/nx/issues/19823
If you have any more information above the above issue, please add it there. If anyone has OTHER issues regarding the daemon, please report a new issue.
Thanks everyone, we’ll get this resolved soon!
Maybe this will be addressed with #16915?
Still broken on linux after upgrading to Nx 15.0.13
This reply by @Nightbr seem to be working for me , thank you for the support sir!
the error seems to come from this pice of code https://github.com/nrwl/nx/blob/53a0528d7a2b5c385f941a66ecf6359a060fa7fb/packages/workspace/src/core/project-graph/daemon/client/client.ts#L175-L220
Up
In my case, I mount database data volumn of db image to a local folder, and that folder is created with sudo right. when I start application with nx serve, it has this error. Worked after I fix the access right of my local folder
Super random - been using NX for about a year, just started using Docker/containers about 2 mths ago - today I started getting this error with the projecr graph and my nx builds fail in Docker
Fedora, using the latest version
up
up
Upgraded to node v16.14 + Nx 14.5.4, clear node_modules and reinstall still have the error:
WORKAROUND:
In nx.json you can still disable the daemonProcess:
I noticed that this error happened when I have quite a lot (~1000) of uncommited changes.
@FrozenPandaz - No it does not. I had to turn off daemon server locally for commands to run again
Does running
nx resetfix the issue?