You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When I select a query for MRVA, the extension submits an empty bundle. Every file that should have been included in the bundle, like my query, the qlpack.yml file, and the files related to all dependencies, get "ignored" because they "are outside the pack root" — as logged by the extension when it runs codeql pack bundle. As a result, and as one would expect, the MRVA jobs fail.
I have tried this with the example queries (no matter the language) in the vscode-codeql-starter repository too (after launching VSCode from their workspace) but even that gave me the same issue.
@mrigankpawagi Do you have a CodeQL config file configured? If so, could you please share whether that includes any options? If not, could you please share some logs that show that the files are ignored and share some screenshots of the error that's shown in VS Code/Actions?
For the example, I am running the example.ql query in getting-started/codeql-extra-queries-cpp from the vscode-codeql-starter repository.
CodeQL Extension Logs (since startup): gist. The very end of the logs show all the ignored files. The second last line says Variant analysis Empty block submitted for processing.
The results panel:
Logs from the "Run Query Task" from the "run dmlc/xgboost" job:
@mrigankpawagi Thank you, this is very useful information! Does the USERNAME in your logs show up as two different strings, or are they all the same string? It seems like Windows short paths might be enabled on your system and we aren't resolving that correctly. If they do all show up as the same string, do they contain a ~ character or are they your full username?
@koesie10 Hi, yeah it does appear in two different ways just like what you said. I redacted my username but replaced both kinds with the same word "USERNAME".
@mrigankpawagi Would you perhaps be able to share the logs again, but replacing the variant that contains ~ with something like USER~NAME, and the other variant with USERNAME? That will allow us to see where exactly the translation is happening.
@mrigankpawagi Thanks for the updated logs! Those confirm that the issue is with 8.3 short filenames. I'm trying to investigate whether there's a solution we can use for this, and it seems like we should be able to call the Windows function GetLongPathNameW from the extension to determine the full path name, which should fix the issue. I'll test whether this works and let you know.
@mrigankpawagi I've implemented a fix for this issue in this branch and have kicked off an Actions run to produce a VSIX file. You should be able to download the vscode-codeql-extension artifact from this Actions run, which should include a .vsix file. You can install this VSIX file in VS Code. When you run a variant analysis using this version of the extension, does it correctly produce the query pack and result in a successful MRVA?
Hi @koesie10, thanks so much for the patch. Unfortunately I am unable to test it because I am not able to set the controller repository with your patched version. It says
An error occurred while setting up the controller repository: Error getting controller repository "username/repository": Bad credentials - https://docs.github.com/rest
I installed your version after uninstalling the previous one and deleting all its data (from both .vscode and %APPDATA%). There was no prompt by VSCode for me to authenticate myself for the controller repository.
Just to confirm with you: Is this the source of the problem?
base: A-BCDE~1
Expanding short path component: A-BCDE~1
No inode info available. Skipping.
Everything worked correctly on my other PC where my username is 5-characters long (and so I guess there is no need for an 8.3 name).
Edit: I am still looking for a resolution to the problem because the other PC is my personal machine, but I wish to use MRVA on my work machine 😃!
@mrigankpawagi Yes, exactly. The CodeQL CLI only works if given the "long path", so the extension tries to convert the short path to the long path. This usually works by finding the long path name in the directory listing, but it seems like in your case it cannot find the path. I'm not sure why that would happen, I'm unable to reproduce it on one of my machines with a long username.
I'm also not sure why the extension would be unable to authenticate you since there are no differences between in authentication between the released version of the extension and that VSIX file. Could you perhaps try using VS Code Insiders and seeing if it works there (just to see whether it works in a different installation of VS Code)?
@mrigankpawagi Great, then I'll create a PR to hopefully get this change into the extension. Just to make sure, did your logs show something like "Short path was not resolved to long path, using native method", followed by "Expanded short path ... to ..."?
Short path was not resolved to long path, using native method
Expanded short path C:\Users\A-BCDE~1\AppData\Local\Temp\queries_-30528-get429If3v26 to C:\Users\a-bcdefgh\AppData\Local\Temp\queries_-30528-get429If3v2
Activity
koesie10 commentedon Jun 27, 2025
@mrigankpawagi Do you have a CodeQL config file configured? If so, could you please share whether that includes any options? If not, could you please share some logs that show that the files are ignored and share some screenshots of the error that's shown in VS Code/Actions?
mrigankpawagi commentedon Jun 27, 2025
Thanks for your comment, @koesie10.
I have no config file.
For the example, I am running the
example.qlquery ingetting-started/codeql-extra-queries-cppfrom the vscode-codeql-starter repository.CodeQL Extension Logs (since startup): gist. The very end of the logs show all the ignored files. The second last line says
Variant analysis Empty block submitted for processing.The results panel:
Logs from the "Run Query Task" from the "run dmlc/xgboost" job:
koesie10 commentedon Jun 27, 2025
@mrigankpawagi Thank you, this is very useful information! Does the
USERNAMEin your logs show up as two different strings, or are they all the same string? It seems like Windows short paths might be enabled on your system and we aren't resolving that correctly. If they do all show up as the same string, do they contain a~character or are they your full username?mrigankpawagi commentedon Jun 27, 2025
@koesie10 Hi, yeah it does appear in two different ways just like what you said. I redacted my username but replaced both kinds with the same word "USERNAME".
koesie10 commentedon Jun 27, 2025
@mrigankpawagi Would you perhaps be able to share the logs again, but replacing the variant that contains
~with something likeUSER~NAME, and the other variant withUSERNAME? That will allow us to see where exactly the translation is happening.mrigankpawagi commentedon Jun 27, 2025
@koesie10 I have updated the logs at the same link with the usernames. My username was something like
a-bcdefghwith the variant beingA-BCDE~1.mrigankpawagi commentedon Jun 30, 2025
Hi @koesie10, is there any update on this? Thank you so much for your time!
koesie10 commentedon Jul 1, 2025
@mrigankpawagi Thanks for the updated logs! Those confirm that the issue is with 8.3 short filenames. I'm trying to investigate whether there's a solution we can use for this, and it seems like we should be able to call the Windows function
GetLongPathNameWfrom the extension to determine the full path name, which should fix the issue. I'll test whether this works and let you know.koesie10 commentedon Jul 1, 2025
@mrigankpawagi I've implemented a fix for this issue in this branch and have kicked off an Actions run to produce a VSIX file. You should be able to download the
vscode-codeql-extensionartifact from this Actions run, which should include a.vsixfile. You can install this VSIX file in VS Code. When you run a variant analysis using this version of the extension, does it correctly produce the query pack and result in a successful MRVA?mrigankpawagi commentedon Jul 1, 2025
Hi @koesie10, thanks so much for the patch. Unfortunately I am unable to test it because I am not able to set the controller repository with your patched version. It says
I installed your version after uninstalling the previous one and deleting all its data (from both
.vscodeand%APPDATA%). There was no prompt by VSCode for me to authenticate myself for the controller repository.Thanks!
koesie10 commentedon Jul 1, 2025
@mrigankpawagi Are you able to sign out/sign in from the profile menu in the bottom-left corner of your VS Code window?
mrigankpawagi commentedon Jul 1, 2025
@koesie10 yes.
mrigankpawagi commentedon Jul 2, 2025
Just to confirm with you: Is this the source of the problem?
Everything worked correctly on my other PC where my username is 5-characters long (and so I guess there is no need for an 8.3 name).
Edit: I am still looking for a resolution to the problem because the other PC is my personal machine, but I wish to use MRVA on my work machine 😃!
koesie10 commentedon Jul 2, 2025
@mrigankpawagi Yes, exactly. The CodeQL CLI only works if given the "long path", so the extension tries to convert the short path to the long path. This usually works by finding the long path name in the directory listing, but it seems like in your case it cannot find the path. I'm not sure why that would happen, I'm unable to reproduce it on one of my machines with a long username.
I'm also not sure why the extension would be unable to authenticate you since there are no differences between in authentication between the released version of the extension and that VSIX file. Could you perhaps try using VS Code Insiders and seeing if it works there (just to see whether it works in a different installation of VS Code)?
mrigankpawagi commentedon Jul 2, 2025
Thanks @koesie10!
I did as you said -- VSCode Insiders prompted me to login and I was actually able to run MRVA properly :-)
koesie10 commentedon Jul 2, 2025
@mrigankpawagi Great, then I'll create a PR to hopefully get this change into the extension. Just to make sure, did your logs show something like "Short path was not resolved to long path, using native method", followed by "Expanded short path ... to ..."?
mrigankpawagi commentedon Jul 2, 2025
@koesie10 yes it does:
mrigankpawagi commentedon Jul 2, 2025
And of course, thanks for the rather quick response. I was very excited to run some queries with MRVA :-)