-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Not able to use config file for database creation command #13524
Comments
Have you tried using |
still the same error with |
Could you try removing the |
Doesnt work, tried keeping only |
Sorry, I think the documentation for the codescanning config file is the following https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/customizing-code-scanning#using-a-custom-configuration-file . I don't see any mention there for a command or build property. The documentation you were referring to before can be used to provide default values for command line arguments. I think neither is really suitable for your use-case. The easiest is probably to put the commands in a single shell script (for example Note that CodeQL may automatically recognize |
Thanks alot for this, it worked this way, sadly it's not mentioned in the doc anywhere but your replies were faster that solved issue quickly. |
while trying this out we're facing another issue :
not getting what's issue here, this is causing failures in I tried proceeding further with do I need to add |
Those error could be harmless if they only happen on processes the CodeQL analyser does not care about. In the linked example of a similar error, CodeQL was running inside a docker container and the error was reported on things running on the host machine. In your case the errors suggest that CodeQL may be wrongly setting the I'm a little surprised by the
No, normally |
I am not sure what and how to check that, can you please elaborate on this ? |
Could you try running Does your azure pipeline run a simple Could you also check which operating system and version is running on the azure devops workers? Do they run in docker or is some kind of virtualization or WSL in use? Perhaps running in a container may somehow confuse the code that detects whether a binary is 32 or 64bit . |
database creation command : OS details : We're running on Azure cloud agents, nothing on container. |
database-create-20230622.152801.058.log |
Thanks! Could you attach a list of all environment variables containing any of the words Could you also attach the |
Was trying to attach build-tracer.log but its more than 2GB.. zipped version goes ~180MB.. can attached only until 25 MB here. PRELOAD --> SEMMLE --> ODASA --> nothing CODEQL --> |
Ah indeed, the tracer log can be very large. Could you search for "interesting" fragments of the tracer log. I think the first 1000 lines are interesting, and any blocks of text ending with a You can also create an enterprise support ticket and use the upload large files functionality. |
build-tracer-lines_0_1200-and-catastrophic-error.log Adding some chunks from original build-tracer.log... I do see the same pattern repeated for "Catastrophic error" complaining about not able to open file. |
A team member mentioned: The log will be even larger. One way to reduce the log size would be to build only a smaller part of the code that still exhibits the same problem. To make sense of the log, we'd need to correlate the detected filetype from the log for a binary with the actual filetype of the binary that's emitting those error messages, and I don't see the name of that anywhere in the issue. Do you know which process is printing the |
Yes indeed. The good news is that CodeQL seems to be able to intercept compiler calls. The error messages are a bit unexpected, but the sampled ones all look like part of the "configure" phase of the build. Could you look for a few samples of Catastrophic error messages that mention source files from the repository you'd like to analyse? |
@HarshadDGhorpade-eaton , looking at the
It is very likely that all steps of the build that are of interest to CodeQL (compiling and linking) had already succeeded. You could try to add The build seems to fail because |
yes, you're right.. noticing its failing in last stages I tried proceeding further with do I need to add codeql database finalize ? |
That should work too in this case. I'd normally avoid carrying on after Under the hood the |
okay, latest build gone past this and now saying :
command : I can't pass suite name
|
codeql database analyze codeql/cpp-queries:codeql-suites/cpp-code-scanning.qls --format=sarifv2.1.0 --output=cpp-results.sarif --download is this the correct way ? |
The name of the query suite is actually |
The |
okay, we're now able to generate database, analyze it and upload results to github repo, thanks for the apt response from your side, appreciate it. I have shared the logs zip(containing tracer log and db creation logs) in a github repo setup by your colleauge. we will have to find a way to get rid of this "LD_PRELOAD" error, for now its okay to continue despite error knowing its not affecting the data codeql needed but this will allow real errors to go through as well. |
** Our build process comprises of 4-5 commands so trying to use config file and use it in command but getting error as "Invalid property specified in the configuration file. Ignoring it and proceeding" **
as per using-a-codeql-configuration-file, does config file gets used internally by
codeql database create
without specifying--codescanning-config
option ? Some internet sources talks about yaml-based config file as well and using it with--codescanning-config
option, can you please clarify what's correct way to use config file?I am trying this way :
codeql database create --language=cpp --github-url=https://github.com/ --codescanning-config=../codeql-config.yml --source-root . db
where codeql-config.yml file contents are like below :
getting below error :
Specifying multiple commands works but that becomes not maintainable as commands are lengthy :
codeql database create --command "cmd1" --command "cmd2" --command "cmd3" --command "cmd4" --language=cpp --github-url=https://github.com/ --source-root . db
The text was updated successfully, but these errors were encountered: