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

Issue while adding custom queries #1283

Closed
chiragagrawal026 opened this issue Oct 5, 2022 · 4 comments
Closed

Issue while adding custom queries #1283

chiragagrawal026 opened this issue Oct 5, 2022 · 4 comments

Comments

@chiragagrawal026
Copy link

chiragagrawal026 commented Oct 5, 2022

Hey this is the error I'm facing while creating custom queries in codeql Javascript.

Error: Error running analysis for javascript: Error: Failure invoking /opt/hostedtoolcache/CodeQL/0.0.0-20220923/x64/codeql/codeql with arguments database,interpret-results,--threads=2,--format=sarif-latest,-v,--output=../results/javascript.sarif,--no-sarif-add-snippets,--print-diagnostics-summary,--print-metrics-summary,--sarif-group-rules-by-pack,--sarif-add-query-help,--sarif-category,/language:javascript,/home/runner/work/_temp/codeql_databases/javascript,/home/runner/work/_temp/codeql_databases/javascript-queries-builtin.qls,/home/runner/work/_temp/codeql_databases/javascript-queries-custom-0.qls,/home/runner/work/_temp/codeql_databases/javascript-queries-custom-1.qls.

` Exit code 2 and error was:

  Writing logs to /home/runner/work/_temp/codeql_databases/javascript/log/database-interpret-results-20221005.185004.910.log.

Recording pack reference codeql/javascript-queries at /opt/hostedtoolcache/CodeQL/0.0.0-20220923/x64/codeql/qlpacks/codeql/javascript-queries/0.4.0.
Recording pack reference grid-js-queries at /home/runner/work/edp/edp/.github/codeql-queries/grid-js-queries.
Scanning for [codeql-pack.yml, qlpack.yml] from /opt/hostedtoolcache/CodeQL/0.0.0-20220923/x64/codeql/.codeqlmanifest.json
Scanning for [codeql-pack.yml, qlpack.yml] from /opt/hostedtoolcache/CodeQL/0.0.0-20220923/x64/
Not scanning from /opt/hostedtoolcache/CodeQL/0.0.0-20220923/x64/codeql which is already done.`

Please help I have a project due tomorrow.
Thanks in advance.

@adityasharad
Copy link
Contributor

Could you please share the full error log, or a link to a public workflow run? The actual error is further down from the snippet you shared.

@chiragagrawal026
Copy link
Author

Thanks for replying!
Please find the link to the workflow run
https://github.com/chiragagrawal026/edp/actions/runs/3190332513

@adityasharad
Copy link
Contributor

A fatal error occurred: Could not process query metadata for /home/runner/work/edp/edp/.github/codeql-queries/grid-js-queries/outbound-request.ql.
  Error was: Cannot process query metadata for a query without the '@kind' metadata property. To learn more, see https://codeql.github.com/docs/writing-codeql-queries/metadata-for-codeql-queries/ [NO_KIND_SPECIFIED]
  Error: Failure invoking /opt/hostedtoolcache/CodeQL/0.0.0-20220923/x64/codeql/codeql with arguments database,interpret-results,--threads=2,--format=sarif-latest,-v,--output=../results/javascript.sarif,--no-sarif-add-snippets,--print-diagnostics-summary,--print-metrics-summary,--sarif-group-rules-by-pack,--sarif-add-query-help,--sarif-category,/language:javascript,/home/runner/work/_temp/codeql_databases/javascript,/home/runner/work/_temp/codeql_databases/javascript-queries-builtin.qls,/home/runner/work/_temp/codeql_databases/javascript-queries-custom-0.qls,/home/runner/work/_temp/codeql_databases/javascript-queries-custom-1.qls.

This is the error. Your custom query is missing the query metadata section, particularly @kind path-problem. Please see https://codeql.github.com/docs/writing-codeql-queries/metadata-for-codeql-queries for more information. Thanks for trying out CodeQL and developing your own queries!

@chiragagrawal026
Copy link
Author

Hey, thank you so much for this.
It really helped!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants