nx: Problem with NX Daemon after update from 15.9.2 to 16.0.3
Current Behavior
After the update to 16.0.3 builds (also tests) sometimes fail with the message Unable to connect to the daemon process. with an error fatal: no path specified (see Failure Logs)
Expected Behavior
The build and test commands should work as expected
GitHub Repo
No response
Steps to Reproduce
- Update from nx version15.9.2 to 16.0.3
- Run
nx reset - Run
nx run-many --all --target=build --skip-nx-cache
Nx Report
> NX Report complete - copy this into the issue template
Node : 18.13.0
OS : linux x64
npm : 8.19.3
Hasher : Native
nx : 16.0.3
@nx/js : 16.0.3
@nx/jest : 16.0.3
@nx/linter : 16.0.3
@nx/workspace : 16.0.3
@nx/angular : 16.0.3
@nx/cypress : 16.0.3
@nx/devkit : 16.0.3
@nx/eslint-plugin : 16.0.3
@nx/nest : 16.0.3
@nx/node : 16.0.3
@nx/storybook : 16.0.3
@nrwl/tao : 16.0.3
@nx/webpack : 16.0.3
typescript : 4.9.5
---------------------------------------
Community plugins:
@storybook/angular : 7.0.8
Failure Logs
➜ time node_modules/.bin/nx run-many --all --target=build --skip-nx-cache
> NX Unable to connect to the daemon process.
Messages from the log:
[NX Daemon Server] - 2023-05-03T11:46:19.868Z - Established a connection. Number of open connections: 1
[NX Daemon Server] - 2023-05-03T11:46:19.869Z - Established a connection. Number of open connections: 2
[NX Daemon Server] - 2023-05-03T11:46:19.870Z - Closed a connection. Number of open connections: 1
[NX Daemon Server] - 2023-05-03T11:46:19.872Z - [REQUEST]: Client Request for Project Graph Received
fatal: no path specified
[NX Daemon Server] - 2023-05-03T11:46:19.932Z - [REQUEST]: Updated file-hasher based on watched changes, recomputing project graph...
[NX Daemon Server] - 2023-05-03T11:46:20.194Z - [REQUEST]: Responding to the client. project-graph
[NX Daemon Server] - 2023-05-03T11:46:20.198Z - Time taken for 'total for creating and serializing project graph' 322.09956800192595ms
[NX Daemon Server] - 2023-05-03T11:46:20.198Z - [WATCHER]: Subscribed to changes within: /home/user
[NX Daemon Server] - 2023-05-03T11:46:20.205Z - Done responding to the client project-graph
[NX Daemon Server] - 2023-05-03T11:46:21.788Z - [REQUEST]: Responding to the client. recordOutputsHash
[NX Daemon Server] - 2023-05-03T11:46:21.789Z - Done responding to the client recordOutputsHash
[NX Daemon Server] - 2023-05-03T11:46:21.923Z - [REQUEST]: Responding to the client. recordOutputsHash
[NX Daemon Server] - 2023-05-03T11:46:21.923Z - Done responding to the client recordOutputsHash
[NX Daemon Server] - 2023-05-03T11:46:21.952Z - [REQUEST]: Responding to the client. recordOutputsHash
[NX Daemon Server] - 2023-05-03T11:46:21.952Z - Done responding to the client recordOutputsHash
[NX Daemon Server] - 2023-05-03T11:46:23.633Z - [WATCHER]: Unsubscribed from changes within: /home/user (sources)
[NX Daemon Server] - 2023-05-03T11:46:23.634Z - [WATCHER]: Unsubscribed from changes within: /home/user (server-process.json)
[NX Daemon Server] - 2023-05-03T11:46:23.634Z - Server stopped because: "Stopping the daemon the set of ignored files changed."
More information: /home/user/node_modules/.cache/nx/d/daemon.log
Pass --verbose to see the stacktrace.
node_modules/.bin/nx run-many --all --target=build --skip-nx-cache 10.32s user 1.49s system 287% cpu 4.109 total
Additional Information
It seems that the error happens more often (not always) after a nx reset
Starting the command mulltiple times helps and after a complete run, consecutive run are successful
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 17
- Comments: 15
I think I have a 3rd related issue w/ the error
Watch error: Daemon closed the connectionoccurring after everygit commitsince upgrading to NX 16.I’m not really sure how to debug since
--verbosegives me no error stack or additional errors. I don’t know how to access the logs from the process where the error is occurring.I’m using executor @nx/js:node
I’m having the same issue (after moving to 16.x):
It often (but not 100% of the time) seems to be right after a watcher line:
With the
@nx/js:nodeexecutor, this is not super convenient if the root cause is files changing, as it is used for the serve task… 😅 Any time a file changes, the process exits:16.5 fixes this issue for me
I can easily reproduce it with these targets:
if you run
echotarget at least twice - you will see the error:I suspect it only happens if the project, you are running the target on, itself has a .gitignore file in it’s root. So while it tries to replace .gitignore file with the same one - it triggers some event, which causes the error.
Have the same issue after upgrading nx to
16.4.0even in a CI, though Nx Daemon should be disabled by default in a CI environment as described in the docs https://nx.dev/more-concepts/nx-daemon#turning-it-offNot sure but on my side it looks like a combination of the @nx/node executor and the Webstorm “Nx Console” plugin (on windows). When i disable the plugin and run it with the command, it runs correctly, but if i turn the plugin on again it closes the existing serve process started with @nx/node.