Failed to run query: Database is not registered

Open
#3,237 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
java, typescript, vscode
Domain
backend, databases

Research direction

Start at QueryServer2BackendManager.withDB on line 175 and trace the query-server registration path when a newly selected database is used. Reproduce by selecting a database, running a quick query, and observing whether restarting the query server is required; done means the query runs without that restart.

Written by the indexing model from the issue text.

Description

VSCode

Happens about half the time I select a new database, make a quick query and try to run it:

                              com.semmle.util.exception.UserError: Database is not registered: /private/tmp/db
                              	at com.semmle.cli2.execute.queryServer2.QueryServer2BackendManager.withDB(QueryServer2BackendManager.java:175)
                              	at com.semmle.cli2.execute.queryServer2.QueryServer2BackendManager.withDBShared(QueryServer2BackendManager.java:70)
                              	at com.semmle.cli2.execute.queryServer2.QueryServer2Command$Impl.lambda$runQuery$26(QueryServer2Command.java:580)
                              	at com.semmle.util.concurrent.FutureUtils.supplyCompose(FutureUtils.java:248)
                              	at com.semmle.cli2.execute.queryServer2.QueryServer2Command$Impl.lambda$runQuery$28(QueryServer2Command.java:560)
                              	at com.semmle.cli2.execute.queryServer2.QueryServer2Command$Impl.lambda$withProgressAndCancellation$15(QueryServer2Command.java:405)
                              	at com.semmle.util.concurrent.FutureUtils.supplyCompose(FutureUtils.java:248)
                              	at com.semmle.cli2.execute.queryServer2.QueryServer2Command$Impl.lambda$withProgressAndCancellation$16(QueryServer2Command.java:404)
                              	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
                              	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

Restarting the query server always fixes the situation.

Dominant language
TypeScript
Stars
539
Forks
240
Avg merge
2d 6h
Merged PRs (30d)
29

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github/vscode-codeql

All issues in github/vscode-codeql

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.