sonar-gitlab-plugin icon indicating copy to clipboard operation
sonar-gitlab-plugin copied to clipboard

SonarQube failed to complete the review of this commit: Failed to get component file for X

Open alixwar opened this issue 6 years ago • 23 comments

Setup: SonarQube 6.7 Sonar Gitlab plugin 2.1.0

Build step

    - git checkout -f origin/develop
    - git merge $CI_COMMIT_SHA --no-commit --no-ff
    - ./gradlew --no-daemon sonarqube -Dsonar.branch.name=$CI_COMMIT_REF_NAME -Dsonar.gitlab.url=$GITLAB_HOST_URL -Dsonar.gitlab.failure_notification_mode=exit-code -Dsonar.gitlab.user_token=$GITLAB_USER_TOKEN -Dsonar.gitlab.api_version=v4 -Dsonar.gitlab.only_issue_from_commit_line=true -Dsonar.host.url=$SONARQUBE_HOST_URL -Dsonar.gitlab.ignore_certificate=true -Dsonar.login=$SONARQUBE_USER_TOKEN -Dsonar.gitlab.project_id=$CI_PROJECT_ID -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME

In some cases (when new files are added in a branch) the build fails (exception thrown in: src/main/java/com/talanlabs/sonar/plugins/gitlab/SonarFacade.java )

Missing blame information for the following files:

  • app/src/main/java/com/example/android/app/services/ServiceAccessRequestReceiver.java This may lead to missing/broken features in SonarQube Bugs: 1 > 0 Code Smells: 22 > 0 :sonarqube FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':sonarqube'.

SonarQube failed to complete the review of this commit: Failed to get component file for com.example.android:accessmanager-parent:app:src/main/java/com/example/android/app/services/ServiceAccessRequestReceiver.java

  • Try: Run with 66 actionable tasks: 40 executed, 26 up-to-date --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 1m 34s ERROR: Job failed: exit code 1

alixwar avatar Apr 18 '18 14:04 alixwar

You should check your debug information (.gradlew sonarqube --debug). maybe you see what files are missing / can not be read.

sesigl avatar Apr 19 '18 12:04 sesigl

Hi, It's a bug with 3.0.0 version Are you sur use Sonar Gitlab plugin 2.1.0 ?

gabrie-allaigre avatar Apr 20 '18 07:04 gabrie-allaigre

Hi, I can confirm that the bug was found in 2.1.0. Now I've updated my installation to 3.0.0, so I can't provide more information about that setup unfortunately

alixwar avatar Apr 23 '18 06:04 alixwar

Hey @gabrie-allaigre, do you know why we can't download 3.0.1 from the marketplace? Running Sonar in version 7.1

Thanks in advance

encodeering avatar May 07 '18 09:05 encodeering

Used version 3.0.1 and build succeeds now. Nice

encodeering avatar May 07 '18 14:05 encodeering

marketplace please :1st_place_medal:

dungdm93 avatar May 31 '18 10:05 dungdm93

I think I meant to make this comment on #146 not here. My apologies.


I have been trying to work out why SonarQube was not seeing one of my new .cpp files for a week and just found this buy report. Is version 3.0.1 of the sonar-gitlab-plugin now pushed to the marketplace? Can anyone confirm that it resolves the problem?

My error reports are:

09:13:19.194 ERROR: Error during SonarQube Scanner execution
09:13:19.194 ERROR: SonarQube failed to complete the review of this commit: Failed to get component file for <project>:<Module>:Application/<Module>Main.cpp
09:13:19.194 ERROR: Caused by: Failed to get component file for <project>:<Module>:Application/<Module>Main.cpp
09:13:19.194 ERROR: Caused by: org.sonarqube.ws.client.HttpException: Error 404 on https://<internal--url>/api/components/show?key=<project>:<Module>:Application/<Module>Main.cpp
09:13:19.194 ERROR: Caused by: Error 404 on https://<internal-url>/api/components/show?key=<project>:<Module>:Application/<Module>Main.cpp

Project, Module and server names altered to protect the innocent, or however the cops disclaimers goes.

TafThorne avatar Jul 09 '18 09:07 TafThorne

Confirmed working with 3.0.1

gentunian avatar Aug 14 '18 20:08 gentunian

Hi, Yes is fixed with 3.0.1. I'm created a new version 3.1.0 for marketplace, work with sonarqube > 7.0

gabrie-allaigre avatar Aug 26 '18 21:08 gabrie-allaigre

@gabrie-allaigre Great that you've fixed it but note that SonarQube 6.7.x is the LTS version so many of us will not be able to get this fix in a long time

alixwar avatar Aug 28 '18 15:08 alixwar

I will try to publish version 3.0.1 in marketplace

gabrie-allaigre avatar Aug 29 '18 07:08 gabrie-allaigre

Hey,

I ran into the same problem. We use Sonar and Gitlab for the analysis of C/Cpp code. I use the plugin 3.0.1 by @gabrie-allaigre.

Versions

sonar-scanner-3.2.0.1227-linux Sonar-Qube: Developer EditionVersion 7.2.1 Jenkins ver. 2.132 Jenkins Gitlab Plugin: 1.5.8

Sonar execution failed:

sonarGitlabBranch=develop
sonarGitlabRefName=develop

sonar-scanner --debug \
    -Dsonar.branch.name="$sonarGitlabBranch" \
    -Dsonar.gitlab.ref_name="$sonarGitlabRefName" \
    -Dsonar.gitlab.commit_sha="<sha>" \
    -Dsonar.gitlab.project_id="<project-id>" \
    -Dsonar.analysis.mode=preview

Output


11:06:56.332 INFO: ------------------------------------------------------------------------
11:06:56.332 INFO: EXECUTION FAILURE
11:06:56.332 INFO: ------------------------------------------------------------------------
11:06:56.332 INFO: Total time: 22.050s
11:06:56.413 INFO: Final Memory: 38M/1041M
11:06:56.413 INFO: ------------------------------------------------------------------------
11:06:56.413 ERROR: Error during SonarQube Scanner execution
org.sonarqube.ws.client.HttpException: Error 404 on http://sonar.server:9000/api/sources/hash?key=de.xxxx.convert%3Asrc%2FValueFormatter.cpp : {"errors":[{"msg":"Component key 'de.xxxx.convert:src/ValueFormatter.cpp' not found"}]}
	at org.sonarqube.ws.client.BaseResponse.failIfNotSuccessful(BaseResponse.java:36)
	at org.sonar.scanner.bootstrap.ScannerWsClient.failIfUnauthorized(ScannerWsClient.java:106)
	at org.sonar.scanner.bootstrap.ScannerWsClient.call(ScannerWsClient.java:75)
	at org.sonar.scanner.issue.tracking.DefaultServerLineHashesLoader.loadHashesFromWs(DefaultServerLineHashesLoader.java:52)
	at org.sonar.scanner.issue.tracking.DefaultServerLineHashesLoader.getLineHashes(DefaultServerLineHashesLoader.java:42)
	at org.sonar.scanner.issue.tracking.SourceHashHolder.initHashes(SourceHashHolder.java:56)
	at org.sonar.scanner.issue.tracking.SourceHashHolder.getHashedSource(SourceHashHolder.java:69)
	at org.sonar.scanner.issue.IssueTransformer.toTrackedIssue(IssueTransformer.java:92)
	at org.sonar.scanner.issue.IssueTransformer.toTrackedIssue(IssueTransformer.java:80)
	at org.sonar.scanner.issue.tracking.LocalIssueTracking.trackIssues(LocalIssueTracking.java:91)
	at org.sonar.scanner.issue.tracking.IssueTransition.trackIssues(IssueTransition.java:103)
	at org.sonar.scanner.issue.tracking.IssueTransition.execute(IssueTransition.java:81)
	at org.sonar.scanner.phases.IssuesPhaseExecutor.localIssueTracking(IssuesPhaseExecutor.java:64)
	at org.sonar.scanner.phases.IssuesPhaseExecutor.executeOnRoot(IssuesPhaseExecutor.java:56)
	at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:93)
	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:182)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
	at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:312)
	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:307)
	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:281)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
	at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:48)
	at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:81)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
	at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:132)
	at org.sonar.batch.bootstrapper.Batch.doExecuteTask(Batch.java:116)
	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:71)
	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
	at com.sun.proxy.$Proxy0.execute(Unknown Source)
	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:171)
	at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:128)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:111)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
	at org.sonarsource.scanner.cli.Main.main(Main.java:61)
ERROR: Preview analysing of './sonar-project.properties' failed.

Sonar execution successful:

sonarGitlabBranch=<sha>   // <--- Modified 
sonarGitlabRefName=develop

sonar-scanner --debug \
    -Dsonar.branch.name="$sonarGitlabBranch" \
    -Dsonar.gitlab.ref_name="$sonarGitlabRefName" \
    -Dsonar.gitlab.commit_sha="<sha>" \
    -Dsonar.gitlab.project_id="<project-id>" \
    -Dsonar.analysis.mode=preview

CSV-Tom avatar Sep 05 '18 09:09 CSV-Tom

@CSV-Tom Hi, Have you full log please ? It's not same problems, because use preview mode then alixwar use analyse mode

gabrie-allaigre avatar Sep 05 '18 09:09 gabrie-allaigre

Of course.

11:53:23.271 INFO: Scanner configuration file: /opt/sonar-runner/sonar-scanner-3.2.0.1227-linux/conf/sonar-scanner.properties
11:53:23.274 INFO: Project root configuration file: /home/yyy/jenkins-jobs/workspace/DSL-zzzz-Unittest-xxxx-convert-lib/components/xxxx-convert-lib/lib/sonar-project.properties
11:53:23.287 INFO: SonarQube Scanner 3.2.0.1227
11:53:23.287 INFO: Java 1.8.0_121 Oracle Corporation (64-bit)
11:53:23.287 INFO: Linux 4.15.0-33-generic amd64
11:53:23.374 DEBUG: keyStore is : 
11:53:23.375 DEBUG: keyStore type is : jks
11:53:23.375 DEBUG: keyStore provider is : 
11:53:23.375 DEBUG: init keystore
11:53:23.375 DEBUG: init keymanager of type SunX509
11:53:23.433 DEBUG: Create: /home/yyy/.sonar/cache
11:53:23.434 INFO: User cache: /home/yyy/.sonar/cache
11:53:23.434 DEBUG: Create: /home/yyy/.sonar/cache/_tmp
11:53:23.435 DEBUG: Extract sonar-scanner-api-batch in temp...
11:53:23.438 DEBUG: Get bootstrap index...
11:53:23.439 DEBUG: Download: http://sonarserver/batch/index
11:53:23.471 DEBUG: Get bootstrap completed
11:53:23.475 DEBUG: Create isolated classloader...
11:53:23.479 DEBUG: Start temp cleaning...
11:53:23.482 DEBUG: Temp cleaning done
11:53:23.483 DEBUG: Execution getVersion
11:53:23.484 INFO: SonarQube server 7.2.1
11:53:23.484 INFO: Default locale: "de_DE", source code encoding: "UTF-8"
11:53:23.485 DEBUG: Work directory: /home/yyy/jenkins-jobs/workspace/DSL-zzzz-Unittest-xxxx-convert-lib/components/xxxx-convert-lib/lib/.scannerwork
11:53:23.486 DEBUG: Execution execute
11:53:23.589 INFO: Issues mode
11:53:23.589 WARN: The use of the issues mode (sonar.analysis.mode=issues) is deprecated. This mode will be dropped in the future.
11:53:23.664 INFO: Load global settings
11:53:24.559 DEBUG: GET 200 http://sonarserver/api/settings/values.protobuf | time=890ms
11:53:24.580 INFO: Load global settings (done) | time=916ms
11:53:24.585 INFO: Server id: 1db68331b1afe9d
11:53:24.593 INFO: User cache: /home/yyy/.sonar/cache
11:53:24.599 INFO: Exclude plugins: devcockpit, ldap, authgithub, authbitbucket, pdfreport, authaad, googleanalytics, governance
11:53:24.747 INFO: Load/download plugins
11:53:24.747 INFO: Load plugins index
11:53:25.560 DEBUG: GET 200 http://sonarserver/api/plugins/installed | time=811ms
11:53:25.588 INFO: Load plugins index (done) | time=841ms
11:53:25.664 INFO: Load/download plugins (done) | time=917ms
11:53:25.767 DEBUG: Plugins:
11:53:25.767 DEBUG:   * SonarCFamily 5.1.0.10083 (cpp)
11:53:25.767 DEBUG:   * SonarPython 1.10.0.2131 (python)
11:53:25.767 DEBUG:   * SonarGo 1.1.0.1612 (go)
11:53:25.767 DEBUG:   * SonarTSQL 1.2.0.2539 (tsql)
11:53:25.767 DEBUG:   * Svn 1.7.0.1017 (scmsvn)
11:53:25.767 DEBUG:   * SonarJS 4.1.0.6085 (javascript)
11:53:25.767 DEBUG:   * GitLab Auth 1.3.2 (authgitlab)
11:53:25.767 DEBUG:   * SonarPLSQL 3.2.0.1753 (plsql)
11:53:25.767 DEBUG:   * License for SonarLint 7.2.1 (license)
11:53:25.767 DEBUG:   * SonarC# 7.2.0.5463 (csharp)
11:53:25.767 DEBUG:   * SonarSecurity 7.2.1.983 (security)
11:53:25.767 DEBUG:   * Groovy 1.5 (groovy)
11:53:25.767 DEBUG:   * SonarJava 5.5.0.14655 (java)
11:53:25.767 DEBUG:   * Git 1.4.1.1128 (scmgit)
11:53:25.768 DEBUG:   * SonarFlex 2.4.0.1222 (flex)
11:53:25.768 DEBUG:   * SonarXML 1.5.1.1452 (xml)
11:53:25.768 DEBUG:   * SonarPHP 2.13.0.3107 (php)
11:53:25.768 DEBUG:   * GitLab 3.0.1 (gitlab)
11:53:25.768 DEBUG:   * SonarTS 1.7.0.2893 (typescript)
11:53:25.768 DEBUG:   * SonarVB 5.1.0.442 (vbnet)
11:53:25.768 DEBUG:   * SonarABAP 3.6.0.1269 (abap)
11:53:25.768 DEBUG:   * SonarSwift 3.3.0.2492 (swift)
11:53:25.785 INFO: Loaded core extensions: branch-scanner
11:53:25.965 INFO: Installed core extension: branch-scanner
11:53:26.060 INFO: Installed core extension: branch-scanner
11:53:26.062 INFO: Process project properties
11:53:26.067 DEBUG: Process project properties (done) | time=5ms
11:53:26.071 INFO: Load project branches
11:53:26.803 DEBUG: GET 200 http://sonarserver/api/project_branches/list?project=de.x.convert | time=732ms
11:53:26.813 INFO: Load project branches (done) | time=742ms
11:53:26.813 INFO: Load project pull requests
11:53:27.203 DEBUG: GET 200 http://sonarserver/api/project_pull_requests/list?project=de.x.convert | time=390ms
11:53:27.208 INFO: Load project pull requests (done) | time=395ms
11:53:27.208 INFO: Load branch configuration
11:53:27.209 DEBUG: Not on a Bitbucket pipeline.
11:53:27.212 INFO: Load branch configuration (done) | time=4ms
11:53:27.212 INFO: Load project repositories
11:53:27.610 DEBUG: GET 200 http://sonarserver/batch/project.protobuf?key=de.x.convert&issues_mode=true&branch=develop | time=398ms
11:53:27.665 INFO: Load project repositories (done) | time=453ms
11:53:27.696 INFO: Scanning only changed files
11:53:27.697 INFO: Execute project builders
11:53:32.826 DEBUG: getPatchPositionsToLineMapping {92a692895ea13c2210e5387c1a9230d3b52feabf={lib/testsrc/utest/Test/ValueFormatterTest.cpp=[Line{number=-1, content='++ b/lib/testsrc/utest/Test/ValueFormatterTest.cpp'}, Line{number=68, content='    STRCMP_EQUAL("µS/cm", XXX::Convert::ValueFormatter::unitString(XXX::Messages::EValueQualifier::TENTH_MICROSIEMENS_PER_CM).c_str());'}], lib/src/ValueFormatter.cpp=[Line{number=235, content='        case XXX::Messages::EValueQualifier::TENTH_MICROSIEMENS_PER_CM:'}, Line{number=272, content='    case XXX::Messages::EValueQualifier::TENTH_MICROSIEMENS_PER_CM:'}, Line{number=-1, content='++ b/lib/src/ValueFormatter.cpp'}, Line{number=233, content='    case XXX::Messages::EValueQualifier::TENTH_MICROSIEMENS_PER_CM:'}, Line{number=137, content='    case XXX::Messages::EValueQualifier::TENTH_MICROSIEMENS_PER_CM:'}, Line{number=185, content='        auto convertedValue = convertValue(value, sourceUnit, XXX::Messages::EValueQualifier::TENTH_MICROSIEMENS_PER_CM);'}, Line{number=139, content='        valueWithUnit += " " + unitString(XXX::Messages::EValueQualifier::TENTH_MICROSIEMENS_PER_CM);'}, Line{number=86, content='    case XXX::Messages::EValueQualifier::TENTH_MICROSIEMENS_PER_CM:'}, Line{number=273, content='        return convertValue(value, sourceUnit, XXX::Messages::EValueQualifier::TENTH_MICROSIEMENS_PER_CM);'}]}}
11:53:32.925 DEBUG: Transition status is already pending
11:53:32.926 INFO: Execute project builders (done) | time=5229ms
11:53:33.065 DEBUG: Available languages:
11:53:33.066 DEBUG:   * C => "c"
11:53:33.066 DEBUG:   * C++ => "cpp"
11:53:33.066 DEBUG:   * Objective-C => "objc"
11:53:33.066 DEBUG:   * Python => "py"
11:53:33.066 DEBUG:   * Go => "go"
11:53:33.066 DEBUG:   * T-SQL => "tsql"
11:53:33.066 DEBUG:   * JavaScript => "js"
11:53:33.066 DEBUG:   * PL/SQL => "plsql"
11:53:33.066 DEBUG:   * C# => "cs"
11:53:33.066 DEBUG:   * Groovy => "grvy"
11:53:33.066 DEBUG:   * Java => "java"
11:53:33.066 DEBUG:   * Flex => "flex"
11:53:33.067 DEBUG:   * XML => "xml"
11:53:33.067 DEBUG:   * PHP => "php"
11:53:33.067 DEBUG:   * TypeScript => "ts"
11:53:33.067 DEBUG:   * Visual Basic .NET => "vbnet"
11:53:33.067 DEBUG:   * ABAP => "abap"
11:53:33.067 DEBUG:   * Swift => "swift"
11:53:33.073 INFO: Load quality profiles
11:53:33.824 DEBUG: GET 200 http://sonarserver/api/qualityprofiles/search.protobuf?projectKey=de.x.convert | time=750ms
11:53:33.834 INFO: Load quality profiles (done) | time=761ms
11:53:33.843 INFO: Load active rules
11:53:34.250 DEBUG: GET 200 http://sonarserver/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=cpp-sonar-way-19511&p=1&ps=500 | time=406ms
11:53:34.708 DEBUG: GET 200 http://sonarserver/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=c-sonar-way-92420&p=1&ps=500 | time=420ms
11:53:35.116 DEBUG: GET 200 http://sonarserver/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=AWSnYTvhKwmvbA--NWxW&p=1&ps=500 | time=397ms
11:53:35.540 DEBUG: GET 200 http://sonarserver/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=AWSi7sikNPksyvYu9__8&p=1&ps=500 | time=419ms
11:53:35.947 DEBUG: GET 200 http://sonarserver/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=py-sonar-way-44034&p=1&ps=500 | time=399ms
11:53:36.355 DEBUG: GET 200 http://sonarserver/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=AWB-Y9y1_UEV9DrhBwrp&p=1&ps=500 | time=401ms
11:53:36.784 DEBUG: GET 200 http://sonarserver/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=AWB-Y9-H_UEV9DrhBwxl&p=1&ps=500 | time=422ms
11:53:37.213 DEBUG: GET 200 http://sonarserver/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=cs-c-_x-way-83279&p=1&ps=500 | time=419ms
11:53:37.665 DEBUG: GET 200 http://sonarserver/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=java-sonar-way-81682&p=1&ps=500 | time=444ms
11:53:38.084 DEBUG: GET 200 http://sonarserver/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=AWSi7s7tNPksyvYu-ACG&p=1&ps=500 | time=404ms
11:53:38.475 DEBUG: GET 200 http://sonarserver/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=AWSi7s6gNPksyvYu-ABH&p=1&ps=500 | time=386ms
11:53:38.887 DEBUG: GET 200 http://sonarserver/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=php-sonar-way-47570&p=1&ps=500 | time=411ms
11:53:39.520 DEBUG: GET 200 http://sonarserver/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=AWB-Y9u-_UEV9DrhBwqY&p=1&ps=500 | time=629ms
11:53:40.241 DEBUG: GET 200 http://sonarserver/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=AWB-Y924_UEV9DrhBwtP&p=1&ps=500 | time=715ms
11:53:40.674 DEBUG: GET 200 http://sonarserver/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=AWSndrh61LkUkxuCC-tr&p=1&ps=500 | time=429ms
11:53:41.131 DEBUG: GET 200 http://sonarserver/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=objc-sonar-way-73798&p=1&ps=500 | time=452ms
11:53:41.551 DEBUG: GET 200 http://sonarserver/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=AWB-Y96A_UEV9DrhBwu_&p=1&ps=500 | time=415ms
11:53:41.959 DEBUG: GET 200 http://sonarserver/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=AWSi7tDcNPksyvYu-ADq&p=1&ps=500 | time=404ms
11:53:41.976 INFO: Load active rules (done) | time=8133ms
11:53:41.978 INFO: Load metrics repository
11:53:42.375 DEBUG: GET 200 http://sonarserver/api/metrics/search?f=name,description,direction,qualitative,custom&ps=500&p=1 | time=397ms
11:53:42.385 INFO: Load metrics repository (done) | time=406ms
11:53:42.394 INFO: Project key: de.x.convert
11:53:42.394 INFO: Project base dir: /home/yyy/jenkins-jobs/workspace/DSL-zzzz-Unittest-xxxx-convert-lib/components/xxxx-convert-lib/lib
11:53:42.395 INFO: Branch name: develop, type: long living
11:53:42.395 DEBUG: Start recursive analysis of project modules
11:53:42.396 INFO: -------------  Scan C/C++ :: X - Unit Conversion (libx-convert)
11:53:42.489 INFO: Installed core extension: branch-scanner
11:53:42.492 INFO: Load server rules
11:53:42.967 DEBUG: GET 200 http://sonarserver/api/rules/list.protobuf | time=475ms
11:53:42.986 INFO: Load server rules (done) | time=495ms
11:53:43.021 INFO: Base dir: /home/yyy/jenkins-jobs/workspace/DSL-zzzz-Unittest-xxxx-convert-lib/components/xxxx-convert-lib/lib
11:53:43.021 INFO: Working dir: /home/yyy/jenkins-jobs/workspace/DSL-zzzz-Unittest-xxxx-convert-lib/components/xxxx-convert-lib/lib/.scannerwork
11:53:43.022 INFO: Source paths: include, src
11:53:43.022 INFO: Source encoding: UTF-8, default locale: de_DE
11:53:43.123 DEBUG: Declared extensions of language C were converted to sonar.lang.patterns.c : **/*.c,**/*.h
11:53:43.123 DEBUG: Declared extensions of language C++ were converted to sonar.lang.patterns.cpp : **/*.cc,**/*.cpp,**/*.cxx,**/*.c++,**/*.hh,**/*.hpp,**/*.hxx,**/*.h++,**/*.ipp
11:53:43.123 DEBUG: Declared extensions of language Objective-C were converted to sonar.lang.patterns.objc : **/*.m
11:53:43.123 DEBUG: Declared extensions of language Python were converted to sonar.lang.patterns.py : **/*.py
11:53:43.123 DEBUG: Declared extensions of language Go were converted to sonar.lang.patterns.go : **/*.go
11:53:43.123 DEBUG: Declared extensions of language T-SQL were converted to sonar.lang.patterns.tsql : **/*.tsql
11:53:43.123 DEBUG: Declared extensions of language JavaScript were converted to sonar.lang.patterns.js : **/*.js,**/*.jsx,**/*.vue
11:53:43.124 DEBUG: Declared extensions of language PL/SQL were converted to sonar.lang.patterns.plsql : **/*.sql,**/*.pks,**/*.pkb
11:53:43.124 DEBUG: Declared extensions of language C# were converted to sonar.lang.patterns.cs : **/*.cs
11:53:43.124 DEBUG: Declared extensions of language Groovy were converted to sonar.lang.patterns.grvy : **/*.groovy
11:53:43.124 DEBUG: Declared extensions of language Java were converted to sonar.lang.patterns.java : **/*.java,**/*.jav
11:53:43.124 DEBUG: Declared extensions of language Flex were converted to sonar.lang.patterns.flex : **/*.as
11:53:43.124 DEBUG: Declared extensions of language XML were converted to sonar.lang.patterns.xml : **/*.xml,**/*.xsd,**/*.xsl
11:53:43.124 DEBUG: Declared extensions of language PHP were converted to sonar.lang.patterns.php : **/*.php,**/*.php3,**/*.php4,**/*.php5,**/*.phtml,**/*.inc
11:53:43.124 DEBUG: Declared extensions of language TypeScript were converted to sonar.lang.patterns.ts : **/*.ts,**/*.tsx
11:53:43.124 DEBUG: Declared extensions of language Visual Basic .NET were converted to sonar.lang.patterns.vbnet : **/*.vb
11:53:43.125 DEBUG: Declared extensions of language ABAP were converted to sonar.lang.patterns.abap : **/*.abap,**/*.ab4,**/*.flow,**/*.asprog
11:53:43.125 DEBUG: Declared extensions of language Swift were converted to sonar.lang.patterns.swift : **/*.swift
11:53:43.125 INFO: Language is forced to cpp
11:53:43.134 DEBUG: Initializers : 
11:53:43.135 INFO: Index files
11:53:43.145 DEBUG: 'include/libxxx-convert/ValueFormatter.hpp' indexed with language 'cpp'
11:53:43.146 DEBUG: 'src/ValueFormatter.cpp' indexed with language 'cpp'
11:53:43.146 DEBUG: 'src/Config.hpp' indexed with language 'cpp'
11:53:43.146 DEBUG: 'include/libxxx-convert/EFormatKey.hpp' indexed with language 'cpp'
11:53:43.146 INFO: 4 files indexed
11:53:43.147 INFO: Quality profile for cpp: Sonar way (outdated copy)
11:53:44.308 DEBUG: 'include/libxxx-convert/EFormatKey.hpp' generated metadata  with charset 'UTF-8'
11:53:44.310 DEBUG: 'include/libxxx-convert/ValueFormatter.hpp' generated metadata  with charset 'UTF-8'
11:53:44.310 DEBUG: 'src/Config.hpp' generated metadata  with charset 'UTF-8'
11:53:44.314 DEBUG: 'src/ValueFormatter.cpp' generated metadata  with charset 'UTF-8'
11:53:44.315 DEBUG: 'llvm-cov' skipped because one of the required properties is missing
11:53:44.315 DEBUG: 'VisualStudioCoverage' skipped because one of the required properties is missing
11:53:44.315 DEBUG: 'bullseye' skipped because one of the required properties is missing
11:53:44.316 DEBUG: 'Python Squid Sensor' skipped because there is no related file in current project
11:53:44.316 DEBUG: 'PylintSensor' skipped because there is no related file in current project
11:53:44.316 DEBUG: 'PylintImportSensor' skipped because there is no related file in current project
11:53:44.316 DEBUG: 'PythonXUnitSensor' skipped because there is no related file in current project
11:53:44.316 DEBUG: 'SonarGo' skipped because there is no related file in current project
11:53:44.316 DEBUG: 'Go Unit Test Report' skipped because there is no related file in current project
11:53:44.317 DEBUG: 'Import of go vet issues' skipped because there is no related file in current project
11:53:44.317 DEBUG: 'Import of Golint issues' skipped because there is no related file in current project
11:53:44.317 DEBUG: 'Import of GoMetaLinter issues' skipped because there is no related file in current project
11:53:44.317 DEBUG: 'T-SQL Sensor' skipped because there is no related file in current project
11:53:44.317 DEBUG: 'SonarJS' skipped because there is no related file in current project
11:53:44.317 DEBUG: 'SonarJS Coverage' skipped because there is no related file in current project
11:53:44.317 DEBUG: 'PL/SQL Sensor' skipped because there is no related file in current project
11:53:44.318 DEBUG: 'C#' skipped because there is no related file in current project
11:53:44.318 DEBUG: 'C# Properties' skipped because there is no related file in current project
11:53:44.318 DEBUG: 'C# Tests Coverage Report Import' skipped because there is no related file in current project
11:53:44.318 DEBUG: '[Deprecated] C# Integration Tests Coverage Report Import' skipped because there is no related file in current project
11:53:44.318 DEBUG: 'C# Unit Test Results Import' skipped because there is no related file in current project
11:53:44.319 DEBUG: 'CodeNarc' skipped because there is no related file in current project
11:53:44.319 DEBUG: 'GroovySensor' skipped because there is no related file in current project
11:53:44.319 DEBUG: 'GroovySurefireSensor' skipped because there is no related file in current project
11:53:44.319 DEBUG: 'Groovy CoberturaSensor' skipped because there is no related file in current project
11:53:44.319 DEBUG: 'Groovy JaCoCo' skipped because there is no related file in current project
11:53:44.319 DEBUG: 'Groovy JaCoCo IT' skipped because there is no related file in current project
11:53:44.319 DEBUG: 'Groovy JaCoCo Overall' skipped because there is no related file in current project
11:53:44.319 DEBUG: 'SurefireSensor' skipped because there is no related file in current project
11:53:44.319 DEBUG: 'JaCoCoSensor' skipped because there is no related file in current project
11:53:44.320 DEBUG: 'JavaSquidSensor' skipped because there is no related file in current project
11:53:44.320 DEBUG: 'Flex' skipped because there is no related file in current project
11:53:44.320 DEBUG: 'Flex Cobertura' skipped because there is no related file in current project
11:53:44.320 DEBUG: 'XML Sensor' skipped because there is no related file in current project
11:53:44.320 DEBUG: 'PHP sensor' skipped because there is no related file in current project
11:53:44.320 DEBUG: 'Analyzer for "php.ini" files' skipped because there is no related file in current project
11:53:44.321 DEBUG: 'Import of TSLint issues' skipped because there is no related file in current project
11:53:44.321 DEBUG: 'Import of ESLint issues' skipped because there is no related file in current project
11:53:44.321 DEBUG: 'SonarTS' skipped because there is no related file in current project
11:53:44.321 DEBUG: 'SonarTS Coverage' skipped because there is no related file in current project
11:53:44.321 DEBUG: 'VB.NET' skipped because there is no related file in current project
11:53:44.321 DEBUG: 'VB.NET Properties' skipped because there is no related file in current project
11:53:44.322 DEBUG: 'Visual Basic .NET Tests Coverage Report Import' skipped because there is no related file in current project
11:53:44.322 DEBUG: '[Deprecated] Visual Basic .NET Integration Tests Coverage Report Import' skipped because there is no related file in current project
11:53:44.322 DEBUG: 'Visual Basic .NET Unit Test Results Import' skipped because there is no related file in current project
11:53:44.322 DEBUG: 'AbapSquidSensor' skipped because there is no related file in current project
11:53:44.322 DEBUG: 'Swift Squid Sensor' skipped because there is no related file in current project
11:53:44.324 DEBUG: 'llvm-cov' skipped because one of the required properties is missing
11:53:44.324 DEBUG: 'VisualStudioCoverage' skipped because one of the required properties is missing
11:53:44.325 DEBUG: 'bullseye' skipped because one of the required properties is missing
11:53:44.325 DEBUG: 'Python Squid Sensor' skipped because there is no related file in current project
11:53:44.325 DEBUG: 'PylintSensor' skipped because there is no related file in current project
11:53:44.325 DEBUG: 'PylintImportSensor' skipped because there is no related file in current project
11:53:44.325 DEBUG: 'PythonXUnitSensor' skipped because there is no related file in current project
11:53:44.325 DEBUG: 'SonarGo' skipped because there is no related file in current project
11:53:44.325 DEBUG: 'Go Unit Test Report' skipped because there is no related file in current project
11:53:44.325 DEBUG: 'Import of go vet issues' skipped because there is no related file in current project
11:53:44.325 DEBUG: 'Import of Golint issues' skipped because there is no related file in current project
11:53:44.326 DEBUG: 'Import of GoMetaLinter issues' skipped because there is no related file in current project
11:53:44.326 DEBUG: 'T-SQL Sensor' skipped because there is no related file in current project
11:53:44.326 DEBUG: 'SonarJS' skipped because there is no related file in current project
11:53:44.326 DEBUG: 'SonarJS Coverage' skipped because there is no related file in current project
11:53:44.326 DEBUG: 'PL/SQL Sensor' skipped because there is no related file in current project
11:53:44.326 DEBUG: 'C#' skipped because there is no related file in current project
11:53:44.326 DEBUG: 'C# Properties' skipped because there is no related file in current project
11:53:44.326 DEBUG: 'C# Tests Coverage Report Import' skipped because there is no related file in current project
11:53:44.326 DEBUG: '[Deprecated] C# Integration Tests Coverage Report Import' skipped because there is no related file in current project
11:53:44.327 DEBUG: 'C# Unit Test Results Import' skipped because there is no related file in current project
11:53:44.327 DEBUG: 'CodeNarc' skipped because there is no related file in current project
11:53:44.327 DEBUG: 'GroovySensor' skipped because there is no related file in current project
11:53:44.327 DEBUG: 'GroovySurefireSensor' skipped because there is no related file in current project
11:53:44.327 DEBUG: 'Groovy CoberturaSensor' skipped because there is no related file in current project
11:53:44.327 DEBUG: 'Groovy JaCoCo' skipped because there is no related file in current project
11:53:44.327 DEBUG: 'Groovy JaCoCo IT' skipped because there is no related file in current project
11:53:44.327 DEBUG: 'Groovy JaCoCo Overall' skipped because there is no related file in current project
11:53:44.327 DEBUG: 'SurefireSensor' skipped because there is no related file in current project
11:53:44.327 DEBUG: 'JaCoCoSensor' skipped because there is no related file in current project
11:53:44.327 DEBUG: 'JavaSquidSensor' skipped because there is no related file in current project
11:53:44.328 DEBUG: 'Flex' skipped because there is no related file in current project
11:53:44.328 DEBUG: 'Flex Cobertura' skipped because there is no related file in current project
11:53:44.328 DEBUG: 'XML Sensor' skipped because there is no related file in current project
11:53:44.328 DEBUG: 'PHP sensor' skipped because there is no related file in current project
11:53:44.328 DEBUG: 'Analyzer for "php.ini" files' skipped because there is no related file in current project
11:53:44.328 DEBUG: 'Import of TSLint issues' skipped because there is no related file in current project
11:53:44.328 DEBUG: 'Import of ESLint issues' skipped because there is no related file in current project
11:53:44.328 DEBUG: 'SonarTS' skipped because there is no related file in current project
11:53:44.328 DEBUG: 'SonarTS Coverage' skipped because there is no related file in current project
11:53:44.329 DEBUG: 'VB.NET' skipped because there is no related file in current project
11:53:44.329 DEBUG: 'VB.NET Properties' skipped because there is no related file in current project
11:53:44.329 DEBUG: 'Visual Basic .NET Tests Coverage Report Import' skipped because there is no related file in current project
11:53:44.329 DEBUG: '[Deprecated] Visual Basic .NET Integration Tests Coverage Report Import' skipped because there is no related file in current project
11:53:44.329 DEBUG: 'Visual Basic .NET Unit Test Results Import' skipped because there is no related file in current project
11:53:44.329 DEBUG: 'AbapSquidSensor' skipped because there is no related file in current project
11:53:44.329 DEBUG: 'Swift Squid Sensor' skipped because there is no related file in current project
11:53:44.332 DEBUG: Sensors : gcov -> cppunit -> SonarJavaXmlFileSensor -> CFamily -> JavaSecuritySensor -> CSharpSecuritySensor
11:53:44.332 INFO: Sensor gcov [cpp]
11:53:44.340 INFO: Sensor gcov [cpp] (done) | time=8ms
11:53:44.340 INFO: Sensor cppunit [cpp]
11:53:44.341 INFO: Parsing /home/yyy/jenkins-jobs/workspace/DSL-zzzz-Unittest-xxxx-convert-lib/components/xxxx-convert-lib/lib/reports/cppunit/cppunit_ValueFormatterTest.xml
11:53:44.379 WARN: Metric 'test_success_density' is an internal metric computed by SonarQube. Provided value is ignored.
11:53:44.379 INFO: Sensor cppunit [cpp] (done) | time=39ms
11:53:44.379 INFO: Sensor SonarJavaXmlFileSensor [java]
11:53:44.380 INFO: Sensor SonarJavaXmlFileSensor [java] (done) | time=1ms
11:53:44.380 INFO: Sensor CFamily [cpp]
11:53:44.382 INFO: Available processors: 8
11:53:44.382 INFO: Using 1 thread for analysis according to value of "sonar.cfamily.threads" property.
11:53:44.436 INFO: Using build-wrapper output: /home/yyy/jenkins-jobs/workspace/DSL-zzzz-Unittest-xxxx-convert-lib/components/xxxx-convert-lib/lib/reports/build-wrapper/build-wrapper-dump.json
11:53:45.221 DEBUG: [pool-3-thread-1] /home/yyy/jenkins-jobs/workspace/DSL-zzzz-Unittest-xxxx-convert-lib/components/xxxx-convert-lib/lib/src/ValueFormatter.cpp
11:53:45.295 DEBUG: /opt/melux-sdks/v1705-1.0+snapshot+20180611-1/sysroots/x86_64-pokysdk-linux/usr/lib/arm-melux-linux-gnueabi/gcc/arm-melux-linux-gnueabi/6.3.0/include/stdint.h:9: 'stdint.h' file not found
11:53:45.295 DEBUG: /home/yyy/jenkins-jobs/workspace/DSL-zzzz-Unittest-xxxx-convert-lib/components/xxxx-convert-lib/lib/include/libxxx-convert/ValueFormatter.hpp:12: 'string' file not found
11:53:45.295 DEBUG: /home/yyy/jenkins-jobs/workspace/DSL-zzzz-Unittest-xxxx-convert-lib/components/xxxx-convert-lib/lib/include/libxxx-convert/ValueFormatter.hpp:13: 'utility' file not found
11:53:45.364 DEBUG: /home/yyy/jenkins-jobs/workspace/DSL-zzzz-Unittest-xxxx-convert-lib/components/xxxx-convert-lib/lib/src/Config.hpp:13: 'log4cpp/Category.hh' file not found
11:53:45.365 DEBUG: /home/yyy/jenkins-jobs/workspace/DSL-zzzz-Unittest-xxxx-convert-lib/components/xxxx-convert-lib/lib/src/Config.hpp:14: 'string' file not found
11:53:45.368 DEBUG: /home/yyy/jenkins-jobs/workspace/DSL-zzzz-Unittest-xxxx-convert-lib/components/xxxx-convert-lib/lib/src/ValueFormatter.cpp:12: 'iomanip' file not found
11:53:45.368 DEBUG: /home/yyy/jenkins-jobs/workspace/DSL-zzzz-Unittest-xxxx-convert-lib/components/xxxx-convert-lib/lib/src/ValueFormatter.cpp:13: 'sstream' file not found
11:53:45.368 DEBUG: /home/yyy/jenkins-jobs/workspace/DSL-zzzz-Unittest-xxxx-convert-lib/components/xxxx-convert-lib/lib/src/ValueFormatter.cpp:14: 'stdexcept' file not found
11:53:45.538 INFO: 1 compilation units analyzed
11:53:45.538 INFO: PCH: 0 + 0 + 0 , 5 - 0 - 0 - 0
11:53:45.538 INFO: FS: 2424 lookups
11:53:45.539 INFO: PPH: 4 files, 3799 bytes, 0 hits, 4 queries
11:53:45.541 INFO: Sensor CFamily [cpp] (done) | time=1161ms
11:53:45.541 INFO: Sensor JavaSecuritySensor [security]
11:53:45.544 DEBUG: UCFGs:0 excluded: 0 entrypoints: 0
11:53:45.544 INFO: Analyzing 0 ucfgs to detect vulnerabilities.
11:53:45.545 INFO: Sensor JavaSecuritySensor [security] (done) | time=4ms
11:53:45.545 INFO: Sensor CSharpSecuritySensor [security]
11:53:45.545 DEBUG: UCFGs:0 excluded: 0 entrypoints: 0
11:53:45.545 INFO: Analyzing 0 ucfgs to detect vulnerabilities.
11:53:45.545 INFO: Sensor CSharpSecuritySensor [security] (done) | time=0ms
11:53:45.545 INFO: Load server issues
11:53:45.944 DEBUG: GET 200 http://sonarserver/batch/issues.protobuf?key=de.x.convert | time=398ms
11:53:45.949 INFO: Load server issues (done) | time=404ms
11:53:45.950 INFO: Performing issue tracking
11:53:45.963 DEBUG: Load line hashes | file=de.x.convert:src/ValueFormatter.cpp
11:53:46.347 DEBUG: GET 404 http://sonarserver/api/sources/hash?key=de.x.convert%3Asrc%2FValueFormatter.cpp | time=384ms
11:53:46.348 INFO: 1/7 components tracked
11:53:46.395 INFO: ------------------------------------------------------------------------
11:53:46.395 INFO: EXECUTION FAILURE
11:53:46.395 INFO: ------------------------------------------------------------------------
11:53:46.395 INFO: Total time: 23.137s
11:53:46.473 INFO: Final Memory: 35M/858M
11:53:46.473 INFO: ------------------------------------------------------------------------
11:53:46.473 ERROR: Error during SonarQube Scanner execution
org.sonarqube.ws.client.HttpException: Error 404 on http://sonarserver/api/sources/hash?key=de.x.convert%3Asrc%2FValueFormatter.cpp : {"errors":[{"msg":"Component key 'de.x.convert:src/ValueFormatter.cpp' not found"}]}
	at org.sonarqube.ws.client.BaseResponse.failIfNotSuccessful(BaseResponse.java:36)
	at org.sonar.scanner.bootstrap.ScannerWsClient.failIfUnauthorized(ScannerWsClient.java:106)
	at org.sonar.scanner.bootstrap.ScannerWsClient.call(ScannerWsClient.java:75)
	at org.sonar.scanner.issue.tracking.DefaultServerLineHashesLoader.loadHashesFromWs(DefaultServerLineHashesLoader.java:52)
	at org.sonar.scanner.issue.tracking.DefaultServerLineHashesLoader.getLineHashes(DefaultServerLineHashesLoader.java:42)
	at org.sonar.scanner.issue.tracking.SourceHashHolder.initHashes(SourceHashHolder.java:56)
	at org.sonar.scanner.issue.tracking.SourceHashHolder.getHashedSource(SourceHashHolder.java:69)
	at org.sonar.scanner.issue.IssueTransformer.toTrackedIssue(IssueTransformer.java:92)
	at org.sonar.scanner.issue.IssueTransformer.toTrackedIssue(IssueTransformer.java:80)
	at org.sonar.scanner.issue.tracking.LocalIssueTracking.trackIssues(LocalIssueTracking.java:91)
	at org.sonar.scanner.issue.tracking.IssueTransition.trackIssues(IssueTransition.java:103)
	at org.sonar.scanner.issue.tracking.IssueTransition.execute(IssueTransition.java:81)
	at org.sonar.scanner.phases.IssuesPhaseExecutor.localIssueTracking(IssuesPhaseExecutor.java:64)
	at org.sonar.scanner.phases.IssuesPhaseExecutor.executeOnRoot(IssuesPhaseExecutor.java:56)
	at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:93)
	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:182)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
	at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:312)
	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:307)
	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:281)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
	at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:48)
	at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:81)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
	at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:132)
	at org.sonar.batch.bootstrapper.Batch.doExecuteTask(Batch.java:116)
	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:71)
	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
	at com.sun.proxy.$Proxy0.execute(Unknown Source)
	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:171)
	at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:128)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:111)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
	at org.sonarsource.scanner.cli.Main.main(Main.java:61)
ERROR: Preview analysing of './sonar-project.properties' failed.

CSV-Tom avatar Sep 05 '18 10:09 CSV-Tom

@CSV-Tom It's not a bug with sonar-gitlab-plugin. Plugin start only after

[INFO] 10:45:50.866 ANALYSIS SUCCESSFUL
[DEBUG] 10:45:50.960 Post-jobs : GitLab Commit Issue Publisher (wrapped)
[INFO] 10:45:50.960 Executing post-job GitLab Commit Issue Publisher (wrapped)

Have you testing without set sonar.gitlab.project_id ?

gabrie-allaigre avatar Sep 05 '18 12:09 gabrie-allaigre

Testing without set sonar.gitlab.project_id

sonar-scanner --debug \
    -Dsonar.branch.name="develop" \
    -Dsonar.gitlab.ref_name="develop" \
    -Dsonar.gitlab.commit_sha="$sonarGitlabCommitSHA" \
    -Dsonar.analysis.mode=preview
15:43:52.825 INFO: Scanner configuration file: /opt/sonar-runner/sonar-scanner-3.2.0.1227-linux/conf/sonar-scanner.properties
15:43:52.834 INFO: Project root configuration file: /home/yyy/jenkins-jobs/workspace/DSL-zzzz-Unittest-xxxx-convert-lib/components/xxxx-convert-lib/lib/sonar-project.properties
15:43:52.871 INFO: SonarQube Scanner 3.2.0.1227
15:43:52.871 INFO: Java 1.8.0_121 Oracle Corporation (64-bit)
15:43:52.872 INFO: Linux 4.15.0-33-generic amd64
15:43:53.123 DEBUG: keyStore is : 
15:43:53.123 DEBUG: keyStore type is : jks
15:43:53.123 DEBUG: keyStore provider is : 
15:43:53.123 DEBUG: init keystore
15:43:53.124 DEBUG: init keymanager of type SunX509
15:43:53.241 DEBUG: Create: /home/yyy/.sonar/cache
15:43:53.242 INFO: User cache: /home/yyy/.sonar/cache
15:43:53.242 DEBUG: Create: /home/yyy/.sonar/cache/_tmp
15:43:53.245 DEBUG: Extract sonar-scanner-api-batch in temp...
15:43:53.249 DEBUG: Get bootstrap index...
15:43:53.251 DEBUG: Download: http://sonarserver/batch/index
15:43:53.307 DEBUG: Get bootstrap completed
15:43:53.316 DEBUG: Create isolated classloader...
15:43:53.325 DEBUG: Start temp cleaning...
15:43:53.332 DEBUG: Temp cleaning done
15:43:53.332 DEBUG: Execution getVersion
15:43:53.335 INFO: SonarQube server 7.2.1
15:43:53.342 INFO: Default locale: "de_DE", source code encoding: "UTF-8"
15:43:53.343 DEBUG: Work directory: /home/yyy/jenkins-jobs/workspace/DSL-zzzz-Unittest-xxxx-convert-lib/components/xxxx-convert-lib/lib/.scannerwork
15:43:53.345 DEBUG: Execution execute
15:43:53.514 INFO: Issues mode
15:43:53.514 WARN: The use of the issues mode (sonar.analysis.mode=issues) is deprecated. This mode will be dropped in the future.
15:43:53.646 INFO: Load global settings
15:43:54.079 DEBUG: GET 200 http://sonarserver/api/settings/values.protobuf | time=424ms
15:43:54.103 INFO: Load global settings (done) | time=458ms
15:43:54.109 INFO: Server id: 1db68331b1afe9d
15:43:54.119 INFO: User cache: /home/yyy/.sonar/cache
15:43:54.126 INFO: Exclude plugins: devcockpit, ldap, authgithub, authbitbucket, pdfreport, authaad, googleanalytics, governance
15:43:54.318 INFO: Load/download plugins
15:43:54.318 INFO: Load plugins index
15:43:54.713 DEBUG: GET 200 http://sonarserver/api/plugins/installed | time=395ms
15:43:54.749 INFO: Load plugins index (done) | time=431ms
15:43:54.837 INFO: Load/download plugins (done) | time=519ms
15:43:54.984 DEBUG: Plugins:
15:43:54.984 DEBUG:   * SonarCFamily 5.1.0.10083 (cpp)
15:43:54.984 DEBUG:   * SonarPython 1.10.0.2131 (python)
15:43:54.984 DEBUG:   * SonarGo 1.1.0.1612 (go)
15:43:54.984 DEBUG:   * SonarTSQL 1.2.0.2539 (tsql)
15:43:54.985 DEBUG:   * Svn 1.7.0.1017 (scmsvn)
15:43:54.985 DEBUG:   * SonarJS 4.1.0.6085 (javascript)
15:43:54.985 DEBUG:   * GitLab Auth 1.3.2 (authgitlab)
15:43:54.985 DEBUG:   * SonarPLSQL 3.2.0.1753 (plsql)
15:43:54.985 DEBUG:   * License for SonarLint 7.2.1 (license)
15:43:54.985 DEBUG:   * SonarC# 7.2.0.5463 (csharp)
15:43:54.985 DEBUG:   * SonarSecurity 7.2.1.983 (security)
15:43:54.985 DEBUG:   * Groovy 1.5 (groovy)
15:43:54.985 DEBUG:   * SonarJava 5.5.0.14655 (java)
15:43:54.985 DEBUG:   * Git 1.4.1.1128 (scmgit)
15:43:54.986 DEBUG:   * SonarFlex 2.4.0.1222 (flex)
15:43:54.986 DEBUG:   * SonarXML 1.5.1.1452 (xml)
15:43:54.986 DEBUG:   * SonarPHP 2.13.0.3107 (php)
15:43:54.986 DEBUG:   * GitLab 3.0.1 (gitlab)
15:43:54.986 DEBUG:   * SonarTS 1.7.0.2893 (typescript)
15:43:54.986 DEBUG:   * SonarVB 5.1.0.442 (vbnet)
15:43:54.986 DEBUG:   * SonarABAP 3.6.0.1269 (abap)
15:43:54.986 DEBUG:   * SonarSwift 3.3.0.2492 (swift)
15:43:55.008 INFO: Loaded core extensions: branch-scanner
15:43:55.236 INFO: Installed core extension: branch-scanner
15:43:55.355 INFO: Installed core extension: branch-scanner
15:43:55.358 INFO: Process project properties
15:43:55.363 DEBUG: Process project properties (done) | time=5ms
15:43:55.368 INFO: Load project branches
15:43:55.762 DEBUG: GET 200 http://sonarserver/api/project_branches/list?project=de.melag.convert | time=394ms
15:43:55.768 INFO: Load project branches (done) | time=400ms
15:43:55.769 INFO: Load project pull requests
15:43:56.154 DEBUG: GET 200 http://sonarserver/api/project_pull_requests/list?project=de.melag.convert | time=384ms
15:43:56.155 INFO: Load project pull requests (done) | time=386ms
15:43:56.156 INFO: Load branch configuration
15:43:56.156 DEBUG: Not on a Bitbucket pipeline.
15:43:56.158 INFO: Load branch configuration (done) | time=2ms
15:43:56.158 INFO: Load project repositories
15:43:56.561 DEBUG: GET 200 http://sonarserver/batch/project.protobuf?key=de.melag.convert&issues_mode=true&branch=zzzz | time=403ms
15:43:56.618 INFO: Load project repositories (done) | time=460ms
15:43:56.671 INFO: Scanning only changed files
15:43:56.672 INFO: Execute project builders
15:43:56.833 INFO: ------------------------------------------------------------------------
15:43:56.833 INFO: EXECUTION FAILURE
15:43:56.833 INFO: ------------------------------------------------------------------------
15:43:56.833 INFO: Total time: 4.035s
15:43:56.907 INFO: Final Memory: 26M/523M
15:43:56.907 INFO: ------------------------------------------------------------------------
15:43:56.907 ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.scan.ProjectLock
	at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)
	at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:678)
	at org.sonar.core.platform.ComponentContainer.getComponentByType(ComponentContainer.java:281)
	at org.sonar.scanner.scan.ProjectScanContainer.doBeforeStart(ProjectScanContainer.java:123)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:134)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
	at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:48)
	at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:81)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
	at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:132)
	at org.sonar.batch.bootstrapper.Batch.doExecuteTask(Batch.java:116)
	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:71)
	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
	at com.sun.proxy.$Proxy0.execute(Unknown Source)
	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:171)
	at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:128)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:111)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
	at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.scan.DefaultInputModuleHierarchy
	at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)
	at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
	at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
	at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
	at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
	at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
	at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
	at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
	at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
	at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
	at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
	at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
	at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
	at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
	at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:63)
	... 24 more
Caused by: Failed to execute project builder: com.talanlabs.sonar.plugins.gitlab.CommitProjectBuilder
Caused by: java.lang.IllegalStateException: Unable found project for null project name. Set Configuration sonar.gitlab.project_id
	at com.talanlabs.sonar.plugins.gitlab.GitLabApiV4Wrapper.getGitLabProject(GitLabApiV4Wrapper.java:78)
	at com.talanlabs.sonar.plugins.gitlab.GitLabApiV4Wrapper.init(GitLabApiV4Wrapper.java:63)
	at com.talanlabs.sonar.plugins.gitlab.CommitFacade.init(CommitFacade.java:81)
	at com.talanlabs.sonar.plugins.gitlab.CommitProjectBuilder.build(CommitProjectBuilder.java:46)
	at org.sonar.scanner.scan.ProjectBuildersExecutor.execute(ProjectBuildersExecutor.java:52)
	at org.sonar.scanner.scan.InputModuleHierarchyProvider.provide(InputModuleHierarchyProvider.java:39)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.picocontainer.injectors.MethodInjector.invokeMethod(MethodInjector.java:129)
	at org.picocontainer.injectors.MethodInjector.access$000(MethodInjector.java:39)
	at org.picocontainer.injectors.MethodInjector$2.run(MethodInjector.java:113)
	at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
	at org.picocontainer.injectors.MethodInjector.decorateComponentInstance(MethodInjector.java:120)
	at org.picocontainer.injectors.CompositeInjector.decorateComponentInstance(CompositeInjector.java:58)
	at org.picocontainer.injectors.Reinjector.reinject(Reinjector.java:142)
	at org.picocontainer.injectors.ProviderAdapter.getComponentInstance(ProviderAdapter.java:96)
	at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
	at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
	at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:63)
	at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
	at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
	at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
	at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
	at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
	at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
	at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
	at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
	at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
	at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
	at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
	at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
	at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
	at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:63)
	at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:678)
	at org.sonar.core.platform.ComponentContainer.getComponentByType(ComponentContainer.java:281)
	at org.sonar.scanner.scan.ProjectScanContainer.doBeforeStart(ProjectScanContainer.java:123)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:134)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
	at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:48)
	at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:81)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
	at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:132)
	at org.sonar.batch.bootstrapper.Batch.doExecuteTask(Batch.java:116)
	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:71)
	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
	at com.sun.proxy.$Proxy0.execute(Unknown Source)
	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:171)
	at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:128)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:111)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
	at org.sonarsource.scanner.cli.Main.main(Main.java:61)
ERROR: Preview analysing of './sonar-project.properties' failed.

CSV-Tom avatar Sep 05 '18 13:09 CSV-Tom

Sorry, try without set sonar.gitlab.commit_sha

gabrie-allaigre avatar Sep 05 '18 13:09 gabrie-allaigre

Sorry, try without set sonar.gitlab.commit_sha

--> Same result

If I'm wrong, please correct. I think I have the answer:

This error only occurs with new files (*.cpp, *.hpp).

The preview does not upload the new files to the sonar (this is clear - is a preview). The sonar scanner tries to download the new file from the sonar via HTTP request and fails because it is not stored in the current branch of project in sonar.

Command (Analyse failed)

sonar-scanner --debug \
    -Dsonar.branch.name="$sonarGitlabBranch" \ <---- This is the problem. Without this parameter it's works.
    -Dsonar.gitlab.ref_name="$sonarGitlabRefName" \
    -Dsonar.gitlab.commit_sha="<sha>" \
    -Dsonar.gitlab.project_id="<project-id>" \
    -Dsonar.analysis.mode=preview

Error org.sonarqube.ws.client.HttpException: Error 404 on http://sonarserver/api/sources/hash?key=xx.xxxxx.sonar-bug-test%3Asrc%2FTestFile.cpp : {"errors":[{"msg":"Component key 'xx.xxxxx.sonar-bug-test:src/TestFile.cpp' not found"}]}

Problem

Developer                                 Gitlab                                              SonarRunner                      SonarQube      
     |                                      |                                                     |                               |
     |--->|                                 |                                                     |                               |
     |    | Added new class (TestFile.hpp)  |                                                     |                               |
     | <--|                                 |                                                     |                               |
     |                                      |                                                     |                               |
     | Merge request to develop accepted    |                                                     |                               |             
     |------------------------------------> |     Trigger jenkins job for                         |                               |  
                                            |     execution of sonar runner                       |                               |
                                            |---------------------------------------------------->| Sonar scanner preview mode    |
                                                                                                  | 				  |									  						                                                          |                               | 
                                                                                                  |-->| Sonar scanner preview mode| 
                                                                                                  |   |                           | 
                                                                                                  |   | download TestFile.hpp     | 
                                                                                                  |   |-------------------------->|
                                                                                                  |   |                           |-->|
                                                                                                  |   |                           |   | File not found in branch develop
                                                                                                  |   |                           |<--|
                                                                                                  |   |<--------------------------|
                                                                                                  |   | 
                                                                                                  |   | abort
                                                                                                  |<--|
                                                                                                  x

Command (Analyse Successful)

sonar-scanner --debug \
    -Dsonar.gitlab.ref_name="$sonarGitlabRefName" \
    -Dsonar.gitlab.commit_sha="<sha>" \
    -Dsonar.gitlab.project_id="<project-id>" \
    -Dsonar.analysis.mode=preview

This case is difficult to reproduce.

CSV-Tom avatar Sep 05 '18 15:09 CSV-Tom

@CSV-Tom Ok, Have you last full log please? Does it work without sonar-gitlab-plugin?

gabrie-allaigre avatar Sep 05 '18 16:09 gabrie-allaigre

@CSV-Tom Ok, Have you last full log please?

The log is missing.

Does it work without sonar-gitlab-plugin?

No, not yet. I can test it tomorrow.

I have to repoduce it first. The reproduction is difficult.

CSV-Tom avatar Sep 05 '18 16:09 CSV-Tom

Sorry to necrobump, but I'm having the same issue as https://github.com/gabrie-allaigre/sonar-gitlab-plugin/issues/129#issuecomment-418784375. My issue the exact same one:

  1. A new file is pushed onto a feature branch
  2. The target branch for the preview is set to develop
  3. The plugin tries to pull the current version of the file from the develop branch
  4. Since the file doesn't exist on develop, the plugin returns an error

dakzilla avatar May 22 '19 17:05 dakzilla

I'm using gitlab CI, and experiencing quite similar error messages. sonar is 7.5 (with community branch plugin), plugin is 4.1.0-SNAPSHOT, gitlab is 11.11.3

invocation: gradle plugin runs the scanner options related to gitlab plugin:

-Dsonar.gitlab.project_id='${CI_PROJECT_PATH}' \
-Dsonar.gitlab.commit_sha='${CI_COMMIT_SHA}' \
-Dsonar.gitlab.ref_name='${CI_COMMIT_REF_NAME}' \
-Dsonar.branch.name='${CI_COMMIT_REF_NAME}' \

log segment:

ANALYSIS SUCCESSFUL, you can browse https://sonar/dashboard?id=smartvillage&branch=feature-SVI-0--Code-coverage-tuning-Dsonar.branch.target%3Ddevelop&resolved=false
Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
More about the report processing at https://sonar/api/ce/task?id=AWt57a5kpalCgURDSP5M
Executing post-job 'Final report'
Turn debug info on to get more details (sonar-scanner -X -Dsonar.verbose=true ...).
Executing post-job 'GitLab Commit Issue Publisher'
...
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':sonarqube'.
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$2.accept(ExecuteActionsTaskExecuter.java:121)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$2.accept(ExecuteActionsTaskExecuter.java:117)
	at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:184)
...
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: SonarQube failed to complete the review of this commit: Fail to request https://sonar/api/ce/task?id=AWt57a5kpalCgURDSP5M
Caused by: java.lang.IllegalStateException: Fail to request https://sonar/api/ce/task?id=AWt57a5kpalCgURDSP5M
	at org.sonarqube.ws.client.HttpConnector.doCall(HttpConnector.java:190)
	at org.sonarqube.ws.client.HttpConnector.get(HttpConnector.java:124)
	at org.sonarqube.ws.client.HttpConnector.call(HttpConnector.java:111)
	at org.sonarqube.ws.client.BaseService.call(BaseService.java:52)
...
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: javax.net.ssl.SSLPeerUnverifiedException: Hostname sonar not verified:
    certificate: sha256/NjHi1erI/uPW3Q9zPQhyB30vRRyA8DXlTvwCGrUZDaE=
    DN: CN=gitlab
    subjectAltNames: [gitlab]
	at okhttp3.internal.connection.RealConnection.connectTls(RealConnection.java:277)
	at okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.java:238)
	at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:149)
...

Looks like for me, that the server certificate doesn't match the url, but this isn't the case for any of the involved containers.

Same time logs in gitlab:

Jun 21 14:05:58 docker-host 81ad9c7870b9[10200]: {"time":"2019-06-21T12:05:57.437Z","severity":"INFO","duration":280.38,"db":53.23,"view":227.15,"status":201,"method":"POST","path":"/api/v4/projects/8/statuses/c459ab2954ed2da1bbccb233
66004262d5cac33e","params":[{"key":"ref","value":"feature-SVI-0--Code-coverage-tuning"},{"key":"name","value":"sonarqube"},{"key":"description","value":"SonarQube analysis in progress"},{"key":"state","value":"pending"}],"host":"gitla
b","ip":"10.254.138.83, 172.18.0.4, 127.0.0.1","ua":"Java/11.0.2","route":"/api/:version/projects/:id/statuses/:sha","user_id":2,"username":"heidricha","queue_duration":26.82,"gitaly_calls":4,"gitaly_duration":21.71,"correlation_id":"
PhLwmmQbjw8"}
Jun 21 14:05:58 docker-host 81ad9c7870b9[10200]: {"time":"2019-06-21T12:05:57.641Z","severity":"INFO","duration":15.15,"db":3.47,"view":11.68,"status":202,"method":"PATCH","path":"/api/v4/jobs/23257/trace","params":[],"host":"gitlab",
"ip":"10.254.138.83, 172.18.0.4, 127.0.0.1","ua":"gitlab-runner 11.10.1 (11-10-stable; go1.8.7; linux/amd64)","route":"/api/:version/jobs/:id/trace","queue_duration":6.51,"gitaly_calls":0,"gitaly_duration":0,"correlation_id":"Cx7fnEPa
A19"}
Jun 21 14:05:58 docker-host 81ad9c7870b9[10200]: {"time":"2019-06-21T12:05:58.022Z","severity":"INFO","duration":326.4,"db":64.8,"view":261.59999999999997,"status":201,"method":"POST","path":"/api/v4/projects/8/statuses/c459ab2954ed2d
a1bbccb23366004262d5cac33e","params":[{"key":"ref","value":"feature-SVI-0--Code-coverage-tuning"},{"key":"name","value":"sonarqube"},{"key":"description","value":"SonarQube failed to complete the review of this commit: Fail to request
 https://sonar/api/ce/task?id=AWt57a5kpalCgURDSP5M"},{"key":"state","value":"failed"}],"host":"gitlab","ip":"10.254.138.83, 172.18.0.4, 127.0.0.1","ua":"Java/11.0.2","route":"/api/:version/projects/:id/statuses/:sha","user_id":2,"user
name":"heidricha","queue_duration":22.9,"gitaly_calls":3,"gitaly_duration":20.33,"correlation_id":"sKAICyt49l2"}
Jun 21 14:05:58 docker-host 81ad9c7870b9[10200]:

No contact is made to the "sonar" named server according to the nginx access logs (runs on the same nginx rproxy as the gitlab itself)

UPDATE:

Case solved... unfortunately sonar-scanner uses some old method for https, so don't use SNI, always gets the default certificate from a multiple-hostname webserver. I had to create a path-mapped API entrypoint UNDER the sonar site for gitlab, to make it work.

heidricha avatar Jun 21 '19 12:06 heidricha

The same issues i am getting in Jenkins with sonar..

19:28:40.311 INFO: Project root configuration file: NONE 19:28:40.334 INFO: SonarQube Scanner 3.2.0.1227 19:28:40.335 INFO: Java 1.8.0_275 Private Build (64-bit) 19:28:40.335 INFO: Linux 5.4.0-1030-aws amd64 19:28:40.467 DEBUG: keyStore is : 19:28:40.467 DEBUG: keyStore type is : jks 19:28:40.467 DEBUG: keyStore provider is : 19:28:40.467 DEBUG: init keystore 19:28:40.467 DEBUG: init keymanager of type SunX509 19:28:40.544 DEBUG: Create: /home/jenkins/.sonar/cache 19:28:40.545 INFO: User cache: /home/jenkins/.sonar/cache 19:28:40.545 DEBUG: Create: /home/jenkins/.sonar/cache/tmp 19:28:40.548 DEBUG: Extract sonar-scanner-api-batch in temp... 19:28:40.554 DEBUG: Get bootstrap index... 19:28:40.555 DEBUG: Download: http://localhost:9000/batch/index 19:28:40.589 DEBUG: Get bootstrap completed 19:28:40.596 DEBUG: Create isolated classloader... 19:28:40.602 DEBUG: Start temp cleaning... 19:28:40.610 DEBUG: Temp cleaning done 19:28:40.610 DEBUG: Execution getVersion 19:28:40.612 INFO: SonarQube server 8.3.0 19:28:40.613 INFO: Default locale: "en", source code encoding: "UTF-8" (analysis is platform dependent) 19:28:40.613 DEBUG: Work directory: /home/jenkins/workspace/stage-branch-admin/.scannerwork 19:28:40.614 DEBUG: Execution execute 19:28:40.772 WARN: SonarScanner will require Java 11 to run starting in SonarQube 8.x 19:28:40.773 DEBUG: Community 8.3.0.34182 19:28:40.864 INFO: Load global settings 19:28:40.901 DEBUG: GET 200 http://localhost:9000/api/settings/values.protobuf | time=36ms 19:28:40.934 INFO: Load global settings (done) | time=70ms 19:28:40.936 INFO: Server id: 86E1FA4D-AXY0PQ2zk7rPRNnkfwWY 19:28:40.941 INFO: User cache: /home/jenkins/.sonar/cache 19:28:40.944 INFO: Load/download plugins 19:28:40.945 INFO: Load plugins index 19:28:40.962 DEBUG: GET 200 http://localhost:9000/api/plugins/installed | time=17ms 19:28:40.997 INFO: Load plugins index (done) | time=52ms 19:28:41.024 INFO: Load/download plugins (done) | time=80ms 19:28:41.065 DEBUG: Plugins: 19:28:41.066 DEBUG: * SonarPython 2.8.0.6204 (python) 19:28:41.066 DEBUG: * SonarCSS 1.2.0.1325 (cssfamily) 19:28:41.066 DEBUG: * JaCoCo 1.1.0.898 (jacoco) 19:28:41.066 DEBUG: * SonarGo 1.6.0.719 (go) 19:28:41.066 DEBUG: * SonarKotlin 1.5.0.315 (kotlin) 19:28:41.066 DEBUG: * Svn 1.9.0.1295 (scmsvn) 19:28:41.066 DEBUG: * SonarJS 6.2.0.12043 (javascript) 19:28:41.066 DEBUG: * SonarRuby 1.5.0.315 (ruby) 19:28:41.066 DEBUG: * SonarScala 1.5.0.315 (sonarscala) 19:28:41.067 DEBUG: * C# Code Quality and Security 8.6.1.17183 (csharp) 19:28:41.067 DEBUG: * Java Code Quality and Security 6.3.0.21585 (java) 19:28:41.067 DEBUG: * SonarHTML 3.2.0.2082 (web) 19:28:41.067 DEBUG: * Git 1.11.1.2008 (scmgit) 19:28:41.067 DEBUG: * SonarFlex 2.5.1.1831 (flex) 19:28:41.067 DEBUG: * SonarXML 2.0.1.2020 (xml) 19:28:41.067 DEBUG: * SonarPHP 3.3.0.5166 (php) 19:28:41.067 DEBUG: * SonarTS 2.1.0.4359 (typescript) 19:28:41.067 DEBUG: * VB.NET Code Quality and Security 8.6.1.17183 (vbnet) 19:28:41.561 INFO: Process project properties 19:28:41.562 INFO: Process project properties (done) | time=1ms 19:28:41.562 INFO: Execute project builders 19:28:41.563 DEBUG: Execute project builder: org.sonar.plugins.csharp.CSharpGlobalProtobufFileProcessor 19:28:41.565 DEBUG: Execute project builder: org.sonar.plugins.vbnet.VbNetGlobalProtobufFileProcessor 19:28:41.566 INFO: Execute project builders (done) | time=4ms 19:28:41.568 WARN: "stage-branch-admin-Dsonar.projectName=GD-admin-Dsonar.language=ts-Dsonar.sources=/home/jenkins/workspace/stage-branch-admin/dist/app-admin/-Dsonar.tests=/home/jenkins/workspace/stage-branch-admin/dist/app-admin/" is not a valid project or module key. Allowed characters are alphanumeric, '-', '', '.' and ':', with at least one non-digit. 19:28:41.571 INFO: Project key: stage-branch-admin-Dsonar.projectName=GD-admin-Dsonar.language=ts-Dsonar.sources=/home/jenkins/workspace/stage-branch-admin/dist/app-admin/-Dsonar.tests=/home/jenkins/workspace/stage-branch-admin/dist/app-admin/ 19:28:41.571 INFO: Base dir: /home/jenkins/workspace/stage-branch-admin 19:28:41.571 INFO: Working dir: /home/jenkins/workspace/stage-branch-admin/.scannerwork 19:28:41.572 DEBUG: Project global encoding: UTF-8, default locale: en 19:28:41.574 DEBUG: Creating module hierarchy 19:28:41.574 DEBUG: Init module 'stage-branch-admin-Dsonar.projectName=GD-admin-Dsonar.language=ts-Dsonar.sources=/home/jenkins/workspace/stage-branch-admin/dist/app-admin/-Dsonar.tests=/home/jenkins/workspace/stage-branch-admin/dist/app-admin/' 19:28:41.574 DEBUG: Base dir: /home/jenkins/workspace/stage-branch-admin 19:28:41.574 DEBUG: Working dir: /home/jenkins/workspace/stage-branch-admin/.scannerwork 19:28:41.574 DEBUG: Module global encoding: UTF-8, default locale: en 19:28:41.932 INFO: Load project settings for component key: 'stage-branch-admin-Dsonar.projectName=GD-admin-Dsonar.language=ts-Dsonar.sources=/home/jenkins/workspace/stage-branch-admin/dist/app-admin/-Dsonar.tests=/home/jenkins/workspace/stage-branch-admin/dist/app-admin/' 19:28:41.942 DEBUG: GET 404 http://localhost:9000/api/settings/values.protobuf?component=stage-branch-admin-Dsonar.projectName%3DGD-admin-Dsonar.language%3Dts-Dsonar.sources%3D%2Fhome%2Fjenkins%2Fworkspace%2Fstage-branch-admin%2Fdist%2Fapp-admin%2F-Dsonar.tests%3D%2Fhome%2Fjenkins%2Fworkspace%2Fstage-branch-admin%2Fdist%2Fapp-admin%2F | time=10ms 19:28:42.036 DEBUG: Available languages: 19:28:42.036 DEBUG: * Python => "py" 19:28:42.036 DEBUG: * CSS => "css" 19:28:42.037 DEBUG: * Go => "go" 19:28:42.037 DEBUG: * Kotlin => "kotlin" 19:28:42.037 DEBUG: * JavaScript => "js" 19:28:42.037 DEBUG: * TypeScript => "ts" 19:28:42.037 DEBUG: * Ruby => "ruby" 19:28:42.037 DEBUG: * Scala => "scala" 19:28:42.037 DEBUG: * C# => "cs" 19:28:42.037 DEBUG: * Java => "java" 19:28:42.037 DEBUG: * HTML => "web" 19:28:42.037 DEBUG: * JSP => "jsp" 19:28:42.037 DEBUG: * Flex => "flex" 19:28:42.037 DEBUG: * XML => "xml" 19:28:42.037 DEBUG: * PHP => "php" 19:28:42.037 DEBUG: * VB.NET => "vbnet" 19:28:42.042 INFO: Load quality profiles 19:28:42.052 DEBUG: GET 404 http://localhost:9000/api/qualityprofiles/search.protobuf?project=stage-branch-admin-Dsonar.projectName%3DGD-admin-Dsonar.language%3Dts-Dsonar.sources%3D%2Fhome%2Fjenkins%2Fworkspace%2Fstage-branch-admin%2Fdist%2Fapp-admin%2F-Dsonar.tests%3D%2Fhome%2Fjenkins%2Fworkspace%2Fstage-branch-admin%2Fdist%2Fapp-admin%2F | time=9ms 19:28:42.073 DEBUG: GET 200 http://localhost:9000/api/qualityprofiles/search.protobuf?defaults=true | time=20ms 19:28:42.091 INFO: Load quality profiles (done) | time=49ms 19:28:42.098 INFO: Auto-configuring with CI 'Jenkins'


My sonar properties..

sh "${SONARSCANNER_HOME}/bin/sonar-scanner -e -X -Dsonar.projectKey=$JOB_NAME -Dsonar.projectName=GD-admin-Dsonar.language=ts -Dsonar.sources=/home/jenkins/workspace/stage-branch-admin/dist/app-admin/ -Dsonar.tests=/home/jenkins/workspace/stage-branch-admin/dist/app-admin/ -Dsonar.exclusions=src/assets/,src/app/client/src/assets/,src/thidparty/,src/app/modules/offline/,src/app/client/src//*.spec.ts,src/app/client/src//.spec.data.ts,src/app/client/src/**/.module.ts"

The same i am able to run on jenkins terminal mode and upload it to sonar dashboard using sonar-scanner comment but not able to do it on jenkins pipeline...

Please help me to solve this...

mail2ganeshcse avatar Dec 05 '20 19:12 mail2ganeshcse