"The main branch has no lines of code "

Hi Team

I am running a sonar scan in my Linux terminal, In the terminal, I am not seeing any errors, and it’s showing that all are successful but in sonarqube web, it’s showing “The main branch has no lines of code”.
can you tell me what is the problem?
If not source code to run it should show at least zero coverage in web right?

Logs is:

ftcbuild@deb[/sandbox/ftcbuild]$ /sandbox/untriage/sonar-scanner-4.2.0.1873-linux/bin/sonar-scanner -X -Dsonar.verbose=true -Dsonar.projectKey=project-api -Dsonar.projectVersion=4.0.0.0 -Dsonar.sources=./ -Dsonar.host.url=http://server-url:9000 -Dsonar.login=f9108ea61403c3e94b9558e4e637492029a0409d -Dsonar.scm.provide=git -Dsonar.c.file.suffixes=- -Dsonar.cpp.file.suffixes=- -Dsonar.objc.file.suffixes=-
03:56:51.087 INFO: Scanner configuration file: /sandbox/sandbox2/untriage/sonar-scanner-4.2.0.1873-linux/conf/sonar-scanner.properties

03:56:51.971 DEBUG: GET 200 http://server-url:9000/api/settings/values.protobuf | time=79ms
03:56:52.006 INFO: Load global settings (done) | time=116ms
03:56:52.011 INFO: Server id: FB4B1083-AXB3jRIfCNhXjnNtxn84
03:56:52.014 INFO: User cache: /h/ftcbuild/.sonar/cache
03:56:52.024 INFO: Load/download plugins
03:56:52.024 INFO: Load plugins index
03:56:52.047 DEBUG: GET 200 http://server-url:9000/api/plugins/installed | time=22ms
03:56:52.093 INFO: Load plugins index (done) | time=69ms
03:56:52.484 INFO: Load/download plugins (done) | time=460ms
03:56:52.857 DEBUG: Plugins:
03:56:52.857 DEBUG:   * SonarCSS 1.2.0.1325 (cssfamily)
03:56:52.861 DEBUG:   * Svn 1.9.0.1295 (scmsvn)
03:56:52.861 DEBUG:   * SonarPLSQL 3.4.1.2576 (plsql)
03:56:52.862 DEBUG:   * SonarScala 1.5.0.315 (sonarscala)
03:56:52.862 DEBUG:   * SonarC# 8.4.0.15306 (csharp)
03:56:52.862 DEBUG:   * Vulnerability Analysis 8.1.0.675 (security)
03:56:52.862 DEBUG:   * SonarJava 6.1.0.20866 (java)
03:56:52.862 DEBUG:   * SonarHTML 3.2.0.2082 (web)
03:56:52.862 DEBUG:   * SonarFlex 2.5.1.1831 (flex)
03:56:52.862 DEBUG:   * SonarXML 2.0.1.2020 (xml)
03:56:52.862 DEBUG:   * SonarTS 2.1.0.4359 (typescript)
03:56:52.862 DEBUG:   * SonarVB 8.4.0.15306 (vbnet)
03:56:52.863 DEBUG:   * SonarSwift 4.2.2.77 (swift)
03:56:52.863 DEBUG:   * SonarCFamily 6.7.0.15300 (cpp)
03:56:52.863 DEBUG:   * SonarPython 2.6.0.5863 (python)
03:56:52.863 DEBUG:   * JaCoCo 1.0.2.475 (jacoco)
03:56:52.863 DEBUG:   * SonarGo 1.6.0.719 (go)
03:56:52.863 DEBUG:   * SonarKotlin 1.5.0.315 (kotlin)
03:56:52.864 DEBUG:   * SonarRPG 2.3.0.1187 (rpg)
03:56:52.864 DEBUG:   * SonarPLI 1.10.0.1880 (pli)
03:56:52.864 DEBUG:   * SonarTSQL 1.4.0.3334 (tsql)
03:56:52.864 DEBUG:   * SonarVB6 2.6.0.1875 (vb)
03:56:52.864 DEBUG:   * SonarApex 1.7.0.883 (sonarapex)
03:56:52.864 DEBUG:   * SonarJS 6.2.0.12043 (javascript)
03:56:52.864 DEBUG:   * SonarRuby 1.5.0.315 (ruby)
03:56:52.864 DEBUG:   * Vulnerability Rules for C# 8.1.0.675 (securitycsharpfrontend)
03:56:52.864 DEBUG:   * Vulnerability Rules for Java 8.1.0.675 (securityjavafrontend)
03:56:52.865 DEBUG:   * License for SonarLint 8.1.0.31237 (license)
03:56:52.865 DEBUG:   * SonarCOBOL 4.4.0.3403 (cobol)
03:56:52.865 DEBUG:   * Vulnerability Rules for Python 8.1.0.675 (securitypythonfrontend)
03:56:52.865 DEBUG:   * Git 1.9.1.1834 (scmgit)
03:56:52.865 DEBUG:   * SonarPHP 3.3.0.5166 (php)
03:56:52.865 DEBUG:   * SonarABAP 3.8.0.2034 (abap)
03:56:52.865 DEBUG:   * Vulnerability Rules for PHP 8.1.0.675 (securityphpfrontend)
03:56:52.913 INFO: Loaded core extensions: developer-scanner
03:56:52.932 DEBUG: Installed core extension: developer-scanner
03:56:53.582 INFO: Process project properties
03:56:53.590 INFO: Process project properties (done) | time=8ms
03:56:53.591 INFO: Execute project builders
03:56:53.591 DEBUG: Execute project builder: org.sonar.plugins.csharp.CSharpGlobalProtobufFileProcessor
03:56:53.593 DEBUG: Execute project builder: org.sonar.plugins.vbnet.VbNetGlobalProtobufFileProcessor
03:56:53.595 INFO: Execute project builders (done) | time=4ms
03:56:53.598 INFO: Project key: project-api
03:56:53.598 INFO: Base dir: /sandbox/ftcbuild/project-build/project-api/rpmbuild/BUILD
03:56:53.598 INFO: Working dir: /sandbox/ftcbuild/project-build/project-api/rpmbuild/BUILD/.scannerwork
03:56:53.598 DEBUG: Project global encoding: UTF-8, default locale: en_US
03:56:53.610 DEBUG: Creating module hierarchy
03:56:53.610 DEBUG:   Init module 'project-api'
03:56:53.611 DEBUG:     Base dir: /sandbox/ftcbuild/project-build/project-api/rpmbuild/BUILD
03:56:53.611 DEBUG:     Working dir: /sandbox/ftcbuild/project-build/project-api/rpmbuild/BUILD/.scannerwork
03:56:53.612 DEBUG:     Module global encoding: UTF-8, default locale: en_US
03:56:53.692 INFO: Load project settings for component key: 'project-api'
03:56:53.738 DEBUG: GET 200 http://server-url:9000/api/settings/values.protobuf?component=project-api | time=46ms
03:56:53.740 INFO: Load project settings for component key: 'project-api' (done) | time=48ms
03:56:53.817 INFO: Load project branches
03:56:53.853 DEBUG: GET 200 http://server-url:9000/api/project_branches/list?project=project-api | time=36ms
03:56:53.862 INFO: Load project branches (done) | time=45ms
03:56:53.863 INFO: Load project pull requests
03:56:53.877 DEBUG: GET 200 http://server-url:9000/api/project_pull_requests/list?project=project-api | time=14ms
03:56:53.882 INFO: Load project pull requests (done) | time=19ms
03:56:53.882 INFO: Load branch configuration
03:56:53.883 INFO: Load branch configuration (done) | time=1ms
03:56:53.921 DEBUG: Available languages:
03:56:53.921 DEBUG:   * CSS => "css"
03:56:53.922 DEBUG:   * PL/SQL => "plsql"
03:56:53.922 DEBUG:   * Scala => "scala"
03:56:53.922 DEBUG:   * C# => "cs"
03:56:53.922 DEBUG:   * Java => "java"
03:56:53.922 DEBUG:   * HTML => "web"
03:56:53.922 DEBUG:   * JSP => "jsp"
03:56:53.922 DEBUG:   * Flex => "flex"
03:56:53.922 DEBUG:   * XML => "xml"
03:56:53.922 DEBUG:   * VB.NET => "vbnet"
03:56:53.922 DEBUG:   * Swift => "swift"
03:56:53.922 DEBUG:   * C => "c"
03:56:53.922 DEBUG:   * C++ => "cpp"
03:56:53.923 DEBUG:   * Objective-C => "objc"
03:56:53.923 DEBUG:   * Python => "py"
03:56:53.923 DEBUG:   * Go => "go"
03:56:53.923 DEBUG:   * Kotlin => "kotlin"
03:56:53.923 DEBUG:   * RPG => "rpg"
03:56:53.923 DEBUG:   * PL/I => "pli"
03:56:53.923 DEBUG:   * T-SQL => "tsql"
03:56:53.923 DEBUG:   * Vb => "vb"
03:56:53.923 DEBUG:   * Apex => "apex"
03:56:53.923 DEBUG:   * JavaScript => "js"
03:56:53.923 DEBUG:   * TypeScript => "ts"
03:56:53.923 DEBUG:   * Ruby => "ruby"
03:56:53.923 DEBUG:   * COBOL => "cobol"
03:56:53.924 DEBUG:   * PHP => "php"
03:56:53.924 DEBUG:   * ABAP => "abap"
03:56:53.928 INFO: Load quality profiles
03:56:54.012 DEBUG: GET 200 http://server-url:9000/api/qualityprofiles/search.protobuf?project=project-api | time=83ms
03:56:54.034 INFO: Load quality profiles (done) | time=106ms
03:56:54.044 INFO: Load active rules
.0.1.0/common/api_stat.h' is excluded by the scm ignore settings.
03:56:55.129 INFO: 0 files indexed
03:56:55.129 INFO: 0 files ignored because of scm ignore settings
03:56:55.130 INFO: ------------- Run sensors on module project-api
03:56:55.285 INFO: Load metrics repository
03:56:55.304 DEBUG: GET 200 http://server-url:9000/api/metrics/search?f=name,description,direction,qualitative,custom&ps=500&p=1 | time=19ms
03:56:55.317 INFO: Load metrics repository (done) | time=33ms
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1 (file:/h/ftcbuild/.sonar/cache/a89f1943fc75b65becd9fb4ecab8d913/sonar-tsql-plugin.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of net.sf.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
03:56:58.045 DEBUG: 'JavaSquidSensor' skipped because there is no related file in current project
03:56:58.045 DEBUG: 'CobolSquidSensor' skipped because there is no related file in current project
03:56:58.046 DEBUG: 'Import external issues report' skipped because one of the required properties is missing
03:56:58.046 DEBUG: 'SonarCSS Metrics' skipped because there is no related file in current project
03:56:58.046 DEBUG: 'Import of stylelint issues' skipped because there is no related file in current project
03:56:58.046 DEBUG: 'PL/SQL Sensor' skipped because there is no related file in current project
03:56:58.047 DEBUG: 'Scala Sensor' skipped because there is no related file in current project
03:56:58.047 DEBUG: 'Scoverage sensor for Scala coverage' skipped because one of the required properties is missing
03:56:58.047 DEBUG: 'Import of Scalastyle issues' skipped because there is no related file in current project
03:56:58.051 DEBUG: 'Import of Scapegoat issues' skipped because there is no related file in current project
03:56:58.051 DEBUG: 'C# Properties' skipped because there is no related file in current project
03:56:58.052 DEBUG: 'Import of Checkstyle issues' skipped because there is no related file in current project
03:56:58.053 DEBUG: 'Import of PMD issues' skipped because one of the required properties is missing
03:56:58.053 DEBUG: 'Import of SpotBugs issues' skipped because there is no related file in current project
03:56:58.053 DEBUG: 'SurefireSensor' skipped because there is no related file in current project
03:56:58.054 DEBUG: 'Removed properties sensor' skipped because there is no related file in current project
03:56:58.054 DEBUG: 'HTML' skipped because there is no related file in current project
03:56:58.055 DEBUG: 'Flex' skipped because there is no related file in current project
03:56:58.055 DEBUG: 'Flex Cobertura' skipped because there is no related file in current project
03:56:58.055 DEBUG: 'XML Sensor' skipped because there is no related file in current project
03:56:58.055 DEBUG: 'SonarTS' skipped because there is no related file in current project
03:56:58.055 DEBUG: 'VB.NET Properties' skipped because there is no related file in current project
03:56:58.056 DEBUG: 'SonarSwift' skipped because there is no related file in current project
03:56:58.057 DEBUG: 'Import of SwiftLint issues' skipped because there is no related file in current project
03:56:58.057 DEBUG: 'gcov' skipped because there is no related file in current project
03:56:58.057 DEBUG: 'llvm-cov' skipped because there is no related file in current project
03:56:58.058 DEBUG: 'cppunit' skipped because there is no related file in current project
03:56:58.058 DEBUG: 'VisualStudioCoverage' skipped because there is no related file in current project
03:56:58.059 DEBUG: 'bullseye' skipped because there is no related file in current project
03:56:58.059 DEBUG: 'Python Sensor' skipped because there is no related file in current project
03:56:58.059 DEBUG: 'Cobertura Sensor for Python coverage' skipped because there is no related file in current project
03:56:58.059 DEBUG: 'PythonXUnitSensor' skipped because there is no related file in current project
03:56:58.059 DEBUG: 'PylintSensor' skipped because there is no related file in current project
03:56:58.060 DEBUG: 'PylintImportSensor' skipped because there is no related file in current project
03:56:58.060 DEBUG: 'Import of Bandit issues' skipped because there is no related file in current project
03:56:58.060 DEBUG: 'SonarGo' skipped because there is no related file in current project
03:56:58.061 DEBUG: 'Go Unit Test Report' skipped because there is no related file in current project
03:56:58.061 DEBUG: 'Go Cover sensor for Go coverage' skipped because one of the required properties is missing
03:56:58.062 DEBUG: 'Import of go vet issues' skipped because there is no related file in current project
03:56:58.062 DEBUG: 'Import of Golint issues' skipped because there is no related file in current project
03:56:58.062 DEBUG: 'Import of GoMetaLinter issues' skipped because there is no related file in current project
03:56:58.062 DEBUG: 'Import of GolangCI-Lint issues' skipped because there is no related file in current project
03:56:58.062 DEBUG: 'Kotlin Sensor' skipped because there is no related file in current project
03:56:58.063 DEBUG: 'Import of detekt issues' skipped because there is no related file in current project
03:56:58.063 DEBUG: 'Import of Android Lint issues' skipped because one of the required properties is missing
03:56:58.064 DEBUG: 'RPG sensor' skipped because there is no related file in current project
03:56:58.064 DEBUG: 'PliSquidSensor' skipped because there is no related file in current project
03:56:58.064 DEBUG: 'T-SQL Sensor' skipped because there is no related file in current project
03:56:58.064 DEBUG: 'VbSquidSensor' skipped because there is no related file in current project
03:56:58.064 DEBUG: 'Apex Sensor' skipped because there is no related file in current project
03:56:58.064 DEBUG: 'Test coverage Sensor for Apex' skipped because there is no related file in current project
03:56:58.065 DEBUG: 'Import of PMD issues' skipped because one of the required properties is missing
03:56:58.065 DEBUG: 'JavaScript analysis' skipped because there is no related file in current project
03:56:58.065 DEBUG: 'SonarJS Coverage' skipped because there is no related file in current project
03:56:58.066 DEBUG: 'Import of ESLint issues' skipped because one of the required properties is missing
03:56:58.066 DEBUG: 'TypeScript analysis' skipped because there is no related file in current project
03:56:58.066 DEBUG: 'Import of TSLint issues' skipped because one of the required properties is missing
03:56:58.066 DEBUG: 'Ruby Sensor' skipped because there is no related file in current project
03:56:58.067 DEBUG: 'Import of RuboCop issues' skipped because one of the required properties is missing
03:56:58.067 DEBUG: 'SimpleCov Sensor for Ruby coverage' skipped because there is no related file in current project
03:56:58.067 DEBUG: 'PHP sensor' skipped because there is no related file in current project
03:56:58.068 DEBUG: 'Analyzer for "php.ini" files' skipped because there is no related file in current project
03:56:58.068 DEBUG: 'AbapSquidSensor' skipped because there is no related file in current project
03:56:58.074 DEBUG: 'Generic Test Executions Report' skipped because one of the required properties is missing
03:56:58.074 DEBUG: 'C#' skipped because there is no related file in current project
03:56:58.074 DEBUG: 'C# Tests Coverage Report Import' skipped because there is no related file in current project
03:56:58.074 DEBUG: '[Deprecated] C# Integration Tests Coverage Report Import' skipped because there is no related file in current project
03:56:58.074 DEBUG: 'C# Unit Test Results Import' skipped because there is no related file in current project
03:56:58.075 DEBUG: 'VB.NET' skipped because there is no related file in current project
03:56:58.075 DEBUG: 'VB.NET Tests Coverage Report Import' skipped because there is no related file in current project
03:56:58.075 DEBUG: '[Deprecated] VB.NET Integration Tests Coverage Report Import' skipped because there is no related file in current project
03:56:58.075 DEBUG: 'VB.NET Unit Test Results Import' skipped because there is no related file in current project
03:56:58.075 DEBUG: 'CFamily' skipped because there is no related file in current project
03:56:58.076 DEBUG: Sensors : SonarCSS Rules -> JavaXmlSensor -> JaCoCo XML Report Importer -> JavaSecuritySensor -> CSharpSecuritySensor -> PhpSecuritySensor -> PythonSecuritySensor
03:56:58.076 INFO: Sensor SonarCSS Rules [cssfamily]
03:56:58.077 INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
03:56:58.077 INFO: Sensor SonarCSS Rules [cssfamily] (done) | time=1ms
03:56:58.077 INFO: Sensor JavaXmlSensor [java]
03:56:58.078 INFO: Sensor JavaXmlSensor [java] (done) | time=1ms
03:56:58.078 INFO: Sensor JaCoCo XML Report Importer [jacoco]
03:56:58.080 DEBUG: No reports found
03:56:58.080 INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=2ms
03:56:58.080 INFO: Sensor JavaSecuritySensor [security]
03:56:58.081 INFO: Reading type hierarchy from: /sandbox/ftcbuild/project-build/project-api/rpmbuild/BUILD/.scannerwork/ucfg2/java
03:56:58.081 INFO: Read 0 type definitions
03:56:58.083 INFO: Reading UCFGs from: /sandbox/ftcbuild/project-build/project-api/rpmbuild/BUILD/.scannerwork/ucfg2/java
03:56:58.084 INFO: No UCFGs have been included for analysis.
03:56:58.084 INFO: Sensor JavaSecuritySensor [security] (done) | time=4ms
03:56:58.084 INFO: Sensor CSharpSecuritySensor [security]
03:56:58.084 INFO: Reading type hierarchy from: /sandbox/ftcbuild/project-build/project-api/rpmbuild/BUILD/ucfg_cs2
03:56:58.084 INFO: Read 0 type definitions
03:56:58.085 INFO: Reading UCFGs from: /sandbox/ftcbuild/project-build/project-api/rpmbuild/BUILD/ucfg_cs2
03:56:58.085 INFO: No UCFGs have been included for analysis.
03:56:58.085 INFO: Sensor CSharpSecuritySensor [security] (done) | time=1ms
03:56:58.085 INFO: Sensor PhpSecuritySensor [security]
03:56:58.085 INFO: Reading type hierarchy from: /sandbox/ftcbuild/project-build/project-api/rpmbuild/BUILD/.scannerwork/ucfg2/php
03:56:58.085 INFO: Read 0 type definitions
03:56:58.085 INFO: Reading UCFGs from: /sandbox/ftcbuild/project-build/project-api/rpmbuild/BUILD/.scannerwork/ucfg2/php
03:56:58.085 INFO: No UCFGs have been included for analysis.
03:56:58.085 INFO: Sensor PhpSecuritySensor [security] (done) | time=0ms
03:56:58.085 INFO: Sensor PythonSecuritySensor [security]
03:56:58.085 INFO: Reading type hierarchy from: /sandbox/ftcbuild/project-build/project-api/rpmbuild/BUILD/.scannerwork/ucfg2/python
03:56:58.085 INFO: Read 0 type definitions
03:56:58.086 INFO: Reading UCFGs from: /sandbox/ftcbuild/project-build/project-api/rpmbuild/BUILD/.scannerwork/ucfg2/python
03:56:58.086 INFO: No UCFGs have been included for analysis.
03:56:58.086 INFO: Sensor PythonSecuritySensor [security] (done) | time=1ms
03:56:58.089 INFO: ------------- Run sensors on project
03:56:58.093 DEBUG: 'Generic Coverage Report' skipped because one of the required properties is missing
03:56:58.093 DEBUG: 'Java CPD Block Indexer' skipped because there is no related file in current project
03:56:58.093 DEBUG: Sensors : Zero Coverage Sensor
03:56:58.093 INFO: Sensor Zero Coverage Sensor
03:56:58.093 INFO: Sensor Zero Coverage Sensor (done) | time=0ms
03:56:58.096 INFO: CPD Executor Calculating CPD for 0 files
03:56:58.097 INFO: CPD Executor CPD calculation finished (done) | time=0ms
03:56:58.199 INFO: Analysis report generated in 101ms, dir size=54 KB
03:56:58.214 INFO: Analysis report compressed in 15ms, zip size=8 KB
03:56:58.214 INFO: Analysis report generated in /sandbox/ftcbuild/project-build/project-api/rpmbuild/BUILD/.scannerwork/scanner-report
03:56:58.214 DEBUG: Upload report
03:56:58.263 DEBUG: POST 200 http://server-url:9000/api/ce/submit?projectKey=project-api | time=48ms
03:56:58.265 INFO: Analysis report uploaded in 51ms
03:56:58.268 DEBUG: Report metadata written to /sandbox/ftcbuild/project-build/project-api/rpmbuild/BUILD/.scannerwork/report-task.txt
03:56:58.268 INFO: ANALYSIS SUCCESSFUL, you can browse http://server-url:9000/dashboard?id=project-api
03:56:58.268 INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
03:56:58.268 INFO: More about the report processing at http://server-url:9000/api/ce/task?id=AYADAAIWHP6kExaUhqA9
03:56:58.272 DEBUG: Post-jobs :
03:56:58.277 INFO: Analysis total time: 5.363 s
03:56:58.283 INFO: ------------------------------------------------------------------------
03:56:58.283 INFO: EXECUTION SUCCESS
03:56:58.283 INFO: ------------------------------------------------------------------------
03:56:58.283 INFO: Total time: 7.229s
03:56:58.345 INFO: Final Memory: 30M/104M
03:56:58.345 INFO: ------------------------------------------------------------------------

Hi,

Welcome to the community!

Your version is past EOL. You should upgrade to either the latest version or the current LTS at your earliest convenience. Your upgrade path is:

8.1 → 8.9.8 → 9.4 (last step optional)

You may find the Upgrade Guide and the LTS-to-LTS Upgrade Notes helpful. If you have questions about upgrading, feel free to open a new thread for that here.

If your error persists after upgrade, please come back to us, and also let us know what language(s) you’re trying to analyze.

Hi Colin

Do you have step by step up gradation document for centos7.7?

Hi Colin

In the same version, some of the projects are working fine but most of the projects are failing with same issue.
I am analyzing *.c and *.h codes.