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

Getting lots of org.eclipse.lsp4j.jsonrpc.ResponseErrorException #580

Closed
Phillipus opened this issue Dec 9, 2021 · 22 comments
Closed

Getting lots of org.eclipse.lsp4j.jsonrpc.ResponseErrorException #580

Phillipus opened this issue Dec 9, 2021 · 22 comments
Milestone

Comments

@Phillipus
Copy link

Sorry, no particular steps to reproduce. I'm working normally in Eclipse 4.22 but the error log shows lots of these exceptions:

java.util.concurrent.ExecutionException: org.eclipse.lsp4j.jsonrpc.ResponseErrorException: Internal error.
	at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
	at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2022)
	at org.eclipse.lsp4e.LanguageServerWrapper.lambda$13(LanguageServerWrapper.java:425)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1736)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1728)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Caused by: org.eclipse.lsp4j.jsonrpc.ResponseErrorException: Internal error.
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleResponse(RemoteEndpoint.java:209)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:193)
	at org.eclipse.lsp4e.LanguageServerWrapper.lambda$4(LanguageServerWrapper.java:260)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	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:829)

eclipse.buildId=4.22.0.I20211124-1800
java.version=11.0.13
org.eclipse.lsp4j_0.12.0.v20210402-1305
org.eclipse.lsp4j.jsonrpc_0.12.0.v20210402-1305
org.eclipse.lsp4e_0.13.8.202111241523

@cdietrich
Copy link
Contributor

cdietrich commented Dec 9, 2021

nothing else in error log of the remote site? which file types are you working with?

@Phillipus
Copy link
Author

nothing else in error log of the remote site? which file types are you working with?

No, nothing. I'll try and see what might trigger it. I think it may be related to editing an Eclipse *.target file.

@cdietrich
Copy link
Contributor

then i guess this is a bug in the language server for target files. dont know if that one will write logs to disk somewhere

@cdietrich
Copy link
Contributor

@laeubi @mickaelistria do you have an idea which ls is used for target files?

@mickaelistria
Copy link
Contributor

.target are XML files, so it's lemminx.

@laeubi
Copy link

laeubi commented Dec 9, 2021

.target are XML files, so it's lemminx.

I don't think this is true in general as Target files seem to have some special folding / coloring and code-actions so maybe there is something in between.

@cdietrich
Copy link
Contributor

@mickaelistria i see the same logged locally. is there a way to see server side log or enabling it?

@Phillipus
Copy link
Author

No, nothing. I'll try and see what might trigger it. I think it may be related to editing an Eclipse *.target file.

I was also editing a pom.xml file in the m2e editor. I need to try and trigger this again...

@mickaelistria
Copy link
Contributor

I don't think this is true in general as Target files seem to have some special folding / coloring and code-actions so maybe there is something in between.

The Language Server are enabled upon document creation; even if the editor is not the Generic Editor.

i see the same logged locally. is there a way to see server side log or enabling it?

You can get the messages log (between client and server) in Preferences > Language Servers > Logs. This allows to see the message, and -potentially- to indentify a message that LSP4J cannot process (this can happen when there are "breaking changes" in LSP4J so a message sent from a server using an older LSP4J cannot be read by client using newer one).
For server-side logs, there is no user switch, you'll have to take the code of Wild Web Developer and configure the necessary logging options in the piece of code that starts LemMinX process. However you can set the org.eclipse.wildwebdeveloper.xml.internal.debugPort system property (see https:/eclipse/wildwebdeveloper/blob/master/org.eclipse.wildwebdeveloper.xml/src/org/eclipse/wildwebdeveloper/xml/internal/XMLLanguageServer.java#L75 ) and then attach a debugger to the LS directly.

As mentioned, I think it can be an incompatible message (LemMinX uses LSP4J 0.11.0) https:/eclipse/lemminx/blob/0.18.1/pom.xml#L11

@cdietrich
Copy link
Contributor

[t=1639055919081] LSP4E to org.eclipse.wildwebdeveloper.xml:
{"jsonrpc":"2.0","id":"7","method":"shutdown","params":null}
[t=1639055919081] org.eclipse.wildwebdeveloper.xml to LSP4E:
{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///Users/cdietrich/xtext-master/git/xtext-eclipse/org.eclipse.xtext.xtext.ui.examples/projects/domainmodel/org.eclipse.xtext.example.domainmodel.releng/tp/domainmodel.target","diagnostics":[]}}
[t=1639055919089] org.eclipse.wildwebdeveloper.xml to LSP4E:
{"jsonrpc":"2.0","id":"7","error":{"code":-32603,"message":"Internal error.","data":"java.lang.RuntimeException: java.lang.reflect.InvocationTargetException\n\tat org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:67)\n\tat org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:120)\n\tat org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:261)\n\tat org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:190)\n\tat org.eclipse.lemminx.commons.ParentProcessWatcher.lambda$apply$0(ParentProcessWatcher.java:143)\n\tat org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194)\n\tat org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)\n\tat org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)\n\tat java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)\n\tat java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\n\tat java.base/java.lang.Thread.run(Thread.java:829)\nCaused by: java.lang.reflect.InvocationTargetException\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.base/java.lang.reflect.Method.invoke(Method.java:566)\n\tat org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65)\n\t... 12 more\nCaused by: java.lang.NullPointerException\n\tat org.eclipse.lemminx.XMLLanguageServer.shutdown(XMLLanguageServer.java:230)\n\t... 17 more\n"}}
[t=1639055919092] LSP4E to org.eclipse.wildwebdeveloper.xml:
Content-Length: 47

@pisv
Copy link
Contributor

pisv commented Dec 9, 2021

Looks like eclipse/lemminx#1132.

@cdietrich
Copy link
Contributor

yes

@cdietrich
Copy link
Contributor

wonder if its intentional not to log everything on lsp4j side

@Phillipus
Copy link
Author

Also getting lots of java.util.concurrent.TimeoutException and java.net.URISyntaxException: Illegal character in path at index 33: file:/Users/username/dev/Eclipse 4.22.app/Contents/Eclipse/configuration/org.eclipse.osgi/414/0/.cp/cache/www.w3.org/2001/xml.xsd

  1. Open *.target file
  2. Switch to "Source" tab
  3. Start editing

Log attached
errorlog.txt

@Phillipus
Copy link
Author

And the ResponseErrorException occurs when I close the *.target file.

@pisv
Copy link
Contributor

pisv commented Dec 9, 2021

As far as I can see, lsp4j is not even present in stack traces in the error log. Could you please report these issues to the affected projects: WildWebDeveloper or LSP4E? Thanks!

@Phillipus
Copy link
Author

As far as I can see, lsp4j is not even present in stack traces in the error log. Could you please report these issues to the affected projects: WildWebDeveloper or LSP4E? Thanks!

Yes, I thought it was connected.

eclipse-wildwebdeveloper/wildwebdeveloper#752

@pisv
Copy link
Contributor

pisv commented Dec 9, 2021

Closing as unrelated to lsp4j. The main issue described by the author is a known bug in lemminx.

wonder if its intentional not to log everything on lsp4j side

I don't know the answer, but would a separate issue be a better place to discuss it?

@pisv pisv closed this as completed Dec 9, 2021
@Phillipus
Copy link
Author

Closing as unrelated to lsp4j. The main issue described by the author is a known bug in lemminx.

OK. Can you tell me which plug-in in my Eclipse installation lemminx is used that causes this? I can see this plug-in - org.eclipse.m2e.editor.lemminx_1.18.3.20211116-0804

@pisv
Copy link
Contributor

pisv commented Dec 9, 2021

It looks like any plug-in that uses lemminx is potentially affected, until the error is fixed in a new version of lemminx. Unfortunately, I don't know exactly which Eclipse plug-ins use lemminx. Just looking at the name, it may be org.eclipse.m2e.editor.lemminx, but probably there are others too.

@Phillipus
Copy link
Author

It looks like any plug-in that uses lemminx is potentially affected, until the error is fixed in a new version of lemminx. Unfortunately, I don't know exactly which Eclipse plug-ins use lemminx. Just looking at the name, it may be org.eclipse.m2e.editor.lemminx, but probably there are others too.

Thanks for the info. :-)

@pisv
Copy link
Contributor

pisv commented Dec 9, 2021

Thanks for reporting the issue!

@jonahgraham jonahgraham added this to the v0.13.0 milestone May 17, 2022
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

6 participants