Skip to content

Extension shows error for codeQLDatabases.removeOrphanedDatabases when no databases exist #760

@Marcono1234

Description

@Marcono1234

Describe the bug
It appears when opening CodeQL files, but never having built any databases, the extension shows an error message:

ENOENT: no such file or directory, stat '###\Code\User\workspaceStorage\505df5a16e721d7d38a7abed961a5b07\GitHub.vscode-codeql' (codeQLDatabases.removeOrphanedDatabases)

(### representing manually redacted information)

Full log output:

Starting GitHub.vscode-codeql extension
Searching for latest release including codeql-win64.zip.
INFO: Ignoring a release with no assets named codeql-win64.zip
INFO: Ignoring a release with no assets named codeql-win64.zip
INFO: Ignoring a release with no assets named codeql-win64.zip
INFO: Ignoring a release with no assets named codeql-win64.zip
INFO: Ignoring a release with no assets named codeql-win64.zip
INFO: Ignoring a release with no assets named codeql-win64.zip
INFO: Ignoring a release with no assets named codeql-win64.zip
INFO: Ignoring a release with no assets named codeql-win64.zip
INFO: Ignoring a release with no assets named codeql-win64.zip
INFO: Ignoring a release with no assets named codeql-win64.zip
INFO: Ignoring a release with no assets named codeql-win64.zip
INFO: Ignoring a release with no assets named codeql-win64.zip
INFO: Ignoring a release with no assets named codeql-win64.zip
Checking CodeQL version using CodeQL CLI: ###\Code\User\globalStorage\github.vscode-codeql\distribution8\codeql\codeql.exe version -v --log-to-stderr --format=terse...
[2021-02-20 23:34:11] This is codeql version -v --log-to-stderr --format=terse
[2021-02-20 23:34:11] Terminating normally.

CLI command succeeded.
CodeQL CLI already up to date.
Checking CodeQL version using CodeQL CLI: ###\Code\User\globalStorage\github.vscode-codeql\distribution8\codeql\codeql.exe version -v --log-to-stderr --format=terse...
[2021-02-20 23:34:12] This is codeql version -v --log-to-stderr --format=terse
[2021-02-20 23:34:12] Terminating normally.

CLI command succeeded.
Found compatible version of CodeQL CLI (version 2.4.4)
Initializing configuration listener...
Initializing CodeQL cli server...
Initializing query server client.
Checking CodeQL version using CodeQL CLI: ###\Code\User\globalStorage\github.vscode-codeql\distribution8\codeql\codeql.exe version -v --log-to-stderr --format=terse...
Starting CodeQL CLI Server using CodeQL CLI: ###\Code\User\globalStorage\github.vscode-codeql\distribution8\codeql\codeql.exe execute cli-server -v --log-to-stderr
CodeQL CLI Server started on PID: 10108
Resolving RAM settings using CodeQL CLI: resolve ram -v --log-to-stderr --format json...
[2021-02-20 23:34:13] This is codeql version -v --log-to-stderr --format=terse
[2021-02-20 23:34:13] Terminating normally.

CLI command succeeded.
CLI command succeeded.
[2021-02-20 23:34:13] This is codeql execute cli-server -v --log-to-stderr

Initializing database manager.
Initializing database panel.
Registering database panel commands.
Initializing query history manager.
Registering query history panel commands.
Initializing results panel interface.
Initializing compare panel interface.
Initializing source archive filesystem provider.
Initializing CodeQL language server.
Initializing QLTest interface.
Registering CodeQL test panel commands.
Registering top-level command palette commands.
Starting language server.
Registering jump-to-definition handlers.
Removing orphaned databases from workspace storage.
Successfully finished extension initialization.
Resolving tests using CodeQL CLI: resolve tests --strict-test-discovery -v --log-to-stderr --format json ###\codeql\java...
ENOENT: no such file or directory, stat '###\Code\User\workspaceStorage\505df5a16e721d7d38a7abed961a5b07\GitHub.vscode-codeql' (codeQLDatabases.removeOrphanedDatabases)
Error: ENOENT: no such file or directory, stat '###\Code\User\workspaceStorage\505df5a16e721d7d38a7abed961a5b07\GitHub.vscode-codeql'
CLI command succeeded.

To Reproduce

  1. Clone the CodeQL repository https://github.com/github/codeql
  2. In VSCode: "File" > "Open Folder..." > Choose any subfolder of the cloned repository, e.g. codeql/java
  3. In VSCode: Open any .ql or .qll file from the folder you opened (do not do anything else)
    ❌ After a short while the error is shown

Expected behavior
The extension should not encounter an error if there is not database to remove.

Metadata

Metadata

Assignees

No one assigned

    Labels

    VSCodebugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions