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

pressed any key in some java file: Message: Internal error. Code: -32603 #451

Closed
jadedrip opened this issue Apr 24, 2020 · 13 comments
Closed
Milestone

Comments

@jadedrip
Copy link

[Error - 上午10:11:00] Request textDocument/completion failed.
Message: Internal error.
Code: -32603
java.util.concurrent.CompletionException: org.springframework.ide.vscode.commons.util.BadLocationException
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:331)
at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:346)
at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:704)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2088)
at reactor.core.publisher.MonoToCompletableFuture.onError(MonoToCompletableFuture.java:76)
at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onError(FluxOnAssembly.java:390)
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onError(FluxMapFuseable.java:134)
at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onError(FluxOnAssembly.java:390)
at reactor.core.publisher.MonoSubscribeOn$SubscribeOnSubscriber.onError(MonoSubscribeOn.java:150)
at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onError(FluxOnAssembly.java:390)
at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onError(MonoPeekTerminal.java:251)
at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onError(FluxOnAssembly.java:390)
at reactor.core.publisher.FluxPeekFuseable$PeekConditionalSubscriber.onError(FluxPeekFuseable.java:894)
at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onError(FluxOnAssembly.java:390)
at reactor.core.publisher.MonoCallable.subscribe(MonoCallable.java:65)
at reactor.core.publisher.Mono.subscribe(Mono.java:4210)
at reactor.core.publisher.MonoSubscribeOn$SubscribeOnSubscriber.run(MonoSubscribeOn.java:124)
at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:84)
at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:37)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.springframework.ide.vscode.commons.util.BadLocationException
at org.springframework.ide.vscode.commons.util.text.linetracker.ListLineTracker.getLineInformation(ListLineTracker.java:175)
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Assembly trace from producer [reactor.core.publisher.MonoCallable] :
reactor.core.publisher.Mono.fromCallable(Mono.java:381)
org.springframework.ide.vscode.commons.languageserver.completion.VscodeCompletionEngineAdapter.getCompletionsMono(VscodeCompletionEngineAdapter.java:133)
Error has been observed at the following site(s):
|_ Mono.fromCallable ? at org.springframework.ide.vscode.commons.languageserver.completion.VscodeCompletionEngineAdapter.getCompletionsMono(VscodeCompletionEngineAdapter.java:133)
|_ Mono.doOnNext ? at org.springframework.ide.vscode.commons.languageserver.completion.VscodeCompletionEngineAdapter.getCompletionsMono(VscodeCompletionEngineAdapter.java:176)
|_ Mono.doAfterTerminate ? at org.springframework.ide.vscode.commons.languageserver.completion.VscodeCompletionEngineAdapter.getCompletionsMono(VscodeCompletionEngineAdapter.java:177)
|_ Mono.subscribeOn ? at org.springframework.ide.vscode.commons.languageserver.completion.VscodeCompletionEngineAdapter.getCompletionsMono(VscodeCompletionEngineAdapter.java:178)
|_ Mono.map ? at org.springframework.ide.vscode.commons.languageserver.util.SimpleTextDocumentService.completion(SimpleTextDocumentService.java:306)
Stack trace:
at org.springframework.ide.vscode.commons.util.text.linetracker.ListLineTracker.getLineInformation(ListLineTracker.java:175)
at org.springframework.ide.vscode.commons.util.text.linetracker.AbstractLineTracker.getLineInformation(AbstractLineTracker.java:137)
at org.springframework.ide.vscode.commons.util.text.TextDocument.toOffset(TextDocument.java:206)
at org.springframework.ide.vscode.commons.languageserver.completion.VscodeCompletionEngineAdapter.lambda$getCompletionsMono$0(VscodeCompletionEngineAdapter.java:144)
at reactor.core.publisher.MonoCallable.subscribe(MonoCallable.java:56)
at reactor.core.publisher.Mono.subscribe(Mono.java:4210)
at reactor.core.publisher.MonoSubscribeOn$SubscribeOnSubscriber.run(MonoSubscribeOn.java:124)
at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:84)
at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:37)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)

@martinlippert
Copy link
Member

Looks like the language server got out-of-sync with the IDE... :-(

Do you remember when this started and how you got into this state? Would be awesome if we could identify the root cause why/when the language server got initially out-of-sync with the IDE. Any idea or even reproducible steps?

In order to bring the language server back in sync, you can close all the open editors in your IDE and re-open a new editor again. This should restart the language server and start with a fresh state (in case of Eclipse). A full restart of the IDE/editor could help, too.

@jadedrip
Copy link
Author

I didn't do anything special, just open a java file. Sometimes that's what happens.

@martinlippert
Copy link
Member

Which version of Spring Tools 4 do you use?

@jadedrip
Copy link
Author

jadedrip commented Apr 28, 2020 via email

@martinlippert
Copy link
Member

That version of the language server looks good. Which IDE do you use? Visual Studio Code? Or Eclipse?

Can you also attach a full log file of the language server here? In VSCode you can see the path to that file in the initial language server output, for Eclipse you have to enable the log streaming to the console in the preferences first (Preferences -> Language Server -> Spring Language Server, then check the Spring Boot entry).

@martinlippert
Copy link
Member

And does the workaround actually work for you?

@jadedrip
Copy link
Author

I am using Visual code. I will try to find the log next time. It's rarely.

@jadedrip
Copy link
Author

vcode-spring-boot.log

@martinlippert
Copy link
Member

@jadedrip Thanks for attaching a log file, that is indeed quite interesting. I can clearly see a bunch of BadLocationExceptions being thrown. It is not exactly clear why, but I will use it to do a deeper investigation of this issue.

Any chance you can provide a sample project and maybe a few steps that could help us to reproduce this? I saw that there was a JDK class being opened, maybe that is related to this (just a wild guess).

@jadedrip
Copy link
Author

jadedrip commented Jun 3, 2020

@martinlippert Sorry, I don't know why it happened。

@martinlippert
Copy link
Member

I think I found the underlying issue here, looks like some race condition happening under the hood between the reconciler and some other thread, both trying to create the internal representation of the document and in case the reconciler wins, it might be empty. That results in BadLocationException being thrown later on when doing something with the doc.

I am looking into a fix for this now. Once I have something it would be awesome if you could give a CI build a try in your VSCode environment to verify that this is indeed fixed. Would that be possible?

@martinlippert martinlippert added this to the 4.7.1.RELEASE milestone Jun 26, 2020
@martinlippert
Copy link
Member

@jadedrip Please grab a latest CI build of the VSCode extension from here:
http://dist.springsource.com/snapshot/STS4/nightly-distributions.html

(it should point to vscode-spring-boot-1.20.0-202006291613.vsix or a newer version)

Please install this via Install from VSIX in your Visual Studio Code install and try it. Would be great to hear if this fixes the issue on your side.

@jadedrip
Copy link
Author

jadedrip commented Jul 7, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants