Open robertIsaac opened 1 year ago
I have the same issue since last night. Commands fail randomly on windows. I attached the daemon.log. daemon.log
We ran a migration from 16.5.4 to 16.8.1, then ran a task executor that clears the local caches manually, runs nx reset
, then runs new builds using concurrency and remote caching.
At least half of the machines that ran the migration had this issue. We fixed by simply restarting the daemon explicitly with nx daemon --start
and --stop
.
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! ๐
Any updates?
Is this resolved or does nx have its way of achieving what concurrently packages provide?
Is this resolved or does nx have its way of achieving what concurrently packages provide?
Neither
And even some things that was working before, stopped working now
Like nx run-many serve
it stopped working in nx 18.0
IDK if this is also the same thing but I've landed here after I bound my host dir (my monorepo) into the docker and ran nx serve backend
inside the container (CMD ["nx", "serve", "backend", "--skip-nx-cache"]
) and after that I executed nx sleep backend-e2e
in my terminal (notice that it is happening outside of docker and in my bash terminal).
OS: Linux, Nx version: 18.0.7
apps/backend-e2e/project.json
// ...
"sleep": {
"command": "sleep 20"
}
// ...
My intention was to just see if it is behaving the same way no matter what is the command.
apps/backend/project.json
// ...
"serve": {
"executor": "@nx/js:node",
"defaultConfiguration": "development",
"options": {
"buildTarget": "backend:build"
},
"configurations": {
"development": {
"buildTarget": "backend:build:development"
},
"production": {
"buildTarget": "backend:build:production"
}
}
},
// ...
It is pretty much the normal stuff. Any idea on exactly why is this happening?
daemon.log
[NX Daemon Server] - 2024-03-31T08:52:38.929Z - Started listening on: /tmp/f53b52ad6d21cceb72df/d.sock
[NX Daemon Server] - 2024-03-31T08:52:38.933Z - [WATCHER]: Subscribed to changes within: /app (native)
[NX Daemon Server] - 2024-03-31T08:52:38.938Z - Established a connection. Number of open connections: 1
[NX Daemon Server] - 2024-03-31T08:52:38.942Z - Established a connection. Number of open connections: 2
[NX Daemon Server] - 2024-03-31T08:52:38.947Z - Closed a connection. Number of open connections: 1
[NX Daemon Server] - 2024-03-31T08:52:38.950Z - [REQUEST]: Client Request for Project Graph Received
[NX Daemon Server] - 2024-03-31T08:52:38.952Z - [REQUEST]: Updated workspace context based on watched changes, recomputing project graph...
[NX Daemon Server] - 2024-03-31T08:52:38.952Z - [REQUEST]:
[NX Daemon Server] - 2024-03-31T08:52:38.952Z - [REQUEST]:
[NX Daemon Server] - 2024-03-31T08:52:38.977Z - [WATCHER]: .nx/cache/d/server-process.json was modified
[NX Daemon Server] - 2024-03-31T08:52:38.981Z - [WATCHER]: Stopping the watcher for /home/kasir/projects/you-say (sources)
[NX Daemon Server] - 2024-03-31T08:52:38.987Z - [WATCHER]: Stopping the watcher for /home/kasir/projects/you-say (outputs)
[NX Daemon Server] - 2024-03-31T08:52:38.987Z - Server stopped because: "this process is no longer the current daemon (native)"
[NX Daemon Server] - 2024-03-31T08:52:40.303Z - [REQUEST]: Responding to the client. project-graph
[NX Daemon Server] - 2024-03-31T08:52:40.305Z - Time taken for 'total for creating and serializing project graph' 1353.3187549998984ms
[NX Daemon Server] - 2024-03-31T08:52:40.320Z - Done responding to the client project-graph
[NX Daemon Server] - 2024-03-31T08:52:40.321Z - Handled REQUEST_PROJECT_GRAPH. Handling time: 1353. Response time: 18.
[NX Daemon Server] - 2024-03-31T08:52:40.337Z - Established a connection. Number of open connections: 2
[NX Daemon Server] - 2024-03-31T08:52:42.287Z - [WATCHER]: Processing file changes in outputs
[NX Daemon Server] - 2024-03-31T08:52:43.817Z - [WATCHER]: Processing file changes in outputs
[NX Daemon Server] - 2024-03-31T08:52:43.870Z - [WATCHER]: Processing file changes in outputs
[NX Daemon Server] - 2024-03-31T08:52:43.924Z - [WATCHER]: Processing file changes in outputs
[NX Daemon Server] - 2024-03-31T08:52:45.824Z - [WATCHER]: Processing file changes in outputs
[NX Daemon Server] - 2024-03-31T08:52:50.754Z - [WATCHER]: Processing file changes in outputs
[NX Daemon Server] - 2024-03-31T08:53:17.051Z - Started listening on: /tmp/06cbc0145e488774ca70/d.sock
[NX Daemon Server] - 2024-03-31T08:53:17.055Z - [WATCHER]: Subscribed to changes within: /home/kasir/projects/you-say (native)
[NX Daemon Server] - 2024-03-31T08:53:17.063Z - Established a connection. Number of open connections: 1
[NX Daemon Server] - 2024-03-31T08:53:17.065Z - Established a connection. Number of open connections: 2
[NX Daemon Server] - 2024-03-31T08:53:17.068Z - Closed a connection. Number of open connections: 1
[NX Daemon Server] - 2024-03-31T08:53:17.070Z - [REQUEST]: Client Request for Project Graph Received
[NX Daemon Server] - 2024-03-31T08:53:17.071Z - [REQUEST]: Updated workspace context based on watched changes, recomputing project graph...
[NX Daemon Server] - 2024-03-31T08:53:17.072Z - [REQUEST]:
[NX Daemon Server] - 2024-03-31T08:53:17.072Z - [REQUEST]:
[NX Daemon Server] - 2024-03-31T08:53:17.100Z - [WATCHER]: .nx/cache/d/server-process.json was modified
[NX Daemon Server] - 2024-03-31T08:53:17.102Z - Time taken for 'changed-projects' 0.9088389999233186ms
[NX Daemon Server] - 2024-03-31T08:53:17.102Z - [WATCHER]: Stopping the watcher for /app (sources)
[NX Daemon Server] - 2024-03-31T08:53:17.108Z - [WATCHER]: Stopping the watcher for /app (outputs)
[NX Daemon Server] - 2024-03-31T08:53:17.108Z - Server stopped because: "this process is no longer the current daemon (native)"
[NX Daemon Server] - 2024-03-31T08:53:18.317Z - [REQUEST]: Responding to the client. project-graph
[NX Daemon Server] - 2024-03-31T08:53:18.318Z - Time taken for 'total for creating and serializing project graph' 1246.9035809999332ms
[NX Daemon Server] - 2024-03-31T08:53:18.320Z - Done responding to the client project-graph
[NX Daemon Server] - 2024-03-31T08:53:18.320Z - Handled REQUEST_PROJECT_GRAPH. Handling time: 1247. Response time: 3.
[NX Daemon Server] - 2024-03-31T08:53:18.389Z - [REQUEST]: Responding to the client. handleHashTasks
[NX Daemon Server] - 2024-03-31T08:53:18.390Z - Done responding to the client handleHashTasks
[NX Daemon Server] - 2024-03-31T08:53:18.390Z - Handled HASH_TASKS. Handling time: 26. Response time: 1.
[NX Daemon Server] - 2024-03-31T08:53:38.669Z - [REQUEST]: Responding to the client. recordOutputsHash
[NX Daemon Server] - 2024-03-31T08:53:38.669Z - Done responding to the client recordOutputsHash
[NX Daemon Server] - 2024-03-31T08:53:38.669Z - Handled RECORD_OUTPUTS_HASH. Handling time: 0. Response time: 1.
[NX Daemon Server] - 2024-03-31T08:53:38.680Z - Closed a connection. Number of open connections: 0
And here is what I mean by binding my host dir into docker container:
dev.Dockerfile
FROM docker.io/node:20.10.0-alpine
USER 1000:1000
WORKDIR /app
RUN chown -R 1000:1000 /app
EXPOSE 3001
CMD ["npx" ,"nx", "serve", "backend", "--skip-nx-cache"]
docker-compose.yml
:version: "3"
services:
# ...
backend:
image: backend-image:dev
container_name: backend-container
build:
context: .
dockerfile: ./apps/backend/dev.Dockerfile
volumes:
- type: bind
source: .
target: /app
volume:
nocopy: true
# ...
Hey!
Thanks for the report and especially thank you for the reproduction. I could repro with it.
However, I tried again on the latest version of Nx on both MacOS & Windows and could run multiple npm scripts that use nx affected
with concurrently
without problem. So I think the issue is fixed on the latest version.
If it still happens for you, please let me know with another repro and I'll have a look :)
hi @MaxKless it still happens with me I have updated the reprod repo to latest nx (19.0) and it still happens
> @daemon-process-terminated-reprod/source@0.0.0 ci
> concurrently npm:test npm:lint npm:build
[lint]
[lint] > @daemon-process-terminated-reprod/source@0.0.0 lint
[lint] > nx affected --target=lint --quiet
[lint]
[build]
[build] > @daemon-process-terminated-reprod/source@0.0.0 build
[build] > nx build
[build]
[test]
[test] > @daemon-process-terminated-reprod/source@0.0.0 test
[test] > nx affected --target=test --coverage --parallel=false
[test]
[test]
[build]
[build] NX Missing Platform Dependency
[build]
[build] The Nx CLI could not find or load the native binary for your supported platform (win32-x64).
[build] This likely means that optional dependencies were not installed correctly, or your system is missing some system dependencies.
[build] For more information please see https://nx.dev/troubleshooting/troubleshoot-nx-install-issues
[build]
[test] NX Missing Platform Dependency
[test]
[test] The Nx CLI could not find or load the native binary for your supported platform (win32-x64).
[test] This likely means that optional dependencies were not installed correctly, or your system is missing some system dependencies.
[test] For more information please see https://nx.dev/troubleshooting/troubleshoot-nx-install-issues
[test]
[test] npm run test exited with code 1
[lint]
[lint] NX Affected criteria defaulted to --base=master --head=HEAD
[lint]
[build] npm run build exited with code 1
[lint]
[lint] NX No projects with target lint for 0 projects were run
[lint]
[lint]
[lint]
[lint]
[lint] NX Successfully ran target lint for 0 projects
[lint]
[lint]
[lint] npm run lint exited with code 0
Process finished with exit code 1
you can see that lint succeeded because it was the first task, build and test failed
Hmmm interesting, it's throwing a completely different error now. Did you go through the troubleshooting steps linked in the error message?
Hmmm interesting, it's throwing a completely different error now. Did you go through the troubleshooting steps linked in the error message?
It's not a totally different error, it's just different error No I didn't check the link since I know the root cause Re running the command will yield positive result
The root cause still that nx daemon doesn't work with concurrent
ok can you update the repro above with the latest versions so I can see the same error you're seeing?
ok can you update the repro above with the latest versions so I can see the same error you're seeing?
It's updated now to v19
This issue has been automatically marked as stale because no results of retrying on the latest version of Nx was provided within 7 days. It will be closed in 21 days if no results are provided. If the issue is still present, please reply to keep it active. If the issue was not present, please close this issue. Thanks for being a part of the Nx community! ๐
Hi @MaxKless can you please remove the tag retry with latest since it's already done
Current Behavior
when launching two nx jobs using
concurrently
to work in parallel, it throw the following error for all of themServer stopped because: "this process is no longer the current daemon"
Expected Behavior
for it to work fine
GitHub Repo
https://github.com/robertIsaac/daemon-process-terminated-reprod
Steps to Reproduce
npm ci
npx nx reset
npm run ci
or just create any new project, install concurrently, and make it run any two nx jobs like
concurrently npm:build npm:test
Nx Report
Failure Logs
Operating System
Additional Information
nx lint
thennpm run ci
it will work, but if then tried to runnx reset
it will fail saying it's in use, I think one or more of the three process actually doesn't terminate, this can cause memory leaks