Skip to content

[BUG]: AdvancedSecurity-Codeql-Analyze@1 v1.1.341 errors with "Unknown build mode for database" since update from v1.1.337 #21603

@oatsoda

Description

@oatsoda

New issue checklist

Task name

AdvancedSecurity-Codeql-Analyze

Task version

1.1.341

Issue Description

Yesterday my AdvancedSecurity-Codeql-Analyze@1 task ran fine using v 1.1.337. Today, it looks like it is using a newly released v 1.1.341 and I am getting:

Database finalization is a time consuming process and may take a while to complete.
Extracting javascript
##[debug]which '/opt/hostedtoolcache/CodeQL/2.23.8/x64/codeql/codeql'
##[debug]found: '/opt/hostedtoolcache/CodeQL/2.23.8/x64/codeql/codeql'
/opt/hostedtoolcache/CodeQL/2.23.8/x64/codeql/codeql resolve extractor --format=json --language=javascript
"/opt/hostedtoolcache/CodeQL/2.23.8/x64/codeql/javascript"

##[debug]which '/opt/hostedtoolcache/CodeQL/2.23.8/x64/codeql/codeql'
##[debug]found: '/opt/hostedtoolcache/CodeQL/2.23.8/x64/codeql/codeql'
/opt/hostedtoolcache/CodeQL/2.23.8/x64/codeql/codeql database trace-command --no-internal-use-lua-tracing --use-build-mode /home/vsts/work/_temp/advancedsecurity.codeql/d/javascript
A fatal error occurred: Unknown build mode for database /home/vsts/work/_temp/advancedsecurity.codeql/d/javascript. Please pass a build command or --index-traceless-dbs instead of --use-build-mode.

There don't seem to be any options, according to the docs, that I can adjust to fix/workaround this?

My task is simply:

- task: AdvancedSecurity-Codeql-Analyze@1
   displayName: 'Advanced Security Code Scanning' 

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

ubuntu-latest

Relevant log output

Session Id=f3abed9d-9757-4a42-8758-f32dba498777
##[debug]ram=undefined
##[debug]threads=undefined
##[debug]querysuite=undefined
##[debug]OneESPT=undefined
##[debug]WaitForProcessing=false
##[debug]WaitForProcessingInterval=5
##[debug]WaitForProcessingTimeout=120
Starting database finalization.
Database finalization is a time consuming process and may take a while to complete.
Extracting javascript
##[debug]which '/opt/hostedtoolcache/CodeQL/2.23.8/x64/codeql/codeql'
##[debug]found: '/opt/hostedtoolcache/CodeQL/2.23.8/x64/codeql/codeql'
/opt/hostedtoolcache/CodeQL/2.23.8/x64/codeql/codeql resolve extractor --format=json --language=javascript
"/opt/hostedtoolcache/CodeQL/2.23.8/x64/codeql/javascript"

##[debug]which '/opt/hostedtoolcache/CodeQL/2.23.8/x64/codeql/codeql'
##[debug]found: '/opt/hostedtoolcache/CodeQL/2.23.8/x64/codeql/codeql'
/opt/hostedtoolcache/CodeQL/2.23.8/x64/codeql/codeql database trace-command --no-internal-use-lua-tracing --use-build-mode /home/vsts/work/_temp/advancedsecurity.codeql/d/javascript
A fatal error occurred: Unknown build mode for database /home/vsts/work/_temp/advancedsecurity.codeql/d/javascript. Please pass a build command or --index-traceless-dbs instead of --use-build-mode.

##[warning] Error running the 'database trace-command' CodeQL command for javascript (0)
##[debug]task result: Failed
##[error]Error running the 'database trace-command' CodeQL command for javascript (0)
##[debug]Processed: ##vso[task.issue type=error;]Error running the 'database trace-command' CodeQL command for javascript (0)
##[debug]Processed: ##vso[task.complete result=Failed;]Error running the 'database trace-command' CodeQL command for javascript (0)

====================================================================================================
Analyzing CodeQL execution results.
CodeQL analysis finished with exit code 2.
Please refer to this documentation for more information on this exit code https://docs.github.com/en/code-security/codeql-cli/using-the-advanced-functionality-of-the-codeql-cli/exit-codes
====================================================================================================

Learn more about the scan for the CodeQL build tasks:
https://aka.ms/advanced-security/code-scanning/detection

Full task logs with system.debug enabled

(available on request)

Repro steps

Setup a pipeline with the following:


pool:
  vmImage: ubuntu-latest

stages:
- stage: SecurityScans
  displayName: Security Scans
  jobs:
  - job: SecurityScans
    displayName: Security Scans
    steps:
    - task: AdvancedSecurity-Dependency-Scanning@1
      displayName: 'Advanced Security Dependency Scanning' 
      inputs:
        directoryExclusionList: node_modules
  
    - task: AdvancedSecurity-Codeql-Init@1
      inputs:
        enableAutomaticCodeQLInstall: true
        languages: javascript
        querysuite: code-scanning
        buildtype: 'none'

    - task: AdvancedSecurity-Codeql-Analyze@1
      displayName: 'Advanced Security Code Scanning'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions