github / vscode-codeql

An extension for Visual Studio Code that adds rich language support for CodeQL
https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-codeql
MIT License
427 stars 191 forks source link

`no result from server` message #895

Open smowton opened 3 years ago

smowton commented 3 years ago

Describe the bug

Received message no result from server on running a quick query.

Immediately preceding extension log:

[2021-07-01 08:29:46] [DETAILS] resolve qlpacks> Scanning for qlpack.yml from /Users/chris/vscode-codeql-starter/codeql-custom-queries-cpp/
[2021-07-01 08:29:46] [DETAILS] resolve qlpacks> Scanning for qlpack.yml from /Users/chris/vscode-codeql-starter/codeql-custom-queries-csharp/
[2021-07-01 08:29:46] [DETAILS] resolve qlpacks> Scanning for qlpack.yml from /Users/chris/vscode-codeql-starter/codeql-custom-queries-go/
[2021-07-01 08:29:46] [DETAILS] resolve qlpacks> Scanning for qlpack.yml from /Users/chris/vscode-codeql-starter/codeql-custom-queries-java/
[2021-07-01 08:29:46] [DETAILS] resolve qlpacks> Scanning for qlpack.yml from /Users/chris/vscode-codeql-starter/codeql-custom-queries-javascript/
[2021-07-01 08:29:46] [DETAILS] resolve qlpacks> Scanning for qlpack.yml from /Users/chris/vscode-codeql-starter/codeql-custom-queries-python/
[2021-07-01 08:29:46] [DETAILS] resolve qlpacks> Scanning for qlpack.yml from /Users/chris/codeql-home/codeql-go/.codeqlmanifest.json
[2021-07-01 08:29:46] [DETAILS] resolve qlpacks> Scanning for qlpack.yml from /Users/chris/codeql-home/codeql-other-languages/.codeqlmanifest.json
[2021-07-01 08:29:46] [DETAILS] resolve qlpacks> Scanning for qlpack.yml from /Users/chris/Library/Application Support/Code/User/workspaceStorage/8b2016577f9fd01e087415729b1db3e6/GitHub.vscode-codeql/quick-queries/
[2021-07-01 08:29:46] [DETAILS] resolve qlpacks> Not scanning from /Users/chris/codeql-home/codeql-go which is already done.
[2021-07-01 08:29:46] [DETAILS] resolve qlpacks> Scanning for qlpack.yml from /Users/chris/codeql-home/codeql/.codeqlmanifest.json
[2021-07-01 08:29:46] [DETAILS] resolve qlpacks> Scanning for qlpack.yml from /Users/chris/codeql-home/
[2021-07-01 08:29:46] [DETAILS] resolve qlpacks> Not scanning from /Users/chris/codeql-home/codeql-other-languages which is already done.
[2021-07-01 08:29:46] [DETAILS] resolve qlpacks> Scanning for qlpack.yml from /Users/chris/codeql-home/codeql.old/.codeqlmanifest.json
[2021-07-01 08:29:46] [DETAILS] resolve qlpacks> Not scanning from /Users/chris/codeql-home/codeql which is already done.
[2021-07-01 08:29:46] [DETAILS] resolve qlpacks> Not scanning from /Users/chris/codeql-home/codeql-go which is already done.

Resolving tests using CodeQL CLI: resolve tests --strict-test-discovery -v --log-to-stderr --format json /Users/chris/Library/Application Support/Code/User/workspaceStorage/8b2016577f9fd01e087415729b1db3e6/GitHub.vscode-codeql/quick-queries...
CLI command succeeded.

Resolving tests using CodeQL CLI: resolve tests --strict-test-discovery -v --log-to-stderr --format json /Users/chris/Library/Application Support/Code/User/workspaceStorage/8b2016577f9fd01e087415729b1db3e6/GitHub.vscode-codeql/quick-queries...
CLI command succeeded.

Resolving tests using CodeQL CLI: resolve tests --strict-test-discovery -v --log-to-stderr --format json /Users/chris/Library/Application Support/Code/User/workspaceStorage/8b2016577f9fd01e087415729b1db3e6/GitHub.vscode-codeql/quick-queries...
CLI command succeeded.

Resolving tests using CodeQL CLI: resolve tests --strict-test-discovery -v --log-to-stderr --format json /Users/chris/Library/Application Support/Code/User/workspaceStorage/8b2016577f9fd01e087415729b1db3e6/GitHub.vscode-codeql/quick-queries...
CLI command succeeded.

Resolving tests using CodeQL CLI: resolve tests --strict-test-discovery -v --log-to-stderr --format json /Users/chris/Library/Application Support/Code/User/workspaceStorage/8b2016577f9fd01e087415729b1db3e6/GitHub.vscode-codeql/quick-queries...
CLI command succeeded.

Resolving tests using CodeQL CLI: resolve tests --strict-test-discovery -v --log-to-stderr --format json /Users/chris/Library/Application Support/Code/User/workspaceStorage/8b2016577f9fd01e087415729b1db3e6/GitHub.vscode-codeql/quick-queries...
CLI command succeeded.

Resolving tests using CodeQL CLI: resolve tests --strict-test-discovery -v --log-to-stderr --format json /Users/chris/Library/Application Support/Code/User/workspaceStorage/8b2016577f9fd01e087415729b1db3e6/GitHub.vscode-codeql/quick-queries...
CLI command succeeded.

Resolving tests using CodeQL CLI: resolve tests --strict-test-discovery -v --log-to-stderr --format json /Users/chris/Library/Application Support/Code/User/workspaceStorage/8b2016577f9fd01e087415729b1db3e6/GitHub.vscode-codeql/quick-queries...
CLI command succeeded.

Resolving tests using CodeQL CLI: resolve tests --strict-test-discovery -v --log-to-stderr --format json /Users/chris/Library/Application Support/Code/User/workspaceStorage/8b2016577f9fd01e087415729b1db3e6/GitHub.vscode-codeql/quick-queries...
CLI command succeeded.

Resolving tests using CodeQL CLI: resolve tests --strict-test-discovery -v --log-to-stderr --format json /Users/chris/Library/Application Support/Code/User/workspaceStorage/8b2016577f9fd01e087415729b1db3e6/GitHub.vscode-codeql/quick-queries...
CLI command succeeded.

Resolving library paths using CodeQL CLI: resolve library-path -v --log-to-stderr --format json --query /Users/chris/Library/Application Support/Code/User/workspaceStorage/8b2016577f9fd01e087415729b1db3e6/GitHub.vscode-codeql/quick-queries/quick-query.ql --additional-packs /Users/chris/vscode-codeql-starter/codeql-custom-queries-cpp:/Users/chris/vscode-codeql-starter/codeql-custom-queries-csharp:/Users/chris/vscode-codeql-starter/codeql-custom-queries-go:/Users/chris/vscode-codeql-starter/codeql-custom-queries-java:/Users/chris/vscode-codeql-starter/codeql-custom-queries-javascript:/Users/chris/vscode-codeql-starter/codeql-custom-queries-python:/Users/chris/codeql-home/codeql-go:/Users/chris/codeql-home/codeql-other-languages:/Users/chris/Library/Application Support/Code/User/workspaceStorage/8b2016577f9fd01e087415729b1db3e6/GitHub.vscode-codeql/quick-queries...
CLI command succeeded.
[2021-07-01 08:30:12] [DETAILS] resolve library-path> Resolving query at normalized path /Users/chris/Library/Application Support/Code/User/workspaceStorage/8b2016577f9fd01e087415729b1db3e6/GitHub.vscode-codeql/quick-queries/quick-query.ql.
[2021-07-01 08:30:12] [DETAILS] resolve library-path> Found enclosing pack 'quick-query' at /Users/chris/Library/Application Support/Code/User/workspaceStorage/8b2016577f9fd01e087415729b1db3e6/GitHub.vscode-codeql/quick-queries.
[2021-07-01 08:30:12] [DETAILS] resolve library-path> Adding compilation cache at /Users/chris/Library/Application Support/Code/User/workspaceStorage/8b2016577f9fd01e087415729b1db3e6/GitHub.vscode-codeql/quick-queries/.cache.
[2021-07-01 08:30:12] [DETAILS] resolve library-path> Resolving library dependencies from /Users/chris/Library/Application Support/Code/User/workspaceStorage/8b2016577f9fd01e087415729b1db3e6/GitHub.vscode-codeql/quick-queries/qlpack.yml.
[2021-07-01 08:30:12] [DETAILS] resolve library-path> QL pack dependencies for /Users/chris/Library/Application Support/Code/User/workspaceStorage/8b2016577f9fd01e087415729b1db3e6/GitHub.vscode-codeql/quick-queries resolved OK.
[2021-07-01 08:30:12] [DETAILS] resolve library-path> Found dbscheme through QL packs: /Users/chris/codeql-home/codeql-other-languages/javascript/ql/src/semmlecode.javascript.dbscheme.

Resolving query metadata using CodeQL CLI: resolve metadata -v --log-to-stderr --format json /Users/chris/Library/Application Support/Code/User/workspaceStorage/8b2016577f9fd01e087415729b1db3e6/GitHub.vscode-codeql/quick-queries/quick-query.ql...
CLI command succeeded.

Resolving database upgrade scripts using CodeQL CLI: resolve upgrades -v --log-to-stderr --format json --additional-packs /Users/chris/vscode-codeql-starter/codeql-custom-queries-cpp:/Users/chris/vscode-codeql-starter/codeql-custom-queries-csharp:/Users/chris/vscode-codeql-starter/codeql-custom-queries-go:/Users/chris/vscode-codeql-starter/codeql-custom-queries-java:/Users/chris/vscode-codeql-starter/codeql-custom-queries-javascript:/Users/chris/vscode-codeql-starter/codeql-custom-queries-python:/Users/chris/codeql-home/codeql-go:/Users/chris/codeql-home/codeql-other-languages:/Users/chris/Library/Application Support/Code/User/workspaceStorage/8b2016577f9fd01e087415729b1db3e6/GitHub.vscode-codeql/quick-queries --dbscheme /private/tmp/x/db/db-javascript/semmlecode.javascript.dbscheme --target-dbscheme /Users/chris/codeql-home/codeql-other-languages/javascript/ql/src/semmlecode.javascript.dbscheme --allow-downgrades...
CLI command succeeded.
[2021-07-01 08:30:12] [DETAILS] resolve upgrades> Searching for upgrades that apply to fbd45f6b3c6f79d732d0e30a92ea5cee438a1a3e.
[2021-07-01 08:30:12] [DETAILS] resolve upgrades> Will look for upgrades in /Users/chris/codeql-home/codeql-go/upgrades
[2021-07-01 08:30:12] [DETAILS] resolve upgrades> Will look for upgrades in /Users/chris/codeql-home/codeql-other-languages/python/upgrades
[2021-07-01 08:30:12] [DETAILS] resolve upgrades> Will look for upgrades in /Users/chris/codeql-home/codeql-other-languages/java/upgrades
[2021-07-01 08:30:12] [DETAILS] resolve upgrades> Will look for upgrades in /Users/chris/codeql-home/codeql-other-languages/cpp/upgrades
[2021-07-01 08:30:12] [DETAILS] resolve upgrades> Will look for upgrades in /Users/chris/codeql-home/codeql-other-languages/csharp/upgrades
[2021-07-01 08:30:12] [DETAILS] resolve upgrades> Will look for upgrades in /Users/chris/codeql-home/codeql-other-languages/javascript/upgrades
[2021-07-01 08:30:12] [DETAILS] resolve upgrades> Will look for upgrades in /Users/chris/codeql-home/codeql/legacy-upgrades/upgrades

Resolving tests using CodeQL CLI: resolve tests --strict-test-discovery -v --log-to-stderr --format json /Users/chris/Library/Application Support/Code/User/workspaceStorage/8b2016577f9fd01e087415729b1db3e6/GitHub.vscode-codeql/quick-queries...
CLI command succeeded.

Resolving tests using CodeQL CLI: resolve tests --strict-test-discovery -v --log-to-stderr --format json /Users/chris/Library/Application Support/Code/User/workspaceStorage/8b2016577f9fd01e087415729b1db3e6/GitHub.vscode-codeql/quick-queries...
CLI command succeeded.

Resolving tests using CodeQL CLI: resolve tests --strict-test-discovery -v --log-to-stderr --format json /Users/chris/Library/Application Support/Code/User/workspaceStorage/8b2016577f9fd01e087415729b1db3e6/GitHub.vscode-codeql/quick-queries...
CLI command succeeded.

Resolving tests using CodeQL CLI: resolve tests --strict-test-discovery -v --log-to-stderr --format json /Users/chris/Library/Application Support/Code/User/workspaceStorage/8b2016577f9fd01e087415729b1db3e6/GitHub.vscode-codeql/quick-queries...
CLI command succeeded.

Resolving tests using CodeQL CLI: resolve tests --strict-test-discovery -v --log-to-stderr --format json /Users/chris/Library/Application Support/Code/User/workspaceStorage/8b2016577f9fd01e087415729b1db3e6/GitHub.vscode-codeql/quick-queries...
CLI command succeeded.

Resolving tests using CodeQL CLI: resolve tests --strict-test-discovery -v --log-to-stderr --format json /Users/chris/Library/Application Support/Code/User/workspaceStorage/8b2016577f9fd01e087415729b1db3e6/GitHub.vscode-codeql/quick-queries...
No result from server
No result from server

Query server log:

#select#query#fffffff(/* DataFlow::DataFlow::Node */ cached TNode n,
                      string n#toString, string n#file_name, int n#start_line,
                      int n#start_col, int n#end_line, int n#end_col)
:-
  exists(/* Variables::VarAccess */ cached entity va |
    @varaccess#f(va),
    exists(cached string arg0, cached dontcare string _ |
      arg0 = "foo", literals(arg0, _, va)
    ),
    DataFlowNode::TValueNode(va, n)
  ),
  (
    DataFlow::DataFlow::Node::toString_dispred(n, n#toString);
    (
      not(project#DataFlow::DataFlow::Node::toString_dispred(n)),
      n#toString = "(no string representation)"
    )
  ),
  (
    DataFlow::DataFlow::Node::hasLocationInfo_dispred(n, n#file_name,
                                                      n#start_line, n#start_col,
                                                      n#end_line, n#end_col);
    (
      not(project#DataFlow::DataFlow::Node::hasLocationInfo_dispred(n)),
      n#file_name = "",
      n#start_line = 0,
      n#start_col = 0,
      n#end_line = 0,
      n#end_col = 0
    )
  )
.

query #select = #select#query#fffffff/7 .
[2021-07-01 08:30:35] Stored compiled program for 1bf7f4baf680ab75c37bb2c29dd7fa8d294c7d6b.
[2021-07-01 08:30:35] CSV_COMPILATION: NONE,MISC,RA_TRANSLATION,OPTIMISATIONS
[2021-07-01 08:30:35] CSV_COMPILATION: 643,492,4232,9093
 - - - COMPILATION DONE - - - 

Version CLI v2.5.5 Extension v1.5.1 VSCode v1.57.1 Platform: OSX Big Sur (11.4)

smowton commented 3 years ago

After one failure, it is possible to produce more by running other queries against the same database, always ending with - - - COMPILATION DONE - - -. Selecting a different database fixes the problem, but then switching back to the original continues to yield this message.

Restarting VSCode allows querying the database.

aeisenberg commented 3 years ago

What was the quick query you ran, on what database? And is this problem reproducible? I just briefly tried to run a quick query myself and could not reproduce.

The No result from server means that the query server closed the query without ever sending any results back. I'm not entirely sure what situations this occurs in.

smowton commented 3 years ago

It doesn't seem to matter what the query is, and the database is a trivial test DB consisting only of a single Test.java file and a skeleton pom.xml.

Possibly important: the previous DB before a reboot is often under /tmp and so not present after rebooting (simply rm -r'ing it doesn't seem to be enough to reproduce the fault, though)

Steps I took:

  1. Reboot my Mac
  2. Start VSCode (starts with no DB selected)
  3. Make a simple project and create a DB with codeql database create --language=java db in cwd /tmp/x
  4. Open Database from Folder -> /tmp/x/db
  5. Try to run any query, including a quick query

Result: No result from server. Once this has happened to one database, I have never yet been able to get it to happen to any other database without an intervening reboot.