Je suis en train d'essayer de scanner le code rapide dans Sonarqube. Nous avons un proxy et je crois que c'est la cause première de cette erreur.Analyseur de sonar dans l'analyse d'échec de Mac
J'ai défini les variables d'environnement http_proxy, https_proxy et no_proxy dans ~/.bash_profile dans la machine mac.
J'ai projet d'installation et un scanner sonar dans le nœud Mac (via Jenkins)
iOS construction de projet fonctionne bien.
Lorsque l'analyse du sonar s'exécute, j'obtiens cette erreur. Une idée de pourquoi cela se produit?
16:53:39 Unpacking https://repo1.maven.org/maven2/org/sonarsource/scanner/cli/sonar-scanner-cli/3.0.3.778/sonar-scanner-cli-3.0.3.778.zip to /Users/jenkins/home/jenkinsdata/tools/hudson.plugins.sonar.SonarRunnerInstallation/SonarqubeScanner on Mac-Agent
16:53:39 ERROR: Failed to download https://repo1.maven.org/maven2/org/sonarsource/scanner/cli/sonar-scanner-cli/3.0.3.778/sonar-scanner-cli-3.0.3.778.zip from agent; will retry from master
16:53:39 java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 407 Proxy Authentication Required"
16:53:39 at sun.net.www.protocol.http.HttpURLConnection.doTunneling(HttpURLConnection.java:2124)
16:53:39 at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:183)
16:53:39 at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1546)
16:53:39 at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
16:53:39 at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
16:53:39 at java.net.URL.openStream(URL.java:1045)
16:53:39 at hudson.FilePath$Unpack.invoke(FilePath.java:867)
16:53:39 at hudson.FilePath$Unpack.invoke(FilePath.java:861)
16:53:39 at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2750)
16:53:39 at hudson.remoting.UserRequest.perform(UserRequest.java:153)
16:53:39 at hudson.remoting.UserRequest.perform(UserRequest.java:50)
16:53:39 at hudson.remoting.Request$2.run(Request.java:336)
16:53:39 at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
16:53:39 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
16:53:39 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
16:53:39 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
16:53:39 at hudson.remoting.Engine$1$1.run(Engine.java:94)
16:53:39 at java.lang.Thread.run(Thread.java:748)
16:53:39 at ......remote call to JNLP4-connect connection from macHost/macHost:49506(Native Method)
16:53:39 at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1554)
16:53:39 at hudson.remoting.UserResponse.retrieve(UserRequest.java:281)
16:53:39 at hudson.remoting.Channel.call(Channel.java:839)
16:53:39 at hudson.FilePath.act(FilePath.java:987)
16:53:39 Caused: java.io.IOException: remote file operation failed: /Users/jenkins/home/jenkinsdata/tools/hudson.plugins.sonar.SonarRunnerInstallation/SonarqubeScanner at [email protected]:JNLP4-connect connection from macHost/macHost:49506
16:53:39 at hudson.FilePath.act(FilePath.java:994)
16:53:39 at hudson.FilePath.act(FilePath.java:976)
16:53:39 at hudson.FilePath.installIfNecessaryFrom(FilePath.java:831)
16:53:39 at hudson.FilePath.installIfNecessaryFrom(FilePath.java:764)
16:53:39 at hudson.tools.DownloadFromUrlInstaller.performInstallation(DownloadFromUrlInstaller.java:77)
16:53:39 at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:72)
16:53:39 at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:109)
16:53:39 at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:206)
16:53:39 at hudson.plugins.sonar.SonarRunnerInstallation.forNode(SonarRunnerInstallation.java:104)
16:53:39 at hudson.plugins.sonar.SonarRunnerInstallation.forNode(SonarRunnerInstallation.java:62)
16:53:39 at hudson.plugins.sonar.utils.BuilderUtils.getBuildTool(BuilderUtils.java:70)
16:53:39 at hudson.plugins.sonar.SonarRunnerBuilder.perform(SonarRunnerBuilder.java:279)
16:53:39 at hudson.plugins.sonar.SonarRunnerBuilder.perform(SonarRunnerBuilder.java:261)
16:53:39 at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
16:53:39 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:736)
16:53:39 at hudson.model.Build$BuildExecution.build(Build.java:206)
16:53:39 at hudson.model.Build$BuildExecution.doRun(Build.java:163)
16:53:39 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:496)
16:53:39 at hudson.model.Run.execute(Run.java:1737)
16:53:39 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
16:53:39 at hudson.model.ResourceController.execute(ResourceController.java:97)
16:53:39 at hudson.model.Executor.run(Executor.java:419)
Mise à jour 1
I ajouté à la liste ordinateur Mac no_proxy Jenkins. Maintenant, l'erreur ci-dessus est parti, mais obtenir cette erreur ci-dessous.
J'ai ouvert le serveur sonarqube dans un navigateur et testé en utilisant curl comme curl sonarqubeserverIP: 9000 et les deux fonctionne bien.
Je suis capable de faire de l'analyse pour d'autres projets à partir de machines Windows et Linux sur le même serveur.
09:51:24 INFO: SonarQube Scanner 3.0.3.778
09:51:24 INFO: Java 1.8.0_144 Oracle Corporation (64-bit)
09:51:24 INFO: Mac OS X 10.12.6 x86_64
09:51:24 INFO: User cache: /Users/jenkins/.sonar/cache
09:51:24 ERROR: SonarQube server [http://SonarserverIP:9000] can not be reached
09:51:24 INFO: ------------------------------------------------------------------------
09:51:24 INFO: EXECUTION FAILURE
09:51:24 INFO: ------------------------------------------------------------------------
09:51:24 INFO: Total time: 0.411s
09:51:24 INFO: Final Memory: 4M/245M
09:51:24 INFO: ------------------------------------------------------------------------
09:51:24 ERROR: Error during SonarQube Scanner execution
09:51:24 org.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarQube
09:51:24 at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory$1.run(IsolatedLauncherFactory.java:84)
09:51:24 at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory$1.run(IsolatedLauncherFactory.java:71)
09:51:24 at java.security.AccessController.doPrivileged(Native Method)
09:51:24 at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:71)
09:51:24 at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:67)
09:51:24 at org.sonarsource.scanner.api.EmbeddedScanner.doStart(EmbeddedScanner.java:218)
09:51:24 at org.sonarsource.scanner.api.EmbeddedScanner.start(EmbeddedScanner.java:156)
09:51:24 at org.sonarsource.scanner.cli.Main.execute(Main.java:74)
09:51:24 at org.sonarsource.scanner.cli.Main.main(Main.java:61)
09:51:24 Caused by: java.lang.IllegalStateException: Fail to get bootstrap index from server
09:51:24 at org.sonarsource.scanner.api.internal.Jars.getBootstrapIndex(Jars.java:100)
09:51:24 at org.sonarsource.scanner.api.internal.Jars.getScannerEngineFiles(Jars.java:76)
09:51:24 at org.sonarsource.scanner.api.internal.Jars.download(Jars.java:70)
09:51:24 at org.sonarsource.scanner.api.internal.JarDownloader.download(JarDownloader.java:39)
09:51:24 at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory$1.run(IsolatedLauncherFactory.java:75)
09:51:24 ... 8 more
09:51:24 Caused by: java.lang.IllegalStateException: Status returned by url [http://SonarserverIP:9000/batch/index] is not valid: [403]
09:51:24 at org.sonarsource.scanner.api.internal.ServerConnection.callUrl(ServerConnection.java:115)
09:51:24 at org.sonarsource.scanner.api.internal.ServerConnection.downloadString(ServerConnection.java:98)
09:51:24 at org.sonarsource.scanner.api.internal.Jars.getBootstrapIndex(Jars.java:96)
09:51:24 ... 12 more
09:51:24 ERROR:
09:51:24 ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
Merci d'avance.
Merci. Cependant, j'ai déjà fait cette configuration sur jenkins et cela fonctionne pour toutes les machines basées sur Linux et Windows. Maintenant, j'ai ajouté ce noeud mac à la liste d'hôtes no_proxy dans jenkins et l'erreur originale est partie. S'il vous plaît voir ma mise à jour 1. – VVP