Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NX daemon doesn't create dir if NX_DAEMON_SOCKET_DIR is set #23002

Closed
1 of 4 tasks
MarcusElevait opened this issue Apr 25, 2024 · 1 comment · Fixed by #23071
Closed
1 of 4 tasks

NX daemon doesn't create dir if NX_DAEMON_SOCKET_DIR is set #23002

MarcusElevait opened this issue Apr 25, 2024 · 1 comment · Fixed by #23071
Assignees
Labels
scope: core core nx functionality type: bug

Comments

@MarcusElevait
Copy link

Current Behavior

When setting a custom dir for the nx daemon socket with NX_DAEMON_SOCKET_DIR, the dir has to be there, when starting the daemon. Otherwise it throws the error:
`node:events:496
throw er; // Unhandled 'error' event
^

Error: listen EACCES: permission denied /home/marcus/Projects/aicosy/.nx-daemon/d.sock
at Server.setupListenHandle [as _listen2] (node:net:1855:21)
at listenInCluster (node:net:1920:12)
at Server.listen (node:net:2025:5)
at /home/marcus/Projects/aicosy/node_modules/nx/src/daemon/server/server.js:279:20
at new Promise ()
at startServer (/home/marcus/Projects/aicosy/node_modules/nx/src/daemon/server/server.js:277:12)
at async /home/marcus/Projects/aicosy/node_modules/nx/src/daemon/server/start.js:8:9
Emitted 'error' event on Server instance at:
at emitErrorNT (node:net:1899:8)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
code: 'EACCES',
errno: -13,
syscall: 'listen',
address: '/home/marcus/Projects/aicosy/.nx-daemon/d.sock',
port: -1
}`

The problem is, that nx reset automatically deletes the dir, thus everytime running nx reset you have to remember creating the dir again.

Expected Behavior

I'd expect, that the daemon creates the dir for the socket automatically.

GitHub Repo

No response

Steps to Reproduce

  1. set NX_DAEMON_SOCKET_DIR to a custom dir like .nx-daemon
  2. run nx reset
  3. run nx daemon --start
  4. look in the daemon.log

Nx Report

Node   : 20.11.0
OS     : linux-x64
npm    : 10.2.4

nx (global)        : 18.0.8
nx                 : 18.2.1
@nx/js             : 18.2.1
@nx/jest           : 18.2.1
@nx/linter         : 18.2.1
@nx/eslint         : 18.2.1
@nx/workspace      : 18.2.1
@nx/angular        : 18.2.1
@nx/cypress        : 18.2.1
@nx/devkit         : 18.2.1
@nx/esbuild        : 18.2.1
@nx/eslint-plugin  : 18.2.1
@nx/nest           : 18.2.1
@nx/node           : 18.2.1
@nx/playwright     : 18.2.1
@nx/plugin         : 18.2.1
@nx/storybook      : 18.2.1
@nrwl/tao          : 18.2.1
@nx/web            : 18.2.1
@nx/webpack        : 18.2.1
typescript         : 5.4.3
---------------------------------------
Community plugins:
@datorama/akita       : 2.2.4
@ngrx/component-store : 17.0.1
@ngrx/effects         : 17.0.1
@ngrx/entity          : 17.0.1
@ngrx/router-store    : 17.0.1
@ngrx/schematics      : 17.0.1
@ngrx/store           : 17.0.1
@ngrx/store-devtools  : 17.0.1
@rx-angular/cdk       : 16.0.0
@rx-angular/template  : 16.1.2
@storybook/angular    : 7.6.17
ng-mocks              : 14.12.2
---------------------------------------
Local workspace plugins:
         @aicosy/nx-tools

Failure Logs

No response

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

@MarcusElevait
Copy link
Author

Wow, thanks for the fast fix 👍🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: core core nx functionality type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants