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

Request textDocument/definition failed - CodeQL 2.21.0 seems to break Language Server integration #19213

Closed
kevinvandervlist opened this issue Apr 3, 2025 · 3 comments
Labels
question Further information is requested

Comments

@kevinvandervlist
Copy link

After upgrading to the latest release 2.21.0, I noticed that none of the 'Go To Definition' actions seem to work anymore.

After checking the logs, it looks like the update to this version caused this somewhere in the language server that is used from the VSCode plugin

Apr 03, 2025 9:07:05 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint fallbackResponseError
SEVERE: Internal error: java.lang.NullPointerException: Cannot invoke "com.semmle.frontend.ast.ASTNode.getPosition()" because "node" is null
java.util.concurrent.CompletionException: java.lang.NullPointerException: Cannot invoke "com.semmle.frontend.ast.ASTNode.getPosition()" because "node" is null
	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException: Cannot invoke "com.semmle.frontend.ast.ASTNode.getPosition()" because "node" is null
	at com.semmle.frontend.search.EditorPositionTransformer$EditorPositionNodeFinder.process(EditorPositionTransformer.java:129)
	at com.semmle.frontend.search.EditorPositionTransformer$EditorPositionNodeFinder.visit(EditorPositionTransformer.java:243)
	at com.semmle.frontend.search.EditorPositionTransformer.transform(EditorPositionTransformer.java:70)
	at com.semmle.frontend.search.DefinitionPositionTransformer.transform(DefinitionPositionTransformer.java:20)
	at com.semmle.frontend.project.QlLspImplementations.definition(QlLspImplementations.java:153)
	at com.semmle.frontend.server.QLLanguageServer$QLTextDocumentService.lambda$definition$2(QLLanguageServer.java:394)
	... 4 more

Content-Length: 1565

{"jsonrpc":"2.0","id":45,"error":{"code":-32603,"message":"Internal error.","data":"java.util.concurrent.CompletionException: java.lang.NullPointerException: Cannot invoke \"com.semmle.frontend.ast.ASTNode.getPosition()\" because \"node\" is null\n\tat java.base/java.util.concurrent.CompletableFuture.encodeThrowable(Unknown Source)\n\tat java.base/java.util.concurrent.CompletableFuture.completeThrowable(Unknown Source)\n\tat java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)\n\tat java.base/java.lang.Thread.run(Unknown Source)\nCaused by: java.lang.NullPointerException: Cannot invoke \"com.semmle.frontend.ast.ASTNode.getPosition()\" because \"node\" is null\n\tat com.semmle.frontend.search.EditorPositionTransformer$EditorPositionNodeFinder.process(EditorPositionTransformer.java:129)\n\tat com.semmle.frontend.search.EditorPositionTransformer$EditorPositionNodeFinder.visit(EditorPositionTransformer.java:243)\n\tat com.semmle.frontend.search.EditorPositionTransformer.transform(EditorPositionTransformer.java:70)\n\tat com.semmle.frontend.search.DefinitionPositionTransformer.transform(DefinitionPositionTransformer.java:20)\n\tat com.semmle.frontend.project.QlLspImplementations.definition(QlLspImplementations.java:153)\n\tat com.semmle.frontend.server.QLLanguageServer$QLTextDocumentService.lambda$definition$2(QLLanguageServer.java:394)\n\t... 4 more\n"}}[Error - 21:07:05] Request textDocument/definition failed.
  Message: Internal error.
  Code: -32603 
java.util.concurrent.CompletionException: java.lang.NullPointerException: Cannot invoke "com.semmle.frontend.ast.ASTNode.getPosition()" because "node" is null
	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException: Cannot invoke "com.semmle.frontend.ast.ASTNode.getPosition()" because "node" is null
	at com.semmle.frontend.search.EditorPositionTransformer$EditorPositionNodeFinder.process(EditorPositionTransformer.java:129)
	at com.semmle.frontend.search.EditorPositionTransformer$EditorPositionNodeFinder.visit(EditorPositionTransformer.java:243)
	at com.semmle.frontend.search.EditorPositionTransformer.transform(EditorPositionTransformer.java:70)
	at com.semmle.frontend.search.DefinitionPositionTransformer.transform(DefinitionPositionTransformer.java:20)
	at com.semmle.frontend.project.QlLspImplementations.definition(QlLspImplementations.java:153)
	at com.semmle.frontend.server.QLLanguageServer$QLTextDocumentService.lambda$definition$2(QLLanguageServer.java:394)
	... 4 more
@kevinvandervlist kevinvandervlist added the question Further information is requested label Apr 3, 2025
@jketema
Copy link
Contributor

jketema commented Apr 4, 2025

Hi @kevinvandervlist,

This clearly should not happen. Have you tried restarting VSCode, or slightly modifying the file with the module you want to jump to?

@kevinvandervlist
Copy link
Author

Hi @jketema,

Actually, I did -- at least 2 times. I also think I modified the files, but I'm not 100% sure anymore.

I did however shut down the machine and called it a day. Now everything works as expected but no caches and running processes anymore ;)

So I don't know what exactly happened, but I cannot reproduce it (anymore).

@jketema
Copy link
Contributor

jketema commented Apr 4, 2025

Thanks for reporting back!

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

No branches or pull requests

2 participants