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

Server stops when idling after failing to track VS Code's PID #815

Closed
adriantomas opened this issue Feb 27, 2019 · 29 comments
Closed

Server stops when idling after failing to track VS Code's PID #815

adriantomas opened this issue Feb 27, 2019 · 29 comments
Assignees
Labels

Comments

@adriantomas
Copy link

adriantomas commented Feb 27, 2019

Receiving the following error when opening a Spring Boot Maven project folder:

The Language Support for Java server crashed 5 times in the last 3 minutes. The server will not be restarted.

Environment
  • Operating System: Windows 10 Pro
  • JDK version: Oracle 1.8.0_201
  • Visual Studio Code version: 1.31.1
  • Java extension version: 0.39.0
Steps To Reproduce
  1. Install the Language Support for Java(TM) by Red Hat extension after a fresh VS Code installation.
  2. Open a file of the Spring Boot Maven app or generate a new one through Spring Initializer.
  3. Wait for the error to come.

Java Language Server log.txt
Language Support Java Output.txt

Additional Informations

I have the Windows system AV. Also followed the steps here and in many other related issues. I've cleaned the language server workspace.

@fbricon
Copy link
Collaborator

fbricon commented Feb 27, 2019

try to disable every extension but vscode-java, clean the workspace and see what happens

@adriantomas
Copy link
Author

@fbricon Hi and thank you for answering. I've done both things with the same result.

My settings.json in case needed.

{ "java.home": "D:\\Program Files\\Java\\jdk1.8.0_201", "java.configuration.checkProjectSettingsExclusions": false, "java.trace.server": "verbose", "java.jdt.ls.vmargs": "-Dlog.level=ALL" }

@fbricon
Copy link
Collaborator

fbricon commented Feb 27, 2019

please resend your Language Support Java Output, when all extensions are disabled

@adriantomas
Copy link
Author

@fbricon
Copy link
Collaborator

fbricon commented Feb 27, 2019

the STS extensions are still active apparently

@adriantomas
Copy link
Author

That's strange...

image

@adriantomas
Copy link
Author

I uninstalled the other extensions and removed its folders from %UserProfile%\.vscode\extensions

Language Support Java Output (no extensions).txt

@fbricon
Copy link
Collaborator

fbricon commented Feb 27, 2019

@snjeza any idea?

@snjeza snjeza self-assigned this Feb 28, 2019
@snjeza
Copy link
Contributor

snjeza commented Feb 28, 2019

@adriantomas could try the following:

  • stop VS Code
  • remove the %UserProfile%.vscode\extensions\redhat.java-\server\config_win\org.eclipse. directories
  • start VS Code

or remove and reinstall the RedHat Java LS extension.

@adriantomas
Copy link
Author

Done above steps. This is the output of removing those directories:
Language Support Java Output (removing eclipse directories).txt

Also reinstalled VSCode removing related directories at %AppData%, %LocalAppData% and %UserProfile%. Then installed vscode-java as the only extension.
Language Support Java Output (reinstall).txt

@snjeza
Copy link
Contributor

snjeza commented Feb 28, 2019

@adriantomas could you send the output of the following command:

tasklist /FI "IMAGENAME eq code.exe"
echo %errorlevel%

@adriantomas
Copy link
Author

adriantomas commented Mar 3, 2019

Typed above commands after the Java Support for Java server crashed.
Tasklist otuput.txt

@snjeza
Copy link
Contributor

snjeza commented Mar 3, 2019

@adriantomas could you try the following:

cd E:\Users\DrMonkey\Desktop\TFG\contrast
tasklist /FI "IMAGENAME eq code.exe"
echo %errorlevel%

You can also check the following VS Code Java - https://drive.google.com/open?id=1m91etQ-3JugTjBYQbptWGsw3Nq89-GvI. It includes eclipse-jdtls/eclipse.jdt.ls#946

@adriantomas
Copy link
Author

This is the output of the commands. Sorry for misunderstanding them at first.

Tasklist output in E drive.txt

Then I installed the 0.41.0 version of vscode-java and cleant the java language server workspace. This is the output of the Language Support for Java extension and the output of the above commands with this version.

Language Support Java Output (0.41.0).txt
Tasklist output (0.41.0).txt

@snjeza
Copy link
Contributor

snjeza commented Mar 4, 2019

@adriantomas Could you, please, try the following version - https://drive.google.com/open?id=1yIYJyeDbvshorQgH7OVYt5_-m8CDR5PQ ?

@adriantomas
Copy link
Author

Just for cleaning things up I performed a fresh vscode installation again, deleting %UserProfile% related folders. Then installed the version 0.41.1 and opened the project. I performed some actions but noticed they were being captured in the output, so I stopped typing just for not messing things up. This is the Language Support for Java Output and the cmd commands typed above (though it seems you included them in the Java Output).

The Language Support for Java server is actually working and has not crashed a single time

Language Support Java Output (0.41.1).txt
Tasklist output (0.41.1).txt

I would like to know how this ended up working. Thank you a lot @snjeza @fbricon

@snjeza
Copy link
Contributor

snjeza commented Mar 4, 2019

though it seems you included them in the Java Output

I have tried to test your the tasklist and findstr command. You can ignore it or try the following build - https://drive.google.com/open?id=1mnSeXB5JBVNhWbC9Osmx_lzzk6DEQBpe .

The Language Support for Java server is actually working and has not crashed a single time

It seems that you have a corrupted tasklist or findstr command.

I would like to know how this ended up working

eclipse-jdtls/eclipse.jdt.ls#946 fixes the issue. The 0.41.1 and 0.41.2 versions includes it.
It is also possible that you have removed a corrupted tasklist or findstr command. You can check it with standard VS Code Java 0.40.0.

@adriantomas
Copy link
Author

So I installed the 0.41.2 version and it worked. Then rolled back to the standard 0.40.0 and it's working! I'm confused but happy is finally running.

@snjeza
Copy link
Contributor

snjeza commented Mar 4, 2019

Just for cleaning things up I performed a fresh vscode installation again, deleting %UserProfile% related folders.
...
So I installed the 0.41.2 version and it worked. Then rolled back to the standard 0.40.0 and it's working! I'm confused but happy is finally running.

I suppose that you had a corrupted tasklist or findstr command and removed it.

@adriantomas
Copy link
Author

I suppose that you had a corrupted tasklist or findstr command and removed it.

A couple things to notice that maybe caused the error and what I did. These are some possible workarounds for users that have the same problem I had:

  • I noticed that at first I couldn't use tasklist command in other drives rather than C. This was due to cmd not being in PATH environment variable. By the way my vscode and vscode-java installation were in D and my project files in E.

  • When I used sfc /scannow in cmd, something was broken and it fixed it.

I don't know if this means something to you @snjeza

@snjeza
Copy link
Contributor

snjeza commented Mar 5, 2019

@adriantomas Thanks, that is helpful.
@fbricon we could update the wiki.

@ghost
Copy link

ghost commented Mar 8, 2019

@adriantomas could try the following:

  • stop VS Code
  • remove the %UserProfile%.vscode\extensions\redhat.java-\server\config_win\org.eclipse. directories
  • start VS Code

or remove and reinstall the RedHat Java LS extension.

Not work, maybe new vscode cause this.

@snjeza
Copy link
Contributor

snjeza commented Mar 8, 2019

@di3663 please send your Language Support Java Output,

@HelloWorld-orz
Copy link

I also have this problem. image
But I don't know how to collect specific crash information. How do you collect crash information, such as logs?
This situation is occasional and difficult to reproduce.

@yaohaizh
Copy link
Collaborator

@pehalo Does this issue still happen?

@HelloWorld-orz
Copy link

HelloWorld-orz commented Mar 12, 2019

It just happened, but the automatic restart was successful. My computer's memory is full during the reboot process.

sorry! I just checked it. It failed to restart

@yaohaizh
Copy link
Collaborator

yaohaizh commented Mar 12, 2019

@pehalo Could you help invoke the "Java: Clean workspace ..." command to see whether the issue persist

@HelloWorld-orz
Copy link

@yaohaizh After running the "Java: Clean workspace" command, I found some other problems.
YR~S3V6KG{N(~NMJUPH{11U
Trigger full gc every 5 seconds

@fbricon
Copy link
Collaborator

fbricon commented Mar 12, 2019

A GC is performed every 10sec, to prevent a file handle leak on Windows

@fbricon fbricon unpinned this issue Mar 14, 2019
@fbricon fbricon changed the title Error: The Language Support for Java server crashed 5 times in the last 3 minutes. The server will not be restarted. Server stops when idling after failing to track VS Code's PID Mar 14, 2019
@fbricon fbricon added this to the Mid March 2019 milestone Mar 14, 2019
@fbricon fbricon added the bug label Mar 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants