Repository navigation
Closed
Description
We are using a multi module Golang repository with Go Workspace. CodeQL default workflow settings were working fine with no issues. Suddenly, with no changes in repo structure, it now fails with CodeQL detected code written in Go but could not process any of it.
Also, troubleshooting steps here did not fix it.
Autobuild step and Init seems to be working fine but Analysis started failing all the time.
repo: https://github.com/threefoldtech/tfgrid-sdk-go
example workflow: https://github.com/threefoldtech/tfgrid-sdk-go/actions/runs/8079246055/job/22073247305
logs:
Run github/codeql-action/analyze@v3
with:
category: /language:go
output: ../results
upload: always
cleanup-level: brutal
add-snippets: false
skip-queries: false
checkout_path: /home/runner/work/tfgrid-sdk-go/tfgrid-sdk-go
upload-database: true
wait-for-processing: true
token: ***
matrix: {
"language": "go"
}
expect-error: false
env:
CODE_SCANNING_REF: refs/pull/867/head
CODE_SCANNING_IS_ANALYZING_DEFAULT_BRANCH: false
CODE_SCANNING_WORKFLOW_FILE: H4sIAAAAAAAA/6xUTW/bOBC961cMvEGye5B82PYiIEBUx07dGnYbtwjaIhBoaSSzkUiHHMpVXP/3gqKUxo2T+NCbOPP45uM9UbASQ+gNZIofJz1PGeG70NFmAzmnpVkEWKGggIuVIR0kMsVYJ0wILvJYGRFbPGy3nhQhpLVgJU8877tc6NADYIIV9R3aTwDHHLlQE1FGaN9eNAsjyPgFI9TUpFaoSq41l0K72wAsoeYIClnaxhIpCAXtBjUmRnGq/aZ1HcJacXIVLZ4Lg74UPiolVQgZK7RLalKMMK+7ghnjhZ8xTQ9BACUjxX90IICCidywHEP4BrmE6yaBouoQg9n5MJ4Poul0PL2IL4ejg9eLmd3sPpbxPI6m0eTLV3s4H46iz5NP8ZvLaDp4eyg717GTxx5SzJgpKF4oJpLlU1WvZpfvR5PZVTwaT4aH1llLdZMVch1nvMCOWROuWmH91hiDJSY30hAoXEnNSaq6bcJo1GEnfz9pcWfVK2+HYCw4cVbwOwRn6J3rrtG+7e228B1ZnwtOZ9X/LXDNaflYVu0GdaoHXfT3igBuDSpucb0e/APnbpVNtAZtOuu19st4HsLP+wgALRUy8kuZYqGth+B6d65Bc8kofHkehVoWFfooKq6kKFE8GI+n9i95BHh2+Gdn7xqcI5kVXMi9cmmb9HN5Vr3u+sjCR4ynp3CSyxM4PoZMyfLdfDb9t/FIsKfjQBpqjPYg9l+QtGtitm6Qy6BCZd+PvfPl0m/TbsK/XdSuaGdHkSG5MLxIXxaRdVAr3Q7JB1SZVGVrb/eUaq4PoHSP7lNWT+yzJ1UdQq9/r/zRZvOHStttz/sVAAD//7BdVxsyBgAA
CODEQL_ACTION_FEATURE_MULTI_LANGUAGE: false
CODEQL_ACTION_FEATURE_SANDWICH: false
CODEQL_ACTION_FEATURE_SARIF_COMBINE: true
CODEQL_ACTION_FEATURE_WILL_UPLOAD: true
CODEQL_ACTION_VERSION: 3.24.5
JOB_RUN_UUID: b4f685d9-0748-425b-8025-3f1f4bc397e4
CODEQL_ACTION_INIT_HAS_RUN: true
CODEQL_ACTION_ANALYSIS_KEY: dynamic/github-code-scanning/codeql:analyze
CODEQL_WORKFLOW_STARTED_AT: 2024-02-28T10:59:00.858Z
CODEQL_ACTION_GO_BINARY: /home/runner/work/_temp/codeql-action-go-tracing/bin/go
CODEQL_RAM: 14567
CODEQL_THREADS: 4
CODEQL_EXTRACTOR_PYTHON_DISABLE_LIBRARY_EXTRACTION: true
CODEQL_SCRATCH_DIR: /home/runner/work/_temp/codeql_databases/working
CODEQL_DIST: /opt/hostedtoolcache/CodeQL/2.16.3/x64/codeql
CODEQL_PLATFORM: linux64
CODEQL_PLATFORM_DLL_EXTENSION: .so
CODEQL_JAVA_HOME: /opt/hostedtoolcache/CodeQL/2.16.3/x64/codeql/tools/linux64/java
CODEQL_EXTRACTOR_GO_ROOT: /opt/hostedtoolcache/CodeQL/2.16.3/x64/codeql/go
CODEQL_EXTRACTOR_GO_WIP_DATABASE: /home/runner/work/_temp/codeql_databases/go
CODEQL_EXTRACTOR_GO_DIAGNOSTIC_DIR: /home/runner/work/_temp/codeql_databases/go/diagnostic/extractors/go
CODEQL_EXTRACTOR_GO_LOG_DIR: /home/runner/work/_temp/codeql_databases/go/log
CODEQL_EXTRACTOR_GO_SCRATCH_DIR: /home/runner/work/_temp/codeql_databases/go/working
CODEQL_EXTRACTOR_GO_TRAP_DIR: /home/runner/work/_temp/codeql_databases/go/trap/go
CODEQL_EXTRACTOR_GO_SOURCE_ARCHIVE_DIR: /home/runner/work/_temp/codeql_databases/go/src
SEMMLE_HANDLE_STATIC_BINARIES: true
CODEQL_EXTRACTOR_GO_THREADS: 4
CODEQL_EXTRACTOR_GO_RAM: 14567
CODEQL_TRACER_LOG: /home/runner/work/_temp/codeql_databases/log/build-tracer.log
CODEQL_TRACER_DIAGNOSTICS_DIR: /home/runner/work/_temp/codeql_databases/diagnostic/tracer
CODEQL_TRACER_LANGUAGES: go
SEMMLE_PRELOAD_libtrace: /opt/hostedtoolcache/CodeQL/2.16.3/x64/codeql/tools/linux64/${LIB}_${PLATFORM}_trace.so
SEMMLE_PRELOAD_libtrace32: /opt/hostedtoolcache/CodeQL/2.16.3/x64/codeql/tools/linux64/lib32trace.so
SEMMLE_PRELOAD_libtrace64: /opt/hostedtoolcache/CodeQL/2.16.3/x64/codeql/tools/linux64/lib64trace.so
CODEQL_RUNNER: /opt/hostedtoolcache/CodeQL/2.16.3/x64/codeql/tools/linux64/runner
LD_PRELOAD: /opt/hostedtoolcache/CodeQL/2.16.3/x64/codeql/tools/linux64/${LIB}_${PLATFORM}_trace.so
CODEQL_ACTION_DID_AUTOBUILD_GOLANG: true
CODEQL_ACTION_AUTOBUILD_DID_COMPLETE_SUCCESSFULLY: true
While resolving threads, found a cgroup CPUs file with 4 CPUs in /sys/fs/cgroup/cpuset.cpus.effective.
/opt/hostedtoolcache/CodeQL/2.16.3/x64/codeql/codeql version --format=json
{
"productName" : "CodeQL",
"vendor" : "GitHub",
"version" : "2.16.3",
"sha" : "89973abb6e1d3083dfb8426eb0e210df19ca36be",
"branches" : [
"codeql-cli-2.16.3"
],
"copyright" : "Copyright (C) 2019-2024 GitHub, Inc.",
"unpackedLocation" : "/opt/hostedtoolcache/CodeQL/2.16.3/x64/codeql",
"configFileLocation" : "/home/runner/.config/codeql/config",
"configFileFound" : false,
"features" : {
"analysisSummaryV2Option" : true,
"buildModeOption" : true,
"bundleSupportsIncludeDiagnostics" : true,
"featuresInVersionResult" : true,
"indirectTracingSupportsStaticBinaries" : false,
"supportsPython312" : true,
"mrvaPackCreate" : true,
"threatModelOption" : true,
"traceCommandUseBuildMode" : true,
"v2ramSizing" : true,
"mrvaPackCreateMultipleQueries" : true,
"setsCodeqlRunnerEnvVar" : true
}
}
Finalizing go
/opt/hostedtoolcache/CodeQL/2.16.3/x64/codeql/codeql database finalize --finalize-dataset --threads=4 --ram=14567 /home/runner/work/_temp/codeql_databases/go
CodeQL detected code written in Go but could not process any of it. Review our troubleshooting guide at https://gh.io/troubleshooting-code-scanning/no-source-code-seen-during-build .
Error: Encountered a fatal error while running "/opt/hostedtoolcache/CodeQL/2.16.3/x64/codeql/codeql database finalize --finalize-dataset --threads=4 --ram=14567 /home/runner/work/_temp/codeql_databases/go". Exit code was 32 and last log line was: CodeQL detected code written in Go but could not process any of it. Review our troubleshooting guide at https://gh.io/troubleshooting-code-scanning/no-source-code-seen-during-build . See the logs for more details.
I am not sure where the issue is since we are not using custom building and Autobuild step seems to be working fine. It was also working with no errors before.
Metadata
Metadata
Assignees
Labels
No labels
Activity
mbg commentedon Mar 7, 2024
Hi @AbdelrahmanElawady 👋
Thanks for opening this issue. I have reviewed the most recent successful run on your repository and compared it to the first unsuccessful one.
What I can see is that, in both cases, we discover your
Makefileand invoke it. In the successful case, running theMakefileactually fails, apparently because the installed version of Go in that run is Go 1.20.14 andgo mod tidydoesn't support Go 1.21 there. This causes our autobuilder to then attempt to figure out how to build your project manually by invoking suitablegocommands, which it does successfully (and "221 out of 300 Go files" could be extracted).In the unsuccessful case, it seems that running the
Makefileis successful because Go 1.21 is now installed on the runner (the GitHub Actions image changed recently to include Go 1.21 instead of Go 1.20 as the default). This, in turn, seems to lead to a failing interaction between our Go extractor and your Go workspace. In the current release of CodeQL, Go workspaces are not officially supported.The good news is that the next version of CodeQL is going to ship with a significantly overhauled Go autobuilder/extractor which will explicitly support Go workspaces and multi-module repositories. This version is expected to become available in the next few days. I have just tried to run this new version on your repository locally and it was able to successfully analyse your project.
AbdelrahmanElawady commentedon Mar 7, 2024
HI @mbg
I appreciate your deep dive into this! I will wait then for the next release. Thanks a lot!
smowton commentedon Mar 8, 2024
If you want to try it out today you can use
Then make a note to remove that line in a week once the new release is rolled out
ramshad-sha commentedon Mar 25, 2024
mbg commentedon Mar 27, 2024
@AbdelrahmanElawady I am closing this now since there hasn't been an update, but feel free to let us know if this is still not working for you.
AbdelrahmanElawady commentedon Mar 28, 2024
I just tried latest and it's working again. Thanks everyone!