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

CLI incompatible with dataset #2548

Open
c0rv4x opened this issue Dec 17, 2019 · 1 comment
Open

CLI incompatible with dataset #2548

c0rv4x opened this issue Dec 17, 2019 · 1 comment
Labels
question Further information is requested

Comments

@c0rv4x
Copy link

c0rv4x commented Dec 17, 2019

Short description

CLI version 2.0.0 together with master branch of ql says A fatal error occurred: This QL dataset is not compatible with the QL library /workspace/codeql/codeql-javascript-repo/ql/src/NodeJS/InvalidExport.ql uses. Perhaps the dataset needs to be upgraded?

Long description

Following the guidelines from getting started i have installed the CLI to /workspace/codeql/codeql-cli directory.

Now i have cloned some JS repo and build a database on it like this:
./codeql-cli/codeql database create ./dbs/test1 --language javascript --source-root ./sources/1/
This works fine.

However, the analysis fails:
codeql database analyze dbs/test2 ./codeql-javascript-repo/ql/src/codeql-suites/javascript-lgtm.qls --format=csv --output=/dev/stdout which gives me the incompatibility error.

Other info

Here is some more information on my setup

>> codeql resolve qlpacks                                                                                                                                                
codeql-javascript (/workspace/codeql/codeql-javascript-repo/ql/src)
codeql-javascript-tests (/workspace/codeql/codeql-javascript-repo/ql/test)
codeql-javascript-upgrades (/workspace/codeql/codeql-javascript-repo/upgrades)
codeql-python (/workspace/codeql/codeql-python-repo/ql/src)
codeql-python-tests (/workspace/codeql/codeql-python-repo/ql/test)
codeql-python-upgrades (/workspace/codeql/codeql-python-repo/upgrades)
codeql-suite-helpers (/workspace/codeql/codeql-suite-helpers)
legacy-upgrades (/workspace/codeql/codeql-cli/legacy-upgrades)
>> codeql --version                                                                                                                                                      
CodeQL command-line toolchain.
Version: 2.0.0.
Copyright (C) 2019 GitHub, Inc.

Question

Should i somehow get the test suites of another version?

@c0rv4x c0rv4x added the question Further information is requested label Dec 17, 2019
@hmakholm
Copy link
Contributor

You need to run

codeql database upgrade ./dbs/test1

This is what the cryptic Perhaps the dataset needs to be upgraded? tries to say, but this message does admittedly sound more smug than helpful. (It's been updated to be more actually helpful in our master branch, but this has not made it into a release build yet).

Background explanation: Since the 2.0.0 release was built, the database schema we use for JavaScript analysis has changed slightly. The analysis library you check out from the Semmle/ql repo assumes the new schema, but the database-creation code in the 2.0.0 CLI produces the old one. The library comes with a script for upgrading the database to the new schema, which the CLI is capable of applying, but it doesn't dare do so spontaneously because this is a destructive operation that makes the database unusable with the old libraries, and the software cannot tell if you also have a copy of the old libraries around that you were planning to use, say, for comparative testing. So it waits to be asked explicitly to run the upgrades.

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

No branches or pull requests

2 participants