Docker Community Forums

Share and learn in the Docker community.

Docker Sonar + Maven Project + Artifact Sonar-maven-plugin

Docker : the lastest
Docker up and accessible: local with port 9000
Mvn command : -X -e sonar:sonar -Dsonar.projectKey=xxx -Dsonar.host.url=http localhost:9000 -Dsonar.login=xxx

Message Error from maven : Unable to execute SonarQube: Fail to get bootstrap index from server: timeout: Read timed out

Neither Zscaler nor Firewall running.

Thanks a lot for your support

Log:

Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: C:\IDE\JetBrains\IntelliJ IDEA\Community2020.2\plugins\maven\lib\maven3
Java version: 11.0.8, vendor: AdoptOpenJDK, runtime: C:\Tools\Java\JDK\AdoptOpenJDK\jdk110810hs
Default locale: en_US, platform encoding: UTF-8
OS name: “windows 10”, version: “10.0”, arch: “amd64”, family: “windows”
[…]
[DEBUG] 13:03:26.397 keyStore is :
[DEBUG] 13:03:26.399 keyStore type is : pkcs12
[DEBUG] 13:03:26.399 keyStore provider is :
[DEBUG] 13:03:26.400 init keystore
[DEBUG] 13:03:26.400 init keymanager of type SunX509
[DEBUG] 13:03:26.467 Create: C:\Users*.sonar\cache
[INFO] 13:03:26.468 User cache: C:\Users*
.sonar\cache
[DEBUG] 13:03:26.468 Create: C:\Users****.sonar\cache_tmp
[DEBUG] 13:03:26.470 Extract sonar-scanner-api-batch in temp…
[DEBUG] 13:03:26.475 Get bootstrap index…
[DEBUG] 13:03:26.475 Download: http localhost:9000/batch/index
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 05:01 min
[INFO] Finished at: 2020-09-01T13:08:26+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar (default-cli) on project commons: Unable to execute SonarQube: Fail to get bootstrap index from server: timeout: Read timed out -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar (default-cli) on project commons: Unable to execute SonarQube
Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to execute SonarQube
Caused by: java.lang.IllegalStateException: Fail to get bootstrap index from server
Caused by: java.net.SocketTimeoutException: timeout
Caused by: java.net.SocketTimeoutException: Read timed out

[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

It is possible to manually release the JAR file into GitHub. This is done by logging into GitHub, going to “https://github.com/ministryofjustice/container-check-sonar-plugin/releases” and following the screens which follow from “Draft a new release”.

Maven (git-release-plugin)
Alternatively, and following the example used in the dependency-check plugin (https://github.com/dependency-check/dependency-check-sonar-plugin), it is possible to upload and tag the release directly though a configured maven plugin with this maven command. It is necessary to create a personal access token (PAT) with “repo” and “admin:org” permissions. PATs are necessary because of the multi-factor authentication required by HMPPS and are required by clients which use the GitHub API. See https://github.com/settings/tokens to start. SSO must be enabled on these tokens. The version nmber applied in the release will the version defined in the pom.

mvn de.jutzig:github-release-plugin:1.4.0:release -Dusername=[username] -Dpassword=[Personal Access Token]

Thanks for your reply, let me digest your information.
i let you know whatever the result

Hi Thanks again for your answer.
But after checking, i don’t see how it can help me to fix the issue i am having:
Docker Sonar usage in local then Maven project + Sonar Scanner library as build plugin dependency.

it sounds a network communication.
org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar (default-cli) on project commons: Unable to execute SonarQube
Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to execute SonarQube
Caused by: java.lang.IllegalStateException: Fail to get bootstrap index from server
Caused by: java.net.SocketTimeoutException: timeout
Caused by: java.net.SocketTimeoutException: Read timed out

manually i can see the response of http://localhost:9000/batch/index.

Error message is : Unable to execute SonarQube: Fail to get bootstrap index from server: timeout: Read timed out -> [Help 1]