Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Failed to run query in vscode extension, but cli worked #18639

Unanswered
yuxiaolejs asked this question in Q&A
Discussion options

I ran into a strange situation where my vscode extension complains about the library path even after me running codeql pack install (which shows nothing to download), and refused to run any queries. However, if I run the same query on the same database using CLI command codeql query run --database=/codeql_create_db.database_dir alloc_const.ql, it will work properly and give the expected output. What might be wrong?

FYI this is how I configured codeql:

  • Downloaded the codeql-bundle-linux64.tar.gz archive.
  • Unzipped the codeql directory into /opt/codeql
  • Added /opt/codeql to my path (later for debugging I added it to the path of /etc/environment
  • Confirmed the codeql command is working.
You must be logged in to vote

Replies: 1 comment

Comment options

Hi @yuxiaolejs,

It seems like the issue might be with the VSCode extension path or environment variables. Here are a few things to check:

  1. Make sure the VSCode CodeQL extension is pointing to the correct CodeQL path (/opt/codeql).
  2. Restart VSCode to ensure it picks up the correct environment variables.
  3. Double-check the database path in VSCode to make sure it's the same as the CLI.
You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /