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 process terminated and closed the connection #19615

Closed
1 of 4 tasks
sunils1607 opened this issue Oct 14, 2023 · 6 comments · Fixed by #19809
Closed
1 of 4 tasks

NX Daemon process terminated and closed the connection #19615

sunils1607 opened this issue Oct 14, 2023 · 6 comments · Fixed by #19809
Assignees
Labels

Comments

@sunils1607
Copy link

sunils1607 commented Oct 14, 2023

Current Behavior

Is any idea about how to resolved (NX Daemon process terminated and closed the connection error). i have tried lot . reset, restore, clear cache, reinstall, migrate, etc. and i have mallualy start the daemon. daemon was started but while run the nx serve command again got the same error. its dosen't work for me. it was totally blocking

NX Daemon process terminated and closed the connection

Please rerun the command, which will restart the daemon.
If you get this error again, check for any errors in the daemon process logs found in: D:\Partnersoft\Dev\Workspace\Thronex\MicroFrontend-NX-Monorepo\thronex\node_modules.cache\nx\d\daemon.log

Daemon.log

[NX Daemon Server] - 2023-10-14T08:59:49.121Z - Started listening on: \.\pipe\nx\C:\Users\sunil\AppData\Local\Temp\d4b9ff6fc420976aea65\d.sock
[NX Daemon Server] - 2023-10-14T08:59:49.126Z - [WATCHER]: Subscribed to changes within: d:\Partnersoft\Dev\Workspace\Thronex\MicroFrontend-NX-Monorepo\thronex (native)
[NX Daemon Server] - 2023-10-14T08:59:49.138Z - Established a connection. Number of open connections: 1
[NX Daemon Server] - 2023-10-14T08:59:49.142Z - Closed a connection. Number of open connections: 0
[NX Daemon Server] - 2023-10-14T08:59:49.143Z - Established a connection. Number of open connections: 1
[NX Daemon Server] - 2023-10-14T08:59:49.146Z - [REQUEST]: Client Request for Project Graph Received
[NX Daemon Server] - 2023-10-14T08:59:49.242Z - [REQUEST]: Updated file-hasher based on watched changes, recomputing project graph...
[NX Daemon Server] - 2023-10-14T08:59:49.244Z - [REQUEST]:
[NX Daemon Server] - 2023-10-14T08:59:49.244Z - [REQUEST]:
thread '' panicked at 'called Result::unwrap() on an Err value: Error { kind: InvalidData, message: "stream did not contain valid UTF-8" }', packages\nx\src\native\plugins\js\ts_import_locators.rs:450:10
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
[NX Daemon Server] - 2023-10-14T09:00:11.943Z - Started listening on: \.\pipe\nx\C:\Users\sunil\AppData\Local\Temp\d4b9ff6fc420976aea65\d.sock
[NX Daemon Server] - 2023-10-14T09:00:11.945Z - [WATCHER]: Subscribed to changes within: D:\Partnersoft\Dev\Workspace\Thronex\MicroFrontend-NX-Monorepo\thronex (native)
[NX Daemon Server] - 2023-10-14T09:00:11.954Z - Established a connection. Number of open connections: 1
[NX Daemon Server] - 2023-10-14T09:00:11.958Z - Established a connection. Number of open connections: 2
[NX Daemon Server] - 2023-10-14T09:00:11.960Z - [REQUEST]: Client Request for Project Graph Received
[NX Daemon Server] - 2023-10-14T09:00:12.023Z - [REQUEST]: Updated file-hasher based on watched changes, recomputing project graph...
[NX Daemon Server] - 2023-10-14T09:00:12.023Z - [REQUEST]:
[NX Daemon Server] - 2023-10-14T09:00:12.023Z - [REQUEST]:
thread '' panicked at 'called Result::unwrap() on an Err value: Error { kind: InvalidData, message: "stream did not contain valid UTF-8" }', packages\nx\src\native\plugins\js\ts_import_locators.rs:450:10
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
[NX Daemon Server] - 2023-10-14T09:01:59.435Z - Started listening on: \.\pipe\nx\C:\Users\sunil\AppData\Local\Temp\d4b9ff6fc420976aea65\d.sock
[NX Daemon Server] - 2023-10-14T09:01:59.447Z - [WATCHER]: Subscribed to changes within: D:\Partnersoft\Dev\Workspace\Thronex\MicroFrontend-NX-Monorepo\thronex (native)
[NX Daemon Server] - 2023-10-14T09:01:59.449Z - Established a connection. Number of open connections: 1
[NX Daemon Server] - 2023-10-14T09:01:59.450Z - Established a connection. Number of open connections: 2
[NX Daemon Server] - 2023-10-14T09:01:59.453Z - [REQUEST]: Client Request for Project Graph Received
[NX Daemon Server] - 2023-10-14T09:01:59.510Z - [REQUEST]: Updated file-hasher based on watched changes, recomputing project graph...
[NX Daemon Server] - 2023-10-14T09:01:59.510Z - [REQUEST]:
[NX Daemon Server] - 2023-10-14T09:01:59.510Z - [REQUEST]:
thread '' panicked at 'called Result::unwrap() on an Err value: Error { kind: InvalidData, message: "stream did not contain valid UTF-8" }', packages\nx\src\native\plugins\js\ts_import_locators.rs:450:10
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
[NX Daemon Server] - 2023-10-14T09:18:48.103Z - Started listening on: \.\pipe\nx\C:\Users\sunil\AppData\Local\Temp\d4b9ff6fc420976aea65\d.sock
[NX Daemon Server] - 2023-10-14T09:18:48.105Z - [WATCHER]: Subscribed to changes within: D:\Partnersoft\Dev\Workspace\Thronex\MicroFrontend-NX-Monorepo\thronex (native)
[NX Daemon Server] - 2023-10-14T09:18:48.112Z - Established a connection. Number of open connections: 1
[NX Daemon Server] - 2023-10-14T09:18:48.114Z - Established a connection. Number of open connections: 2
[NX Daemon Server] - 2023-10-14T09:18:48.116Z - Closed a connection. Number of open connections: 1
[NX Daemon Server] - 2023-10-14T09:18:48.120Z - [REQUEST]: Client Request for Project Graph Received
[NX Daemon Server] - 2023-10-14T09:18:48.188Z - [REQUEST]: Updated file-hasher based on watched changes, recomputing project graph...
[NX Daemon Server] - 2023-10-14T09:18:48.188Z - [REQUEST]:
[NX Daemon Server] - 2023-10-14T09:18:48.188Z - [REQUEST]:
thread '' panicked at 'called Result::unwrap() on an Err value: Error { kind: InvalidData, message: "stream did not contain valid UTF-8" }', packages\nx\src\native\plugins\js\ts_import_locators.rs:450:10
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

NX version :16.10.0

Expected Behavior

Run or Serve the host or remote application

NX version :16.10.0

GitHub Repo

No response

Steps to Reproduce

While running the project we got the error (NX Daemon process terminated and closed the connection error).

NX version :16.10.0

Nx Report

Not able to generate. while running the nx report also getting some error (NX   Daemon process terminated and closed the connection error).

Failure Logs

No response

Package Manager Version

No response

Operating System

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

Additional Information

No response

@sunils1607 sunils1607 changed the title NX Daemon process terminated and closed the connection error NX Daemon process terminated and closed the connection Oct 14, 2023
@ggagosh
Copy link

ggagosh commented Oct 14, 2023

I also have this kind of problem after upgrading to the latest version, but it appears only during Github ci

image

I can't reproduce it on my local machine, I also tried to reproduce it with the same OS: Ubuntu 22.04.3 and Node: v18.18.0 and this blocks me from updating the new version.

@Den-dp
Copy link
Contributor

Den-dp commented Oct 14, 2023

In my case it was caused by strange special characters in JS file

Example:

> cat PieSerie.js
// �

> Format-Hex PieSerie.js

           00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F

00000000   2F 2F 20 EF BF BD 0A                             // �.

Such causes an error here:

fn process_file((source_project, file_path): (&String, &String)) -> Option<ImportResult> {
let now = Instant::now();
let cm = Arc::<SourceMap>::default()
.load_file(Path::new(file_path))
.unwrap();

@AgentEnder AgentEnder added the scope: core core nx functionality label Oct 16, 2023
@Cammisuli
Copy link
Member

This is interesting.. How are these characters being added to these files?

The best thing we can do is handle the error better, but if the files arent in utf-8 then we can't do much otherwise.

@nocnokneo
Copy link
Contributor

I'm getting the same error and, like @ggagosh , only inside my container. Thanks to the logging improvement in #19809 I can see that the problematic file is /home/tbj/git/cyto/env/share/terminfo/x/xterm.js. Why is Nx scanning compiled binary files in the terminfo database?

@Cammisuli
Copy link
Member

@nocnokneo Nx will build the project graph based on the root of the repo (where the nx.json file is). If these files arent part of gitingnore, add them to .nxignore.

There's additional handling for js and ts files where we find imports to build out the dependencies. Because this particular file is a .js one, Nx will try to build out the dependency tree.

Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants