codeql icon indicating copy to clipboard operation
codeql copied to clipboard

VSCode extension AST viewer tab not showing AST for some files.

Open aaaayush-n opened this issue 1 year ago • 3 comments
trafficstars

Description of the issue

Hello, I am using the codeql using VSCode extension. I want to generate AST for a particular file but it just won't show me the AST. Please note that I can view the AST for some files(majority of them) but for a few files I am unable to do so. All these files are present in the CodeQL Database that was generated. I have verified from the src.zip file. There is no error when I click on CODEQL: View AST button on right click in my src file in both working and non-working cases.(I've added logs at the end of this issue) I have attached Images for the extension tab when It generates an AST and when it doesn't.

Logs for CodeQL: View AST working case:

Reading bqrs data using CodeQL CLI: bqrs decode -v --log-to-stderr --format json --entities=id,url,string --result-set nodes /var/folders/p9/gkqn3kwx2llcc6m40ky4x25c0000gn/T/queries_-97292-WeHCoy2Wtomq/contextual-query-storage/printAst.ql-nFz0NKDOSDiYpdH5Ads_w/results.bqrs...

CLI command succeeded.
Reading bqrs data using CodeQL CLI: bqrs decode -v --log-to-stderr --format json --entities=id,url,string --result-set edges /var/folders/p9/gkqn3kwx2llcc6m40ky4x25c0000gn/T/queries_-97292-WeHCoy2Wtomq/contextual-query-storage/printAst.ql-nFz0NKDOSDiYpdH5Ads_w/results.bqrs...

CLI command succeeded.
Reading bqrs data using CodeQL CLI: bqrs decode -v --log-to-stderr --format json --entities=id,url,string --result-set graphProperties /var/folders/p9/gkqn3kwx2llcc6m40ky4x25c0000gn/T/queries_-97292-WeHCoy2Wtomq/contextual-query-storage/printAst.ql-nFz0NKDOSDiYpdH5Ads_w/results.bqrs...

CLI command succeeded.

Screenshot 2024-07-25 at 11 13 15 AM

Logs for CodeQL: View AST non-working case:

Reading bqrs data using CodeQL CLI: bqrs decode -v --log-to-stderr --format json --entities=id,url,string --result-set nodes /var/folders/p9/gkqn3kwx2llcc6m40ky4x25c0000gn/T/queries_-97292-WeHCoy2Wtomq/contextual-query-storage/printAst.ql-yst2iLGzGqpy1dQl2oDU4/results.bqrs...

CLI command succeeded.
Reading bqrs data using CodeQL CLI: bqrs decode -v --log-to-stderr --format json --entities=id,url,string --result-set edges /var/folders/p9/gkqn3kwx2llcc6m40ky4x25c0000gn/T/queries_-97292-WeHCoy2Wtomq/contextual-query-storage/printAst.ql-yst2iLGzGqpy1dQl2oDU4/results.bqrs...

CLI command succeeded.
Reading bqrs data using CodeQL CLI: bqrs decode -v --log-to-stderr --format json --entities=id,url,string --result-set graphProperties /var/folders/p9/gkqn3kwx2llcc6m40ky4x25c0000gn/T/queries_-97292-WeHCoy2Wtomq/contextual-query-storage/printAst.ql-yst2iLGzGqpy1dQl2oDU4/results.bqrs...

CLI command succeeded.
Screenshot 2024-07-25 at 11 12 43 AM

aaaayush-n avatar Jul 25 '24 06:07 aaaayush-n

Hi @aaaayush-n 👋

Do you have the logs for when you created the database (i.e. ran codeql database create ...) and, if so, could you share them?

mbg avatar Jul 25 '24 15:07 mbg

@mbg I do not have the logs when the database was created, It was a long while back. Is there some other way I can help?

aaaayush-n avatar Jul 30 '24 05:07 aaaayush-n

Some options:

  • If you are able to share the database with us, we could have a look at it to see if the cause is evident from it.
  • if not, there are some log files contained in the database that you could share with us instead.
  • You could regenerate the database and share that log

mbg avatar Jul 30 '24 09:07 mbg