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

Brand new nx workspace doesn't work in WebStorm repeatedly asks to Refresh Nx Workspace #1953

Open
charlesritchea opened this issue Dec 7, 2023 · 8 comments
Assignees
Labels
os:linux type: bug Something isn't working

Comments

@charlesritchea
Copy link

Current Behavior

Nx Console says:

There was a problem analysing the current workspace. This could be due to an invalid configuration file, or node_modules not being installed. If everything looks correct, refresh the workspace

Clicking on Refresh Nx Workspace repeates the error

Expected Behavior

Steps to Reproduce

Ran npx create-nx-workspace@latest wireframe-tool-next --preset=angular-monorep then opened in WebStorm 2023.3

Failure Logs / Images / Videos

image

2023-12-06 22:04:47,644 [5146396]   INFO - #dev.nx.console.nxls.NxlsProcess - Staring the nxls process in workingDir /home/novaterata/Projects/wireframe-tool-next
2023-12-06 22:04:47,644 [5146396]   INFO - #dev.nx.console.nxls.NxlsProcess - nxls found via /home/novaterata/.local/share/JetBrains/WebStorm2023.3/nx-console/nxls/main.js
2023-12-06 22:04:47,646 [5146398]   INFO - #dev.nx.console.nxls.NxlsProcess - nxls started: Process[pid=1096802, exitValue="not exited"]
2023-12-06 22:04:47,716 [5146468]   INFO - #dev.nx.console.nxls.NxlsWrapper - Stopping nxls
2023-12-06 22:04:47,716 [5146468]   INFO - #dev.nx.console.nxls.NxlsWrapper - Unable to send messages to the nxls, the process has exited
2023-12-06 22:04:47,716 [5146468]   INFO - #dev.nx.console.nxls.NxlsWrapper - java.util.concurrent.CancellationException
2023-12-06 22:04:47,716 [5146468]   INFO - #dev.nx.console.nxls.NxlsWrapper - Unable to send messages to the nxls, the process has exited
2023-12-06 22:04:47,716 [5146468]   INFO - #dev.nx.console.nxls.NxlsWrapper - Unable to send messages to the nxls, the process has exited
2023-12-06 22:06:16,078 [5234830]   INFO - #dev.nx.console.nxls.NxlsProcess - Staring the nxls process in workingDir /home/novaterata/Projects/wireframe-tool-next
2023-12-06 22:06:16,078 [5234830]   INFO - #dev.nx.console.nxls.NxlsProcess - nxls found via /home/novaterata/.local/share/JetBrains/WebStorm2023.3/nx-console/nxls/main.js
2023-12-06 22:06:16,081 [5234833]   INFO - #dev.nx.console.nxls.NxlsProcess - nxls started: Process[pid=1098825, exitValue="not exited"]
2023-12-06 22:06:16,150 [5234902]   INFO - #dev.nx.console.nxls.NxlsWrapper - Stopping nxls
2023-12-06 22:06:16,150 [5234902]   INFO - #dev.nx.console.nxls.NxlsWrapper - Unable to send messages to the nxls, the process has exited
2023-12-06 22:06:16,150 [5234902]   INFO - #dev.nx.console.nxls.NxlsWrapper - java.util.concurrent.CancellationException
2023-12-06 22:06:16,150 [5234902]   INFO - #dev.nx.console.nxls.NxlsWrapper - Unable to send messages to the nxls, the process has exited
2023-12-06 22:06:16,150 [5234902]   INFO - #dev.nx.console.nxls.NxlsWrapper - Unable to send messages to the nxls, the process has exited

Environment

Latest Pop_os! amd64

  • Nx Console version: 1.15.1
  • WebStorm version: 2023.3 (but happenen on 2023.2 as well)
@charlesritchea charlesritchea added the type: bug Something isn't working label Dec 7, 2023
@MaxKless
Copy link
Collaborator

MaxKless commented Dec 7, 2023

Thanks for the report! I will look into it

Could you provide some 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.

Also the daemon.log & daemon-error.log would be useful. You can find their location by running nx daemon --log

@MaxKless MaxKless self-assigned this Dec 7, 2023
@charlesritchea
Copy link
Author

charlesritchea commented Dec 7, 2023 via email

@MaxKless
Copy link
Collaborator

MaxKless commented Dec 7, 2023

okay that makes a lot of sense. Can you try with the latest canary release of nx 17?

I saw something similar and fixed it in a pr but i'm not sure if it's the same problem you're seeing.

Either way I will push a fix that makes this easier to debug at least.

@charlesritchea
Copy link
Author

@charlesritchea
Copy link
Author

That's with latest, I'll try canary

@charlesritchea
Copy link
Author

charlesritchea commented Dec 7, 2023

Canary still reproed webstorm-logs-20231207-0900307200444148208862825.zip

@charlesritchea
Copy link
Author

Just got this using nx 15 now (started reproducing there too)

org.eclipse.lsp4j.jsonrpc.JsonRpcException: java.io.IOException: Stream closed
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageConsumer.consume(StreamMessageConsumer.java:72)
	at dev.nx.console.nxls.NxlsWrapper.start$lambda$7$lambda$6(NxlsWrapper.kt:95)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.request(RemoteEndpoint.java:161)
	at org.eclipse.lsp4j.jsonrpc.services.EndpointProxy.invoke(EndpointProxy.java:91)
	at jdk.proxy6/jdk.proxy6.$Proxy168.initialize(Unknown Source)
	at dev.nx.console.nxls.NxlsWrapper.start(NxlsWrapper.kt:120)
	at dev.nx.console.services.NxlsService.start(NxlsService.kt:40)
	at dev.nx.console.ProjectPostStartup.execute(ProjectPostStartup.kt:25)
	at com.intellij.ide.startup.impl.StartupManagerImplKt$launchActivity$1.invokeSuspend(StartupManagerImpl.kt:482)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
Caused by: java.io.IOException: Stream closed
	at java.base/java.lang.ProcessBuilder$NullOutputStream.write(ProcessBuilder.java:445)
	at java.base/java.io.OutputStream.write(OutputStream.java:162)
	at java.base/java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81)
	at java.base/java.io.BufferedOutputStream.flush(BufferedOutputStream.java:142)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageConsumer.consume(StreamMessageConsumer.java:69)
	... 14 more

@MaxKless
Copy link
Collaborator

MaxKless commented May 8, 2024

Hey! Is this still happening on the latest version @charlesritchea? We've done a lot of refactorings of the nxls process (which uses the stream that's closed in your example) recently.

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

No branches or pull requests

2 participants