Skip to content

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

Closed

Description

@jadedrip

[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)

Activity

  1. martinlippert commented on Apr 24, 2020

    @martinlippert
    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.

  2. jadedrip commented on Apr 25, 2020

    @jadedrip
    Author

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

  3. martinlippert commented on Apr 27, 2020

    @martinlippert
    Member

    Which version of Spring Tools 4 do you use?

  4. jadedrip commented on Apr 28, 2020

    @jadedrip
    Author
  5. martinlippert commented on Apr 28, 2020

    @martinlippert
    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).

  6. martinlippert commented on Apr 28, 2020

    @martinlippert
    Member

    And does the workaround actually work for you?

  7. jadedrip commented on Apr 29, 2020

    @jadedrip
    Author

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

  8. jadedrip commented on May 29, 2020

    @jadedrip
    Author
  9. martinlippert commented on May 29, 2020

    @martinlippert
    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).

  10. jadedrip commented on Jun 3, 2020

    @jadedrip
    Author

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

  11. martinlippert commented on Jun 26, 2020

    @martinlippert
    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?

  12. added this to the 4.7.1.RELEASE milestone on Jun 26, 2020
  13. martinlippert commented on Jun 29, 2020

    @martinlippert
    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.

  14. jadedrip commented on Jul 7, 2020

    @jadedrip
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions