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 console stuck on refreshing workspace on Intellij #2337

Open
beaussan opened this issue Dec 2, 2024 · 7 comments
Open

Nx console stuck on refreshing workspace on Intellij #2337

beaussan opened this issue Dec 2, 2024 · 7 comments
Labels
type: bug Something isn't working

Comments

@beaussan
Copy link

beaussan commented Dec 2, 2024

Current Behavior

Intellij is stuck on "Refreshing workspace"

Expected Behavior

The refresh workspace either errors out, or actually finish

Steps to Reproduce

I can't have a clear reproduction, as it's a random issues. It happens on any nx monorepo that uses inference, and maybe others that don't

I would love to have more logs (or know how to access them) to have a better idea of what is going on

Failure Logs / Images / Videos

Image

Environment

  • Nx Console version: Intellij 2024.3 on 1.33.0

 NX   Report complete - copy this into the issue template

Node           : 20.11.1
OS             : darwin-arm64
Native Target  : aarch64-macos
yarn           : 4.3.1

nx                 : 20.1.2
@nx/js             : 20.1.2
@nx/jest           : 20.1.2
@nx/eslint         : 20.1.2
@nx/workspace      : 20.1.2
@nx/cypress        : 20.1.2
@nx/devkit         : 20.1.2
@nx/eslint-plugin  : 20.1.2
@nx/playwright     : 20.1.2
@nx/plugin         : 20.1.2
@nx/react          : 20.1.2
@nx/storybook      : 20.1.2
@nx/vite           : 20.1.2
@nx/web            : 20.1.2
@nx/webpack        : 20.1.2
typescript         : 5.5.4

---------------------------------------
Nx Powerpack
Licensed to Payfit for 90 users in 1 workspace until 4/30/2025


---------------------------------------
Registered Plugins:
./tools/nx-tools/src/plugins/main.ts
---------------------------------------
Community plugins:
rxjs : 6.6.7
---------------------------------------
Local workspace plugins:
	 @payfit/nx-tools

@beaussan beaussan added the type: bug Something isn't working label Dec 2, 2024
@MaxKless
Copy link
Collaborator

MaxKless commented Dec 3, 2024

Here's how you access the best logs:
Go to Help > Diagnostic Tools > Debug Log Settings... and then insert #dev.nx.console:trace. Then paste the idea.log or sections of it when the error happens. You can get to it via Help -> Open log in Editor

Do you have an idea about how we could surface this information better to people? Maybe a Help section somewhere with instructions or an action that does this automatically somehow...

@beaussan
Copy link
Author

beaussan commented Dec 9, 2024

Hello! Thanks for the info on how to debug!

Do you have an idea about how we could surface this information better to people? Maybe a Help section somewhere with instructions or an action that does this automatically somehow...

Maybe in the issue template ?

In the meanwhile, here is the logs (filtered to remove telemetry + non nx logs) I found after it popped up again today:

2024-12-09 08:09:11,540 [2433946]   INFO - #dev.nx.console.generate.ui.file.V2NxGenerateUiFile - received message GenerateUiRequestValidationOutputMessage(payloadType=request-validation)
2024-12-09 08:09:11,540 [2433946]   INFO - #dev.nx.console.generate.ui.file.NxGenerateUiFile - posting message {"payloadType":"validation-results","payload":{}}
2024-12-09 08:09:12,052 [2434458]   INFO - #dev.nx.console.generate.ui.file.V2NxGenerateUiFile - received message GenerateUiRunGeneratorOutputMessage(payloadType=run-generator, payload=GenerateUiRunGeneratorPayload(positional=@nx/plugin:plugin, flags=[--directory=tools/my-plugin, --linter=eslint, --no-interactive, --dry-run], cwd=null))
2024-12-09 08:09:12,053 [2434459]   INFO - #dev.nx.console.utils.NxExecutable - Checking if there is standalone nx
2024-12-09 08:09:12,054 [2434460]   INFO - #dev.nx.console.utils.NxExecutable - Using /Users/nicolasbeaussart-hatchuel/work/payfit/expr/nx-reference-react-devkit/node_modules/.bin as base to find local nx binary
2024-12-09 08:09:24,652 [2447058]   INFO - #dev.nx.console.generate.ui.file.V2NxGenerateUiFile - received message GenerateUiRequestValidationOutputMessage(payloadType=request-validation)
2024-12-09 08:09:24,652 [2447058]   INFO - #dev.nx.console.generate.ui.file.NxGenerateUiFile - posting message {"payloadType":"validation-results","payload":{}}
2024-12-09 08:09:25,158 [2447564]   INFO - #dev.nx.console.generate.ui.file.V2NxGenerateUiFile - received message GenerateUiRunGeneratorOutputMessage(payloadType=run-generator, payload=GenerateUiRunGeneratorPayload(positional=@nx/plugin:plugin, flags=[--directory=tools/my-plugin, --linter=eslint, --unitTestRunner=none, --no-interactive, --dry-run], cwd=null))
2024-12-09 08:09:25,158 [2447564]   INFO - #dev.nx.console.utils.NxExecutable - Checking if there is standalone nx
2024-12-09 08:09:25,158 [2447564]   INFO - #dev.nx.console.utils.NxExecutable - Using /Users/nicolasbeaussart-hatchuel/work/payfit/expr/nx-reference-react-devkit/node_modules/.bin as base to find local nx binary
2024-12-09 08:09:40,846 [2463252]   INFO - #dev.nx.console.generate.ui.file.V2NxGenerateUiFile - received message GenerateUiRunGeneratorOutputMessage(payloadType=run-generator, payload=GenerateUiRunGeneratorPayload(positional=@nx/plugin:plugin, flags=[--directory=tools/my-plugin, --linter=eslint, --unitTestRunner=none, --no-interactive], cwd=null))
2024-12-09 08:09:40,846 [2463252]   INFO - #dev.nx.console.utils.NxExecutable - Checking if there is standalone nx
2024-12-09 08:09:40,847 [2463253]   INFO - #dev.nx.console.utils.NxExecutable - Using /Users/nicolasbeaussart-hatchuel/work/payfit/expr/nx-reference-react-devkit/node_modules/.bin as base to find local nx binary
2024-12-09 08:09:45,805 [2468211]  FINER - #dev.nx.console.nxls.NxlsProcess - Nxls early exit: process.exit called with code 1
2024-12-09 08:09:45,805 [2468211]   INFO - #dev.nx.console.nxls.NxlsWrapper - Stopping nxls
2024-12-09 08:09:45,806 [2468212]   INFO - #dev.nx.console.nxls.NxlsWrapper - Unable to send messages to the nxls, the process has exited
2024-12-09 08:09:45,806 [2468212]   INFO - #dev.nx.console.nxls.NxlsWrapper - Disconnected file:///Users/nicolasbeaussart-hatchuel/work/payfit/expr/nx-reference-react-devkit/package.json
2024-12-09 08:09:45,806 [2468212]   INFO - #dev.nx.console.nxls.NxlsWrapper - Unable to send messages to the nxls, the process has exited
2024-12-09 08:09:45,806 [2468212]   INFO - #dev.nx.console.nxls.NxlsWrapper - Disconnected file:///Users/nicolasbeaussart-hatchuel/work/payfit/expr/nx-reference-react-devkit/nx.json
2024-12-09 08:09:45,806 [2468212]   INFO - #dev.nx.console.nxls.NxlsWrapper - Unable to send messages to the nxls, the process has exited
2024-12-09 08:09:45,806 [2468212]   INFO - #dev.nx.console.nxls.NxlsWrapper - Disconnected file:///Users/nicolasbeaussart-hatchuel/work/payfit/expr/nx-reference-react-devkit/packages/ui/kit/package.json
2024-12-09 08:09:45,806 [2468212]   INFO - #dev.nx.console.nxls.NxlsWrapper - Unable to send messages to the nxls, the process has exited
2024-12-09 08:09:45,806 [2468212]  FINER - #dev.nx.console.nxls.NxlsWrapper - Sending request to nxls: shutdown (null)
2024-12-09 08:09:45,806 [2468212]   INFO - #dev.nx.console.nxls.NxlsWrapper - Unable to send messages to the nxls, the process has exited
2024-12-09 08:09:46,810 [2469216]   INFO - #dev.nx.console.nxls.NxlsWrapper - Unable to send messages to the nxls, the process has exited
2024-12-09 08:09:46,810 [2469216]   INFO - #dev.nx.console.nxls.NxlsWrapper - Unable to send messages to the nxls, the process has exited
2024-12-09 08:09:46,810 [2469216]   INFO - #dev.nx.console.nxls.NxlsProcess - stopping nxls process
2024-12-09 08:09:46,810 [2469216]   INFO - #dev.nx.console.nxls.NxlsProcess - process is not alive
2024-12-09 08:09:46,810 [2469216]   INFO - #dev.nx.console.nxls.NxlsProcess - Process exited: true
2024-12-09 08:16:43,853 [2886259]   INFO - #dev.nx.console.listeners.NxEditorListener - Connecting /Users/nicolasbeaussart-hatchuel/work/payfit/expr/nx-reference-react-devkit/packages/utils/package.json to lsp
2024-12-09 08:16:43,853 [2886259]   INFO - #dev.nx.console.nxls.NxlsWrapper - Nxls not ready for documents yet.. 
2024-12-09 08:16:43,863 [2886269]  FINER - #dev.nx.console.nxls.NxlsWrapper - Sending request to nxls: nx/workspace (NxWorkspaceRequest(reset=false))
2024-12-09 08:16:43,863 [2886269]   INFO - #dev.nx.console.nxls.NxlsWrapper - Unable to send messages to the nxls, the process has exited
2024-12-09 08:16:44,275 [2886681]  FINER - #dev.nx.console.nxls.NxlsWrapper - Sending request to nxls: nx/workspace (NxWorkspaceRequest(reset=false))
2024-12-09 08:16:44,275 [2886681]   INFO - #dev.nx.console.nxls.NxlsWrapper - Unable to send messages to the nxls, the process has exited
2024-12-09 08:16:46,770 [2889176]   INFO - #dev.nx.console.completion.NxCompletionContributor - Getting completions
2024-12-09 08:16:46,772 [2889178]   INFO - #dev.nx.console.completion.NxCompletionContributor - Getting completions
2024-12-09 08:16:47,180 [2889586]  FINER - #dev.nx.console.nxls.NxlsWrapper - Sending request to nxls: nx/workspace (NxWorkspaceRequest(reset=false))
2024-12-09 08:16:47,181 [2889587]   INFO - #dev.nx.console.nxls.NxlsWrapper - Unable to send messages to the nxls, the process has exited
2024-12-09 08:21:34,832 [3177238]  FINER - #dev.nx.console.nxls.NxlsWrapper - Sending request to nxls: nx/stopDaemon (null)
2024-12-09 08:21:34,832 [3177238]   INFO - #dev.nx.console.nxls.NxlsWrapper - Unable to send messages to the nxls, the process has exited
2024-12-09 08:23:47,015 [3309421]  FINER - #dev.nx.console.nxls.NxlsWrapper - Sending request to nxls: nx/generators (NxGeneratorsRequest(options=NxGeneratorsRequestOptions(includeHidden=false, includeNgAdd=false)))
2024-12-09 08:23:47,015 [3309421]   INFO - #dev.nx.console.nxls.NxlsWrapper - Unable to send messages to the nxls, the process has exited
2024-12-09 08:23:51,344 [3313750]  FINER - #dev.nx.console.nxls.NxlsWrapper - Sending request to nxls: nx/workspace (NxWorkspaceRequest(reset=false))
2024-12-09 08:23:51,344 [3313750]   INFO - #dev.nx.console.nxls.NxlsWrapper - Unable to send messages to the nxls, the process has exited
2024-12-09 08:23:51,742 [3314148]  FINER - #dev.nx.console.nxls.NxlsWrapper - Sending request to nxls: nx/workspace (NxWorkspaceRequest(reset=false))
2024-12-09 08:23:51,742 [3314148]   INFO - #dev.nx.console.nxls.NxlsWrapper - Unable to send messages to the nxls, the process has exited
2024-12-09 08:24:00,897 [3323303]  FINER - #dev.nx.console.nxls.NxlsWrapper - Sending request to nxls: nx/generators (NxGeneratorsRequest(options=NxGeneratorsRequestOptions(includeHidden=false, includeNgAdd=false)))
2024-12-09 08:24:00,897 [3323303]   INFO - #dev.nx.console.nxls.NxlsWrapper - Unable to send messages to the nxls, the process has exited

Running nx daemon status shows that it's still working.

So the nxls process exited early, but I don't know how to get the nxls logs 😅

2024-12-09 08:09:45,805 [2468211] FINER - #dev.nx.console.nxls.NxlsProcess - Nxls early exit: process.exit called with code 1

Also, I'm wondering, why is the console trying to stop the nx daemon ?

@MaxKless
Copy link
Collaborator

hmm this means that it died during startup... does refreshing fix the issue?

@beaussan
Copy link
Author

beaussan commented Dec 10, 2024

hmm this means that it died during startup...

I cropped the logs since it was a 29 megs logs 😅 It works for a while, and then, it breaks for no reason I can understand :/

does refreshing fix the issue?

Restarting the whole ide fixes it yes, but that's the sonly solution I've found :/

Clicking "refresh workspace" is blocked in the progress bar shown in the issue

@MaxKless
Copy link
Collaborator

Yikes, not sure how this is happening. There has been some changes to how the nxls starts up... Can you try again on 1.35.1? It should be out today or tomorrow

@eyalellenbogen
Copy link

I'm having very similar issues with the VSCode extension. It almost never survives more than 15 minutes of work. I have to terminate all node processes to release the daemon.log file. When I start VSCode, in most cases NX won't start until i run nx reset from the terminal. It "releases" the extension but the reset process fails.

When it's finally working, there is another issue which might be related. Every NX command I run takes forever to start. Seems like it's refreshing the workspace on every file change. Really strange behavior and I can't figure out what's causing it. I just switch to working with the command line and use the extension when I have to. Mostly to for generators.

@MaxKless
Copy link
Collaborator

Hey @eyalellenbogen that sounds bad, please create a new GH issue so we can keep the discussions separate. Provide at least your nx report and if you can distill it down to a minimal repro that increases our chances of tracking this down and fixing it a lot! So please try that.
Thanks, looking forward to hearing from you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants