Error during sonarqube scanner execution

Hello, I'm testing the coverage of an angular-cli proyect. After assigning the sonar.ts.lcov.reportpath param and executing sonar scanner I get an InvalidPathException. 19:46:19.522 ERROR: Erro...

Brill, thanks — same/close enough to my eventual test environment that I’m pretty happy with the fix. So the exclamation mark shouldn’t matter (there’s logic in the LCOV parser now to split the path on exclamation marks if it fails to resolve the first time), but the process is basically:

  • Try and find the file in the analysis set that the SF line refers to
  • If it doesn’t map to anything, and it contains an exclamation mark then split on that and try the second half of the line

On Linux that works fine, because the path when taken as a whole is not going to be real but at least valid, in terms of the file system (/path/to/angular.js!/path/to/something/else/real). On Windows the equivalent string isn’t even a valid path, since it has two colons in it so it detonates on the first check.

If you’re capable of building the project you’re welcome to build off the issue86 branch which should have a fix for you, otherwise it’ll need to wait until I do a bit of merging and figure out how the heck to refer to the next version without going 1.0 on it (since I was saving that for when the configuration options are all tidied up, as it’ll be a horribly breaking change o/)

Problem scenario
You run sonar-scanner from the command line.  You receive an error such as this:  «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.64»

What should you do?

Possible solution #1
Is the sonar-project.properties file in the directory from which you ran sonar-scanner?  This command expects this file to be in that directory.

Possible solution #2
Does the user that ran sonar-scanner have permissions to read sonar-project.properties?  This file needs to be readable.  You may need to use sudo before the sonar-scanner command or log in as a different user.

Possible solution #3
Does the sonar-project.properties file have a sonar.sources stanza?  If so is there a subdirectory that is at the same level as sonar-project.properties with the name assigned by the sonar.sources stanza?

If you see «sonar.sources=foobar», you would need a subdirectory named «foobar» in the directory with the sonar-project.properties file?


Jun
04
2020

Suddenly “Error during SonarQube Scanner execution” began to appear during at the end of Jenkins build. The full text in Jenkins console output looks like this:

ERROR: Error during SonarQube Scanner execution

ERROR: Unable to load component class org.sonar.scanner.bootstrap.ScannerPluginInstaller

ERROR: Caused by: Unable to load component class org.sonar.home.cache.FileCache

ERROR: Caused by: Unable to load component class org.sonar.scanner.bootstrap.GlobalConfiguration

ERROR: Caused by: Error 500 on http://10.10.10.10:9000/api/settings/values.protobuf : {«errors»:[{«msg»:»An error has occurred. Please contact your administrator»}]}

ERROR:

ERROR: Rerun SonarQube Scanner using the X switch to enable full debug logging.

ERROR: SonarQube scanner exited with nonzero code: 1

Finished: FAILURE

Luckily, the problem was not very deep and discovered upon checking web.log file in SonarQube logs directory:

2020.06.04 17:20:16 ERROR web[AW8D9ctV+v22HSbMAFCY][o.s.s.w.WebServiceEngine] Fail to process request http://10.10.10.10:9000/api/settings/values.protobuf

org.apache.ibatis.exceptions.PersistenceException:

### Error querying database.  Cause: java.sql.SQLException: ORA-28001: the password has expired

### The error may exist in org.sonar.db.property.PropertiesMapper

### The error may involve org.sonar.db.property.PropertiesMapper.selectByKeys

### The error occurred while executing a query

### Cause: java.sql.SQLException: ORA-28001: the password has expired

How to reset/renew Oracle DB password and manage policies read here

Want me to do this for you? Drop me a line: itgalaxyzzz {at} gmail [point] com

Я пытаюсь бежать sonar-scannerНо, похоже, на изображении есть некоторые проблемы.

исключение в журнале анализа

NB: эта команда отлично работает с другим проектом

Анализ журнала:

E:wamp64wwwEcco_Last>sonar-scanner C:sonar-scannerbin..
INFO: Scanner configuration file: C:sonar-scannerbin..confsonar-scanner.pro perties
INFO: Project root configuration file: E:wamp64wwwEcco_Lastsonar-project.properties
INFO: SonarQube Scanner 2.8
INFO: Java 1.8.0_91 Oracle Corporation (64-bit)
INFO: Windows 7 6.1 amd64
INFO: User cache: C:UsersALTEN.sonarcache
INFO: Load global repositories
INFO: Load global repositories (done) | time=118ms WARN: Property 'sonar.jdbc.url' is not supported any more. It will be ignored. There
is no longer any DB connection to the SQ database.
INFO: User cache: C:UsersALTEN.sonarcache
INFO: Load plugins index
INFO: Load plugins index (done) | time=8ms
INFO: SonarQube server 5.6.6
INFO: Default locale: "fr_FR", source code encoding: "UTF-8"INFO: Process project properties
INFO: Load project repositories
INFO: Load project repositories (done) | time=17ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=29ms
INFO: Load active rules
INFO: Load active rules (done) | time=553ms
INFO: Publish mode
INFO: -------------  Scan Ecco_Last
INFO: Language is forced to php
INFO: Load server rules
INFO: Load server rules (done) | time=201ms
INFO: Base dir: E:wamp64wwwEcco_Last
INFO: Working dir: E:wamp64wwwEcco_Last.sonar
INFO: Source paths: application
INFO: Source encoding: UTF-8, default locale: fr_FR
INFO: Index files
WARN: Invalid character encountered in file E:wamp64wwwEcco_LastapplicationmodulesmigrationfaicontrollerLivraisonController.php at line 65 for encoding UTF-8. Please fix file content or configure the encoding to be used using proper ty 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file E:wamp64wwwEcco_LastapplicationmodulesoptionsmodelBonus.php at line 139 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: 644 files indexed
INFO: Quality profile for php: Sonar way
INFO: JaCoCoSensor: JaCoCo report not found : E:wamp64wwwEcco_Lasttargetjac oco.exec
INFO: JaCoCoItSensor: JaCoCo IT report not found: E:wamp64wwwEcco_Lasttargetjacoco-it.exec
INFO: Sensor Lines Sensor
INFO: Sensor Lines Sensor (done) | time=188ms
INFO: Sensor NoSonar Sensor
INFO: Sensor NoSonar Sensor (done) | time=664ms
INFO: Sensor SCM Sensor
INFO: SCM provider for this project is: svn
INFO: 644 files to be analyzed
INFO: 0/644
files analyzed INFO:
------------------------------------------------------------------------
INFO: EXECUTION FAILURE INFO:
------------------------------------------------------------------------
INFO: Total time: 12.188s
INFO: Final Memory: 45M/233M INFO:
------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution java.lang.IllegalStateException: Error when executing blame for file application /Bootstrap.php
at org.sonar.plugins.scm.svn.SvnBlameCommand.blame(SvnBlameCommand.java: 102)
at org.sonar.plugins.scm.svn.SvnBlameCommand.blame(SvnBlameCommand.java: 59)
at org.sonar.batch.scm.ScmSensor.execute(ScmSensor.java:86)
at org.sonar.batch.sensor.SensorWrapper.analyse(SensorWrapper.java:57)
at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor. java:58)
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:50)
at org.sonar.batch.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:83)
at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:192)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:241)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:236)
at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:226)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
at org.sonar.batch.task.ScanTask.execute(ScanTask.java:47)
at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:106)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:62)
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:233)
at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:110)
at org.sonarsource.scanner.cli.Main.execute(Main.java:74)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: org.tmatesoft.svn.core.SVNException: svn: E175002: unknown host svn: E175002: OPTIONS request failed on '/svn/ecco/ecco/trunk/application/Bootst rap.php'
at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:106)
at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:90)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:798)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:398)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:386)
at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.performHttpRequest(DAVConnection.java:863)
at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.exchangeCapabilities(DAVConnection.java:699)
at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.open(DAVConnection.java:118)
at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.openConnection(DAVRepository.java:1049)
at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.hasCapability(DAVRepository.java:877)
at org.tmatesoft.svn.core.io.SVNRepository.assertServerIsMergeInfoCapable(SVNRepository.java:787)
at org.tmatesoft.svn.core.io.SVNRepository.getFileRevisions(SVNRepository.java:756)
at org.tmatesoft.svn.core.internal.wc2.remote.SvnRemoteAnnotate.run(SvnRemoteAnnotate.java:111)
at org.tmatesoft.svn.core.internal.wc2.remote.SvnRemoteAnnotate.run(SvnRemoteAnnotate.java:35)
at org.tmatesoft.svn.core.internal.wc2.SvnOperationRunner.run(SvnOperationRunner.java:21)
at org.tmatesoft.svn.core.wc2.SvnOperationFactory.run(SvnOperationFactory.java:1235)
at org.tmatesoft.svn.core.wc2.SvnOperation.run(SvnOperation.java:294)
at org.tmatesoft.svn.core.wc.SVNLogClient.doAnnotate(SVNLogClient.java:295)
at org.sonar.plugins.scm.svn.SvnBlameCommand.blame(SvnBlameCommand.java:100)
... 32 more
Caused by: java.net.UnknownHostException: redmine.dev.dolmen.bouyguestelecom.fr
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
at java.net.InetAddress.getAllByName0(InetAddress.java:1276)
at java.net.InetAddress.getAllByName(InetAddress.java:1192)
at java.net.InetAddress.getAllByName(InetAddress.java:1126)
at java.net.InetAddress.getByName(InetAddress.java:1076)
at org.tmatesoft.svn.core.internal.util.SVNSocketFactory.createAddres(SVNSocketFactory.java:189)
at org.tmatesoft.svn.core.internal.util.SVNSocketFactory.createPlainSocket(SVNSocketFactory.java:66)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.connect(HTTPConnection.java:282)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:461)
... 48 more
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging
.

E:wamp64wwwEcco_Last>

0

Решение

Эта ошибка анализа была вызвана тем, что клиент SVN на сервере анализа не смог связаться с вашим сервером SVN:

UnknownHostException: redmine.dev.dolmen.bouyguestelecom.fr

Вы сказали, что анализ работал над другим проектом. Возможно, этот проект находится на другом сервере SCM или был проанализирован из другой коробки. Тем не менее, вам нужно либо устранить проблему с сетью или конфигурацией, вызвавшую этот сбой связи, либо отключить получение данных об обвинениях для этого проекта: Администрирование> Общие параметры> SCM> Отключить датчик SCM

0

Другие решения

Других решений пока нет …

Internet Explorer access to certificates

https://sylvainleroy.com/wp-admin/options-general.php?page=ad-inserter.php#tab-2

Struggling with SonarQube scanner and your invalid SSL certificate ? Here is a way to handle it.

Issue with SonarQube scanner

The SonarQube Scanner is NOT supporting invalid certificates and unfortunately our SonarQube server is delivered with an invalid SSL certificate.

INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 0.504s
INFO: Final Memory: 4M/123M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
ERROR: Unable to execute SonarQube
ERROR: Caused by: Fail to get bootstrap index from server
ERROR: Caused by: sun.security.validator.ValidatorException: PKIX path building
failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to fi
nd valid certification path to requested target
ERROR: Caused by: PKIX path building failed: sun.security.provider.certpath.SunC
ertPathBuilderException: unable to find valid certification path to requested ta
rget
ERROR: Caused by: unable to find valid certification path to requested target
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging
.

To circumvent this error, you will have to upload all certificates in your cacerts.

Solution

Here are the steps to load your certificates : 

  • Download portecle, a software to handle Java keystores : http://portecle.sourceforge.net/
  • Download the latest version of http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html
  • Download the SonarRunner installation
  • Unzip the files into the jre/lib/security of the SonarRunner installation, overwrite the existing ones.

policy

  • Unzip the files into the jre/lib/security of the SonarRunner installation, overwrite the exisiting ones.
  • Open the file jre/lib/security/cacerts using portecle (default password is changeit)
  • Download your own certificate using your browser and obtain a .cer or pkx certificate.

    ie

    Internet Explorer access to certificates

    Понравилась статья? Поделить с друзьями:
  • Error during servletcontainerinitializer processing
  • Error during script activation error attempt to call a nil value cheat engine
  • Error during rendering daz studio
  • Error during processing error message
  • Error during pre loading phase