github / codeql

CodeQL: the libraries and queries that power security researchers around the world, as well as code scanning in GitHub Advanced Security
https://codeql.github.com
MIT License
7.51k stars 1.49k forks source link

csharp Error: No code found during the build #15377

Closed Subharanjan2055 closed 8 months ago

Subharanjan2055 commented 8 months ago

here build is successfully happening . How ever in the perform codeql analysis step its throwing CodeQL detected code written in C# but could not process any of it. Review our troubleshooting guide at https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/troubleshooting-the-codeql-workflow#no-code-found-during-the-build. Error: No code found during the build. Please see: https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/troubleshooting-code-scanning#no-code-found-during-the-build

Any idea would be appreciated .

Thanks !! Subh

smowton commented 8 months ago

Could you rerun the build with debugging enabled and provide the debug artifact that it produces, if you're happy to share your database and logs?

Subharanjan2055 commented 8 months ago

Hi @smowton ,

Can share only this .

Hi @smowton ,

Can share only this .

[debug]Evaluating condition for step: 'Perform CodeQL Analysis'

[debug]Evaluating: success()

[debug]Evaluating success:

[debug]=> true

[debug]Result: true

[debug]Starting: Perform CodeQL Analysis

[debug]Register post job cleanup for action: github/codeql-action/analyze@v2

[debug]Loading inputs

[debug]Evaluating: github.workspace

[debug]Evaluating Index:

[debug]..Evaluating github:

[debug]..=> Object

[debug]..Evaluating String:

[debug]..=> 'workspace'

[debug]=> 'C:\uat-runner3_work\'

[debug]Result: 'C:\uat-runner3_work\PI-FORWalletCreation\PI-FORWalletCreation'

[debug]Evaluating: github.token

[debug]Evaluating Index:

[debug]..Evaluating github:

[debug]..=> Object

[debug]..Evaluating String:

[debug]..=> 'token'

[debug]=> '***'

[debug]Result: '***'

[debug]Evaluating: toJson(matrix)

[debug]Evaluating toJson:

[debug]..Evaluating matrix:

[debug]..=> Object

[debug]=> '{

[debug] "language": "csharp"

[debug]}'

[debug]Result: '{

[debug] "language": "csharp"

[debug]}'

[debug]Loading env

Run github/codeql-action/analyze@v2

[debug]Sending status report: {"workflow_run_id":18373,"workflow_run_attempt":2,"workflow_name":"PI-FORWalletCreation","job_name":"analyze","analysis_key":".github/workflows/codeql-analysis.yml:analyze","commit_oid":"1d06b675f46dcecf9e666cbc53091f1eb272cde3","ref":"refs/heads/main","action_name":"finish","action_ref":"v2","action_oid":"unknown","started_at":"2024-01-19T08:01:48.865Z","action_started_at":"2024-01-19T08:02:37.660Z","status":"starting","testing_environment":"","runner_os":"Windows","action_version":"2.2.12","matrix_vars":"{\n \"language\": \"csharp\"\n}","runner_arch":"X64","runner_os_release":"10.0.20348"}

[debug]Loaded config:

[debug]{"languages":["csharp"],"queries":{"csharp":{"builtin":["C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Input Validation\UseOfFileUpload.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CookieWithOverlyBroadDomain.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CookieWithOverlyBroadPath.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-011\ASPNetDebug.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-022\TaintedPath.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-022\ZipSlip.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-078\CommandInjection.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-079\XSS.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-089\SqlInjection.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-090\LDAPInjection.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-091\XMLInjection.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-094\CodeInjection.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-099\ResourceInjection.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-112\MissingXMLValidation.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-114\AssemblyPathInjection.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-117\LogForging.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-119\LocalUnvalidatedArithmetic.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-134\UncontrolledFormatString.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-201\ExposureInTransmittedData.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-209\ExceptionInformationExposure.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-248\MissingASPNETGlobalErrorHandler.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-312\CleartextStorage.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-352\MissingAntiForgeryTokenValidation.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-359\ExposureOfPrivateInformation.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-384\AbandonSession.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-451\MissingXFrameOptions.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-502\DeserializedDelegate.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-502\UnsafeDeserializationUntrustedInput.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-548\ASPNetDirectoryListing.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-601\UrlRedirect.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-611\UntrustedDataInsecureXml.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-614\RequireSSL.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-643\XPathInjection.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-730\ReDoS.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-730\RegexInjection.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-807\ConditionalBypass.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\Encryption using ECB.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\HeaderCheckingDisabled.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\InadequateRSAPadding.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\InsecureRandomness.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\InsufficientKeySize.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\PersistentCookie.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\WeakEncryption.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Configuration\EmptyPasswordInConfigurationFile.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Configuration\PasswordInConfigurationFile.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Input Validation\ValueShadowing.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Input Validation\ValueShadowingServerVariable.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Likely Bugs\ThreadUnsafeICryptoTransform.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Likely Bugs\ThreadUnsafeICryptoTransformLambda.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-020\RuntimeChecksBypass.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-078\StoredCommandInjection.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-079\StoredXSS.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-089\SecondOrderSqlInjection.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-090\StoredLDAPInjection.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-327\InsecureSQLConnection.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-643\StoredXPathInjection.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-798\HardcodedConnectionString.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Security Features\CWE-798\HardcodedCredentials.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Diagnostics\CompilerError.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Diagnostics\CompilerMessage.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Diagnostics\DiagnosticExtractionErrors.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Diagnostics\DiagnosticNoExtractionErrors.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Diagnostics\ExtractorError.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Diagnostics\ExtractorMessage.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Metrics\Summaries\LinesOfCode.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Telemetry\ExternalLibraryUsage.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Telemetry\SupportedExternalApis.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Telemetry\SupportedExternalSinks.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Telemetry\SupportedExternalSources.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Telemetry\SupportedExternalTaint.ql","C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\qlpacks\codeql\csharp-queries\0.5.6\Telemetry\UnsupportedExternalAPIs.ql"],"custom":[]}},"pathsIgnore":[],"paths":[],"packs":{},"originalUserInput":{"name":"My CodeQL config","disable-default-queries":true,"queries":[{"uses":"security-extended"}]},"tempDir":"C:\uat-runner3\_work\_temp","codeQLCmd":"C:\uat-runner3\_work\_tool\CodeQL\2.12.6-20230403\x64\codeql\codeql.exe","gitHubVersion":{"type":1,"version":"3.9.7"},"dbLocation":"C:\uat-runner3\_work\_temp\codeql_databases","debugMode":true,"debugArtifactName":"debug-artifacts","debugDatabaseName":"db","augmentationProperties":{"injectedMlQueries":false,"packsInputCombines":false,"queriesInputCombines":false},"trapCaches":{},"trapCacheDownloadTime":0}

C:\uat-runner3_work_tool\CodeQL\2.12.6-20230403\x64\codeql\codeql.exe version --format=terse 2.12.6 ::group::Finalizing csharp Finalizing csharp C:\uat-runner3_work_tool\CodeQL\2.12.6-20230403\x64\codeql\codeql.exe database finalize --finalize-dataset --threads=4 --ram=14703 C:\uat-runner3_work_temp\codeql_databases\csharp CodeQL detected code written in C# but could not process any of it. Review our troubleshooting guide at https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/troubleshooting-the-codeql-workflow#no-code-found-during-the-build. Error: No code found during the build. Please see: https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/troubleshooting-code-scanning#no-code-found-during-the-build

[debug]Sending status report: {"workflow_run_id":18373,"workflow_run_attempt":2,"workflow_name":"PI-FORWalletCreation","job_name":"analyze","analysis_key":".github/workflows/codeql-analysis.yml:analyze","commit_oid":"","ref":"refs/heads/main","action_name":"finish","action_ref":"v2","action_oid":"unknown","started_at":"2024-01-19T08:01:48.865Z","action_started_at":"2024-01-19T08:02:37.660Z","status":"failure","testing_environment":"","runner_os":"Windows","action_version":"2.2.12","cause":"No code found during the build. Please see:\nhttps://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/troubleshooting-code-scanning#no-code-found-during-the-build","exception":"Error: No code found during the build. Please see:\nhttps://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/troubleshooting-code-scanning#no-code-found-during-the-build\n at toolrunnerErrorCatcher (C:\uat-runner3\_work\_actions\github\codeql-action\v2\lib\toolrunner-error-catcher.js:74:27)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)\n at async Object.finalizeDatabase (C:\uat-runner3\_work\_actions\github\codeql-action\v2\lib\codeql.js:437:13)\n at async finalizeDatabaseCreation (C:\uat-runner3\_work\_actions\github\codeql-action\v2\lib\analyze.js:115:13)\n at async runFinalize (C:\uat-runner3\_work\_actions\github\codeql-action\v2\lib\analyze.js:285:21)\n at async run (C:\uat-runner3\_work\_actions\github\codeql-action\v2\lib\analyze-action.js:167:29)\n at async runWrapper (C:\uat-runner3\_work\_actions\github\codeql-action\v2\lib\analyze-action.js:239:9)","completed_at":"2024-01-19T08:02:45.048Z","matrix_vars":"{\n \"language\": \"csharp\"\n}","runner_arch":"X64","runner_os_release":"10.0.20348","codeql_version":"2.12.6","ml_powered_javascript_queries":"false"}

[debug]Node Action run completed with exit code 1

[debug]CODEQL_ACTION_VERSION='2.2.12'

[debug]CODEQL_ACTION_FEATURE_SARIF_COMBINE='true'

[debug]CODEQL_ACTION_FEATURE_WILL_UPLOAD='true'

[debug]CODEQL_ACTION_FEATURE_MULTI_LANGUAGE='false'

[debug]CODEQL_ACTION_FEATURE_SANDWICH='false'

[debug]Finishing: Perform CodeQL Analysis

Subharanjan2055 commented 8 months ago

@smowton Any update ?

Thanks!! Subh

smowton commented 8 months ago

I'm afraid if you're unable to share debug logs then I can only give you generic advice:

  1. Check if extraction works with an automatic build:
      - name: Autobuild
        uses: github/codeql-action/autobuild@v3
  1. If a manual build is necessary, ensure it is a clean rebuild of your codebase, i.e. there is no build caching or similar preventing the build from invoking the compiler, which CodeQL traces and mimics in order to extract and analyse your code.
  2. Download the debug artifact described above yourself and take a look over the log/ directory for any potentially interesting lines you would be willing to share.
  3. Or, try extracting the project locally using the CodeQL CLI -- just run codeql database create -l csharp db in the root of your repository, and take a look over the db/log directory for any hints about what's happening.
Subharanjan2055 commented 8 months ago

Hi @smowton , Cleaning cache, working perfectly fine for me .before i was thinking it will not taking from cache but it was. thanks closing the issue.

Thanks, Subh