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

When I connect to Codespace, CodeQL get installed, each time #3560

Open
Sim4n6 opened this issue Apr 14, 2024 · 15 comments
Open

When I connect to Codespace, CodeQL get installed, each time #3560

Sim4n6 opened this issue Apr 14, 2024 · 15 comments
Assignees
Labels
bug Something isn't working VSCode

Comments

@Sim4n6
Copy link

Sim4n6 commented Apr 14, 2024

It is simple on my side.

Each time I fire a codespace on my local Vscode editor, it starts a codeql installation even though the codeql was not updated or asked to ?

Installing CodeQL CLI: Downloading CodeQL CLI v2.17.0… [121.7 MB of 681.1 MB]

The question now is why ? what should be done ? how to omit that?

@Sim4n6 Sim4n6 added the bug Something isn't working label Apr 14, 2024
@charisk
Copy link
Contributor

charisk commented Apr 16, 2024

Hi @Sim4n6 , thanks for raising an issue.

Are you seeing the CodeQL CLI get installed every time you connect to a pre-existing Codespace, or just when you create a new one? For new Codespaces we have to download the CLI to install it since it is stored in the Codespace storage.

@Sim4n6
Copy link
Author

Sim4n6 commented Apr 16, 2024

Pré existing one.

@charisk
Copy link
Contributor

charisk commented Apr 17, 2024

Thanks for clarifying. One more question, do you have the CodeQL extension installed globally or do you use VS Code Settings sync, syncing your extensions and settings to all Codespaces?

@nickfyson
Copy link

Hi @Sim4n6! Another few questions to help us look into this! Are you seeing this in all codespaces, or is it specific to just a single repository? And could you share the .devcontainer definition you're using, if it's a custom one? In particular, if you're doing anything with CodeQL as part of the setup of the codespace...

@Sim4n6
Copy link
Author

Sim4n6 commented Apr 17, 2024

I will do that tonight

@Sim4n6
Copy link
Author

Sim4n6 commented Apr 17, 2024

I've got something interesting the followinfg error message

Starting GitHub.vscode-codeql extension
The CodeQL executable path is specified as "/home/sim4n6/CodeQL-Home/codeql-cli/codeql" by a configuration setting, but a CodeQL executable could not be found at that path. Please check that a CodeQL executable exists at the specified path or remove the setting.
The CodeQL executable path is specified as "/home/sim4n6/CodeQL-Home/codeql-cli/codeql" by a configuration setting, but a CodeQL executable could not be found at that path. Please check that a CodeQL executable exists at the specified path or remove the setting.
WARNING: Expected to find a CodeQL CLI executable at /home/codespace/.vscode-remote/data/User/globalStorage/github.vscode-codeql/distribution14/codeql/codeql but one was not found. Will try PATH.
Searching for latest release including codeql-linux64.zip.
The CodeQL executable path is specified as "/home/sim4n6/CodeQL-Home/codeql-cli/codeql" by a configuration setting, but a CodeQL executable could not be found at that path. Please check that a CodeQL executable exists at the specified path or remove the setting.
Extracting CodeQL CLI to /home/codespace/.vscode-remote/data/User/globalStorage/github.vscode-codeql/distribution15

And it starts installing CodeQL each time I fire VSCode on Windows (latest stable release) and click on connect to Codespace (via down left corner remote btn) Select a running Codespace 'NAME'.

Content of .devcontainer/devcontainer.json file:

{
  "extensions": [
    "rust-lang.rust-analyzer",
    "bungcip.better-toml",
    "github.vscode-codeql",
    "hbenl.vscode-test-explorer",
    "ms-vscode.test-adapter-converter",
    "slevesque.vscode-zipexplorer"
  ],
  "settings": {
    "files.watcherExclude": {
      "**/target/**": true
    },
    "codeQL.runningQueries.memory": 2048
  }
}
  • Settings Sync is ON.

I hope I answered your questions, pleasE?

@Sim4n6
Copy link
Author

Sim4n6 commented Apr 17, 2024

Settings === @ext:GitHub.vscode-codeql ...

image

This is the root cause.

@angelapwen
Copy link
Contributor

@Sim4n6 👋 hello! I am trying to reproduce the issue. I was wondering if you could share if the CLI executable path you screenshotted above was set in the User or Workspace part of settings?

When I try to reproduce in either of those locations, on creation of the codespace I get the same log message you pasted above and CodeQL is installed. When I stop and reconnect to the codespace, however, instead of getting the installation again, I get a CodeQL CLI is installed externally so could not be updated error message and I have to remove the setting in order to use the extension. 🤔

Also, could you share which version of the CodeQL CLI extension you're using, and which version of the Codespaces extension?

Thank you!

@angelapwen angelapwen self-assigned this Apr 24, 2024
@Sim4n6
Copy link
Author

Sim4n6 commented Apr 25, 2024

User part.

Here is the content of settings.json on User when I use VSCode from a Windows OS.

{
    "git.autofetch": true,
    "codeQL.telemetry.enableTelemetry": false,
    "codeQL.cli.executablePath": "/home/sim4n6/CodeQL-Home/codeql-cli/codeql", # this is the problematic one
    "workbench.colorTheme": "Quiet Light",
    "window.zoomLevel": 1,
    "remote.SSH.remotePlatform": {
        "143.x.x.x": "linux"
    },
    "githubPullRequests.pullBranch": "never",
    "github.copilot.advanced": {
        
    }
}

I also have a Linux local setup where the user's home is /home/sim4n6/ and the external CodeQL installation of mine in Linux is at ~/CodeQL-Home. But the behavior was last reported from the Windows side...

Name: CodeQL
Id: GitHub.vscode-codeql
Description: CodeQL for Visual Studio Code
Version: 1.12.5
Publisher: GitHub
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-codeql

and

Name: GitHub Codespaces
Id: GitHub.codespaces
Description: Your instant dev environment
Version: 1.16.19
Publisher: GitHub
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=GitHub.codespaces

I think something is different right away. I started getting The CodeQL CLI could not be found.

@Sim4n6
Copy link
Author

Sim4n6 commented Apr 25, 2024

I believe you released some fix right ? because the WARNING that was showing up at #3560 (comment) is different, I'm getting this error this time:

Starting GitHub.vscode-codeql extension
The CodeQL executable path is specified as "/home/sim4n6/CodeQL-Home/codeql-cli/codeql" by a configuration setting, but a CodeQL executable could not be found at that path. Please check that a CodeQL executable exists at the specified path or remove the setting.
The CodeQL executable path is specified as "/home/sim4n6/CodeQL-Home/codeql-cli/codeql" by a configuration setting, but a CodeQL executable could not be found at that path. Please check that a CodeQL executable exists at the specified path or remove the setting.
The CodeQL executable path is specified as "/home/sim4n6/CodeQL-Home/codeql-cli/codeql" by a configuration setting, but a CodeQL executable could not be found at that path. Please check that a CodeQL executable exists at the specified path or remove the setting.
CodeQL CLI is installed externally so could not be updated.
The CodeQL executable path is specified as "/home/sim4n6/CodeQL-Home/codeql-cli/codeql" by a configuration setting, but a CodeQL executable could not be found at that path. Please check that a CodeQL executable exists at the specified path or remove the setting.
The CodeQL CLI could not be found.

@Sim4n6
Copy link
Author

Sim4n6 commented Apr 25, 2024

wait, it does happen occasionally when the VSCode ext is reloaded ...

@Sim4n6
Copy link
Author

Sim4n6 commented Apr 25, 2024

the issue persists please feel free to ask me further questions ...

@aeisenberg
Copy link
Contributor

I was able to reproduce this. I wonder if we need to add "ignoreSync": true, to the configuration property here. I'm pretty sure this used to work. I'm not sure what's changed. The setting is marked as Not synced, so not sure why it is getting synced.

@aeisenberg
Copy link
Contributor

OK...so I'm not crazy. Looks like this is a bug in vscode. See microsoft/vscode#210363. If you feel like it, you can comment on it just to let the team know that there are others affected by it.

@Sim4n6
Copy link
Author

Sim4n6 commented Apr 30, 2024

Much bromance sent from this part of the globe 🌐

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working VSCode
Projects
None yet
Development

No branches or pull requests

5 participants