Description
I've been following the guidance on how to configure CodeQL, create a database and analyze with a query pack. But I always end up with the following error:
A fatal error occurred: This CodeQL database is not compatible with the QL library /home/chris/projects/codeql/codeql-repo/python/ql/src/Security/CWE-502/UnsafeDeserialization.ql uses. You may need to run 'codeql database upgrade testDb'.
It doesn't matter what version of CodeQL I'm using, how many times I update the database or the queries I use. It's always the same error.
It's the case for the CPP, JavaScript and Python queries.
My directory that holes everything CodeQL is here.
$pwd
/home/chris/projects/codeql
The CodeQL version is 2.2.4 (I've also tried it with earlier versions) and is moved to a codeql-cli
directory.
$curl -LO https://github.com/github/codeql-cli-binaries/releases/download/v2.2.4/codeql-linux64.zip
$unzip codeql-linux64.zip
$mv codeql codeql-cli
I use the latest queries extracted to codeql-repo
.
$ git clone https://github.com/github/codeql.git codeql-repo
I create the database and put it in dukDatabase
.
codeql database create dukDatabase --language=cpp --command=make --source-root=../duktape
Then I try to analyse with a query, or query pack and it always fails.
codeql database analyze dukDatabase/ codeql-repo/cpp/ql/src/codeql-suites/cpp-lgtm.qls --format=sarifv2 --output=duk.sarifv2 --search-path=codeql-repo/
I always get an error complaining about not finding dependencies, but I add --search-path
to resolve it. But I always get the error about an incompatible database.
I've followed the guidance to update the database, it just says it's already updated.
It doesn't matter what version of codeql I used or queries...it never works.
Any help is appreciated.