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

Failed to run query: Database is not registered #3237

Open
smowton opened this issue Jan 15, 2024 · 1 comment
Open

Failed to run query: Database is not registered #3237

smowton opened this issue Jan 15, 2024 · 1 comment
Labels

Comments

@smowton
Copy link
Contributor

smowton commented Jan 15, 2024

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.

@aeisenberg
Copy link
Contributor

This error happens because the query server needs to have a lock on the database in order to operate on it. Before each query-ish operation, the extension is supposed to register the database so that it can be used. For some reason, this is not happening.

Or, the database is getting registered, but then another database is getting re-registered right before the query server tries to run something on the first database.
Either way, this is a bug. (edited)

Is this bug related to how many databases are currently in your database view? Or is one or more of them a test database?

@github github deleted a comment Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants