ERROR: Error during SonarScanner execution java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 1024 - sonarqube

I am not able to figure out what is wrong with the sonar-scanner cli in my AWS CodeBuild container. It was working perfectly fine and stopped working all of sudden. I have searched for the exception and don't seem to figure out what is wrong with code. When I check the sonar project, it is not showing any analysis at all. Which means its failing locally does not event reach sonar server. I have checked this and many others but not able to figure out the problem. The Following is the error:
[Container] 2022/06/29 12:49:26 Running command echo $(sonar-scanner -Dsonar.projectKey=$sonar_project_key -Dsonar.sources=$CODEBUILD_SRC_DIR -Dsonar.host.url=$sonar_host_url -Dsonar.login=$sonar_login)
ERROR: Error during SonarScanner execution
java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 1024
at org.yaml.snakeyaml.reader.StreamReader.peek(StreamReader.java:136)
at org.yaml.snakeyaml.scanner.ScannerImpl.scanToNextToken(ScannerImpl.java:1222)
at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:308)
at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:248)
at org.yaml.snakeyaml.parser.ParserImpl$ParseIndentlessSequenceEntryKey.produce(ParserImpl.java:587)
at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:165)
at org.yaml.snakeyaml.Yaml$3.hasNext(Yaml.java:677)
at java.base/java.lang.Iterable.forEach(Unknown Source)
at com.github.sbaudoin.yamllint.Linter.getSyntaxError(Linter.java:378)
at com.github.sbaudoin.yamllint.Linter.getSyntaxError(Linter.java:365)
at com.github.sbaudoin.sonar.plugins.yaml.checks.YamlSourceCode.<init>(YamlSourceCode.java:56)
at com.github.sbaudoin.sonar.plugins.yaml.rules.YamlSensor.execute(YamlSensor.java:111)
at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:59)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:77)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:59)
at org.sonar.scanner.scan.SpringModuleScanContainer.doAfterStart(SpringModuleScanContainer.java:81)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
at org.sonar.scanner.scan.SpringProjectScanContainer.scan(SpringProjectScanContainer.java:392)
at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:388)
at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:357)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:135)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
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:189)
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
Please help me understand what I am doing wrong or if you need more information.

Found the problem: Sonar cli throws this error when file is too large. To be honest, the file wasn't even that large. It was a 2K line cloudformation template. But I can scan it with cfn_nag, no need of sonar.

Related

Getting Error while Scanning a Java project in SonarScanner

ERROR: Error during SonarScanner execution
org.sonar.java.AnalysisException: Your project contains .java files, please provide compiled classes with sonar.java.binaries property, or exclude them from the analysis with sonar.exclusions property.
at org.sonar.java.classpath.ClasspathForMain.init(ClasspathForMain.java:75)
at org.sonar.java.classpath.AbstractClasspath.getElements(AbstractClasspath.java:317)
at org.sonar.java.SonarComponents.getJavaClasspath(SonarComponents.java:175)
at org.sonar.java.JavaFrontend.<init>(JavaFrontend.java:88)
at org.sonar.plugins.java.JavaSensor.execute(JavaSensor.java:108)
at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:59)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:77)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:59)
at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:79)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:382)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:378)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:347)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:136)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
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:189)
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
The error message is very specific. Is there something about that error message that you don't understand?
The SonarQube scan is typically done during a build, after the source files are compiled to class files, so they are available in the same workspace.

ERROR: Error during SonarScanner execution java.lang.IllegalArgumentException: Line xx is out of range for file IService.cs. File has xx lines

I am trying to use SonarScanner to scan and analysis my project C# source code. I can build all my projects without error. I have run all these commands successfully.
dotnet tool install --global dotnet-sonarscanner
dotnet sonarscanner begin /k:"test"
/d:sonar.host.url="http://localhost:9000" /d:sonar.login="token"
dotnet build
But when I run the last command below, it got an error
dotnet sonarscanner end /d:sonar.login="51bae4230d438e567f84b8310f129938c73dd3f2"
This is the error message:
ERROR: Error during SonarScanner execution INFO:
------------------------------------------------------------------------ java.lang.IllegalArgumentException: Line 15 is out of range for file
xx/IService.cs. File has 14 lines.
at org.sonar.api.utils.Preconditions.checkArgument(Preconditions.java:43)
at org.sonar.scanner.DefaultFileLinesContext.checkLineRange(DefaultFileLinesContext.java:63)
at org.sonar.scanner.DefaultFileLinesContext.setIntValue(DefaultFileLinesContext.java:56)
at org.sonarsource.dotnet.shared.plugins.protobuf.MetricsImporter.consumeFor(MetricsImporter.java:66)
at org.sonarsource.dotnet.shared.plugins.protobuf.MetricsImporter.consumeFor(MetricsImporter.java:38)
at org.sonarsource.dotnet.shared.plugins.protobuf.ProtobufImporter.consume(ProtobufImporter.java:73)
at org.sonarsource.dotnet.shared.plugins.protobuf.RawProtobufImporter.accept(RawProtobufImporter.java:49)
at org.sonarsource.dotnet.shared.plugins.ProtobufDataImporter.parseProtobuf(ProtobufDataImporter.java:97)
at org.sonarsource.dotnet.shared.plugins.ProtobufDataImporter.importResults(ProtobufDataImporter.java:72)
at org.sonarsource.dotnet.shared.plugins.DotNetSensor.importResults(DotNetSensor.java:101)
at org.sonarsource.dotnet.shared.plugins.DotNetSensor.execute(DotNetSensor.java:81)
at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
at org.sonar.scanner.sensor.ProjectSensorsExecutor.execute(ProjectSensorsExecutor.java:49)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:360)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:150)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
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:189)
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
at org.sonarsource.scanner.cli.Main.main(Main.java:61) ERROR: The SonarScanner did not complete successfully 14:43:25.558
Post-processing failed. Exit code: 1
I went to check IService.cs, it is 14 lines and see no issue there. In fact, as mentioned, I can build all my projects without error.
This is most similar issue I can find:
SonarQube analyses issue Line is out of range for
Basically you are looking any hidden character in the file

Taurus Execution failure via yaml scripts for jmeter jmx scripts behind proxy

I am trying to execute some jmeter jmx scripts using Tarus via yaml scripts named "ParallelExecution.yml".
Yaml Script:
execution:
- executor: jmeter
execution:
- scenario:
script: C:\Users\SampleScripts\WSO2ServiceAPI.jmx
- scenario:
script: C:\Users\SampleScripts\KongServiceAPI.jmx
reporting:
- module: blazemeter
report-name: TaurusPerformanceTest
test: WSO2andKong
project: SampleProject
But, its fetching the following error after I execute the command "bzt ParallelExecution.yml -report".
C:\Users\YmlScripts>bzt ParallelExecution.yml
12:38:28 INFO: Taurus CLI Tool v1.13.8
12:38:28 INFO: Starting with configs: ['ParallelExecution.yml']
12:38:28 INFO: Configuring...
12:38:28 INFO: Artifacts dir: C:\Users\YmlScripts\2019-11-09_12-38-28.188921
12:38:28 INFO: Preparing...
12:38:28 WARNING: Failed to check for updates
12:38:29 INFO: 1 obsolete CookieManagers are found and fixed
12:38:36 WARNING: Failed to detect plugins for C:\Users\SampleScripts\modified_WSO2ServiceAPI.jmx: Command '['C:\\Users\\.bzt\\jmeter-taurus\\5.1.1\\bin\\PluginsManagerCMD.bat', 'install-for-jmx', 'C:\\Users\\SampleScripts\\modified_WSO2ServiceAPI.jmx']' returned non-zero exit status 1.
>>> START OF STDOUT >>>
2019-11-09 12:38:31,632 INFO o.j.r.PluginManagerCMD: Command is: install-for-jmx
2019-11-09 12:38:32,697 INFO o.j.r.JARSourceHTTP: Requesting https://jmeter-plugins.org/repo/?installID=docker-64602d8e8eb9f2a1a3b0804261cdb5e6-nongui
<<< END OF STDOUT <<<
>>> START OF STDERR >>>
ERROR: java.lang.RuntimeException: Failed to perform cmdline operation: jmeter-plugins.org
*** Problem's technical details go below ***
Home directory was detected as: C:\Users\.bzt\jmeter-taurus\5.1.1\lib
Exception in thread "main" java.lang.RuntimeException: Failed to perform cmdline operation: jmeter-plugins.org
at org.jmeterplugins.repository.PluginManagerCMD.processParams(PluginManagerCMD.java:100)
at kg.apc.cmdtools.PluginsCMD.processParams(PluginsCMD.java:62)
at kg.apc.cmdtools.PluginsCMD.processParams(PluginsCMD.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at kg.apc.cmd.UniversalRunner.main(UniversalRunner.java:115)
Caused by: java.net.UnknownHostException: jmeter-plugins.org
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$2.lookupAllHostAddr(Unknown Source)
at java.net.InetAddress.getAddressesFromNameService(Unknown Source)
at java.net.InetAddress.getAllByName0(Unknown Source)
at java.net.InetAddress.getAllByName(Unknown Source)
at java.net.InetAddress.getAllByName(Unknown Source)
at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.resolveHostname(DefaultClientConnectionOperator.java:263)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:162)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:326)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:605)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:440)
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
at org.jmeterplugins.repository.JARSourceHTTP.execute(JARSourceHTTP.java:499)
at org.jmeterplugins.repository.JARSourceHTTP.execute(JARSourceHTTP.java:494)
at org.jmeterplugins.repository.JARSourceHTTP.getJSON(JARSourceHTTP.java:152)
at org.jmeterplugins.repository.JARSourceHTTP.getRepositories(JARSourceHTTP.java:276)
at org.jmeterplugins.repository.JARSourceHTTP.getRepo(JARSourceHTTP.java:304)
at org.jmeterplugins.repository.PluginManager.load(PluginManager.java:71)
at org.jmeterplugins.repository.PluginManagerCMD.getPluginsManager(PluginManagerCMD.java:110)
at org.jmeterplugins.repository.PluginManagerCMD.installPluginsForJmx(PluginManagerCMD.java:120)
at org.jmeterplugins.repository.PluginManagerCMD.processParams(PluginManagerCMD.java:79)
... 7 more
<<< END OF STDERR <<<
12:38:36 INFO: 1 obsolete CookieManagers are found and fixed
12:38:46 WARNING: Failed to detect plugins for C:\Users\SampleScripts\modified_KongServiceAPI.jmx: Command '['C:\\Users\\.bzt\\jmeter-taurus\\5.1.1\\bin\\PluginsManagerCMD.bat', 'install-for-jmx', 'C:\\Users\\SampleScripts\\modified_KongServiceAPI.jmx']' returned non-zero exit status 1.
>>> START OF STDOUT >>>
2019-11-09 12:38:39,605 INFO o.j.r.PluginManagerCMD: Command is: install-for-jmx
2019-11-09 12:38:42,035 INFO o.j.r.JARSourceHTTP: Requesting https://jmeter-plugins.org/repo/?installID=docker-64602d8e8eb9f2a1a3b0804261cdb5e6-nongui
<<< END OF STDOUT <<<
>>> START OF STDERR >>>
ERROR: java.lang.RuntimeException: Failed to perform cmdline operation: jmeter-plugins.org
*** Problem's technical details go below ***
Home directory was detected as: C:\Users\.bzt\jmeter-taurus\5.1.1\lib
Exception in thread "main" java.lang.RuntimeException: Failed to perform cmdline operation: jmeter-plugins.org
at org.jmeterplugins.repository.PluginManagerCMD.processParams(PluginManagerCMD.java:100)
at kg.apc.cmdtools.PluginsCMD.processParams(PluginsCMD.java:62)
at kg.apc.cmdtools.PluginsCMD.processParams(PluginsCMD.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at kg.apc.cmd.UniversalRunner.main(UniversalRunner.java:115)
Caused by: java.net.UnknownHostException: jmeter-plugins.org
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$2.lookupAllHostAddr(Unknown Source)
at java.net.InetAddress.getAddressesFromNameService(Unknown Source)
at java.net.InetAddress.getAllByName0(Unknown Source)
at java.net.InetAddress.getAllByName(Unknown Source)
at java.net.InetAddress.getAllByName(Unknown Source)
at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.resolveHostname(DefaultClientConnectionOperator.java:263)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:162)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:326)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:605)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:440)
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
at org.jmeterplugins.repository.JARSourceHTTP.execute(JARSourceHTTP.java:499)
at org.jmeterplugins.repository.JARSourceHTTP.execute(JARSourceHTTP.java:494)
at org.jmeterplugins.repository.JARSourceHTTP.getJSON(JARSourceHTTP.java:152)
at org.jmeterplugins.repository.JARSourceHTTP.getRepositories(JARSourceHTTP.java:276)
at org.jmeterplugins.repository.JARSourceHTTP.getRepo(JARSourceHTTP.java:304)
at org.jmeterplugins.repository.PluginManager.load(PluginManager.java:71)
at org.jmeterplugins.repository.PluginManagerCMD.getPluginsManager(PluginManagerCMD.java:110)
at org.jmeterplugins.repository.PluginManagerCMD.installPluginsForJmx(PluginManagerCMD.java:120)
at org.jmeterplugins.repository.PluginManagerCMD.processParams(PluginManagerCMD.java:79)
... 7 more
<<< END OF STDERR <<<
12:38:46 WARNING: No BlazeMeter API key provided, will upload anonymously
12:38:46 ERROR: Network Error: Request to https://a.blazemeter.com/api/v4/web/version failed
12:38:46 INFO: Post-processing...
12:38:46 INFO: Test duration: 0:00:00
12:38:46 INFO: Artifacts dir: C:\Users\YmlScripts\2019-11-09_12-38-28.188921
12:38:46 WARNING: Done performing with code: 1
I am not sure why I taurus is not able to execute the script. It runs correctly as jmeter scripts via jmeter.
Any help would be highly appreticated
Looking into this line:
Caused by: java.net.UnknownHostException: jmeter-plugins.org
It appears that the underlying JMeter Plugins Manager is not able to reach JMeter Plugins backend, presumably this is due to the fact you're using corporate proxy for the internet access.
You can configure Taurus to use the proxy of your choice by adding the next lines to your YAML config file:
settings:
proxy:
address: http://localhost:8080
username: johndoe
password: secret
of course replace address, username and password with your own values. Once done - restart the test and Taurus will propagate proxy settings to the downstream JMeter. JMeter Plugins Manager respects JMeter proxy settings so you should be able to execute the test normally.
Just in case check out Plugins Manager Network Configuration page.

lock deletion issue when uploading information to Sonar server on AIX

I'm actually trying to use sonarqube 5.4 on an AIX server and I've got some errors when running the analysis.
the same configuration has been tested on Windows and it's working.
The information are stored in an Oracle database(11gr2)
At the end of the analysis, it says that a lock file can't be deleted, but when I check after this file, it's not there anymore.
I've tried to use the last version of the wrapper, but in vain.
has anyone faced the same issue?
09:58:13.581 DEBUG - POST 500
http:/foobar:9001/api/ce/submit?projectKey=IHM&projectName=IHM
| time=92ms 09:58:13.594 INFO - Analysis report generated in
/applis/swgi/produits/ictools/workdir/batch-report 09:58:13.604 DEBUG
- Couldn't delete lock file: /applis/swgi/produits/ictools/sonar-runner-2.4_IHM/bin/./.sonar_lock
java.nio.file.NoSuchFileException:
/applis/swgi/produits/ictools/sonar-runner-2.4_IHM/bin/./.sonar_lock
at
sun.nio.fs.UnixException.translateToIOException(UnixException.java:98)
at
sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:114)
at
sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:119)
at
sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:256)
at
sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:115)
at java.nio.file.Files.delete(Files.java:1137) at
org.sonar.home.cache.DirectoryLock.unlock(DirectoryLock.java:98)
ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(AccessController.java:594)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
at org.sonar.runner.api.Runner.execute(Runner.java:100)
at org.sonar.runner.Main.executeTask(Main.java:70)
at org.sonar.runner.Main.execute(Main.java:59)
at org.sonar.runner.Main.main(Main.java:53) Caused by: org.sonarqube.ws.client.HttpException: Error 500 http:/foobar:9001/api/ce/submit?projectKey=IHM&projectName=IHM
at org.sonarqube.ws.client.BaseResponse.failIfNotSuccessful(BaseResponse.java:32)
at org.sonar.batch.bootstrap.BatchWsClient.failIfUnauthorized(BatchWsClient.java:96)
at org.sonar.batch.bootstrap.BatchWsClient.call(BatchWsClient.java:67)
at org.sonar.batch.report.ReportPublisher.upload(ReportPublisher.java:158)
at org.sonar.batch.report.ReportPublisher.execute(ReportPublisher.java:117)
at org.sonar.batch.phases.PhaseExecutor.publishReportJob(PhaseExecutor.java:129)
at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:112)
at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:185)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:120)
at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:264)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:259)
at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:249)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
at org.sonar.batch.scan.ProjectScanContainer.startComponents(ProjectScanContainer.java:127)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:120)
at org.sonar.batch.task.ScanTask.execute(ScanTask.java:55)
at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:120)
at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:122)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:79)
at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:508)
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
... 9 more

Sonar Eclipse plugin: Failed to download batch_bootstrap/db

I'm having issues with the Eclipse plugin of sonar. When executing it I'm getting the following exception in the Eclipse console:
Exception in thread "main" org.sonar.runner.impl.RunnerException: Unable to execute Sonar
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.impl.BatchLauncherMain.execute(BatchLauncherMain.java:41)
at org.sonar.runner.impl.BatchLauncherMain.main(BatchLauncherMain.java:59)
Caused by: org.sonar.api.utils.HttpDownloader$HttpException: Fail to download [http://<server>/batch_bootstrap/db?project=<project>]. Response code: 500
at org.sonar.api.utils.HttpDownloader$BaseHttpDownloader$HttpInputSupplier.getInput(HttpDownloader.java:281)
at org.sonar.api.utils.HttpDownloader$BaseHttpDownloader$HttpInputSupplier.getInput(HttpDownloader.java:235)
at com.google.common.io.ByteStreams.copy(ByteStreams.java:116)
at com.google.common.io.Files.copy(Files.java:231)
at org.sonar.batch.bootstrap.ServerClient.download(ServerClient.java:69)
at org.sonar.batch.bootstrap.PreviewDatabase.downloadDatabase(PreviewDatabase.java:101)
at org.sonar.batch.bootstrap.PreviewDatabase.start(PreviewDatabase.java:69)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110)
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89)
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
at org.picocontainer.behaviors.Stored.start(Stored.java:110)
at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1015)
at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1008)
at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:766)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:91)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.bootstrapper.Batch.startBatch(Batch.java:92)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:74)
at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
... 6 more
We're running SonarQube Server 4.1.2, the plugin version is 3.3.0.
Any ideas?
Update
Could this be related to poor DB performance (even though it's not some timeout exception)? Sonar runs on an Oracle DB, and we just updated sonar which resolved issues with excessively long query times (but weirdly enough only for logged in users). I added login information in the plugin settings though, so i assumed it should work.
When opening a source file in Eclipse, I'm getting messages like
Retrieve issues of resource ResultUtil.java...
Done in 43625ms
which sounds like the query would be running way longer that desirable.
Update 2:
We realized that even though the project existed in SonarQube, and was analyzed, it was not provisioned (the project was created with a pre 4.0 version of SonarQube). To rule out that caused the issue we provisioned a new project in SonarQube, ran the analysis on that and configured the eclipse plugin to use this new project.
This did not resolve the issue, either we're getting the same exception, or no further message at all. Calling the URL in a web-browser yields the same result (i.e. endlessly says "waiting for <server>".
The "SonarQube Web Browser" view of the eclipse plugin correctly shows issues, which I take as a sign that the plugin is configured correctly. Also, for some reason querying the issues from SonarQube is now a lot faster, so I would rule out that this caused the issue.
Any more suggestions on what we could check?
Update 3
We tried restarting SonarQube and then tried to analyze the project using the eclipse plugin. This failed with the above exception. Checking the SonarQube logs revealed these issues:
2014.03.19 11:17:35 ERROR [o.s.c.p.DbTemplate] Fail to copy table rules
org.h2.jdbc.JdbcBatchUpdateException: Unique index or primary key violation: "RULES_PLUGIN_KEY_AND_NAME ON PUBLIC.RULES(PLUGIN_RULE_KEY, PLUGIN_NAME)"; SQL statement:
INSERT INTO rules(ID,PLUGIN_RULE_KEY,PLUGIN_NAME,DESCRIPTION,PRIORITY,CARDINALITY,PARENT_ID,PLUGIN_CONFIG_KEY,NAME,STATUS,LANGUAGE,CREATED_AT,UPDATED_AT) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?) [23505-172]
at org.h2.jdbc.JdbcPreparedStatement.executeBatch(JdbcPreparedStatement.java:1167) ~[h2-1.3.172.jar:1.3.172]
at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297) ~[commons-dbcp-1.4.jar:1.4]
at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297) ~[commons-dbcp-1.4.jar:1.4]
at org.sonar.core.persistence.DbTemplate.copyTableColumns(DbTemplate.java:100) [sonar-core-4.1.2.jar:na]
at org.sonar.core.persistence.DbTemplate.copyTableColumns(DbTemplate.java:54) [sonar-core-4.1.2.jar:na]
at org.sonar.core.persistence.DbTemplate.copyTable(DbTemplate.java:49) [sonar-core-4.1.2.jar:na]
at org.sonar.core.persistence.PreviewDatabaseFactory.copy(PreviewDatabaseFactory.java:87) [sonar-core-4.1.2.jar:na]
at org.sonar.core.persistence.PreviewDatabaseFactory.createNewDatabaseForDryRun(PreviewDatabaseFactory.java:63) [sonar-core-4.1.2.jar:na]
at org.sonar.core.preview.PreviewCache.generateNewDB(PreviewCache.java:121) [sonar-core-4.1.2.jar:na]
at org.sonar.core.preview.PreviewCache.getDatabaseForPreview(PreviewCache.java:81) [sonar-core-4.1.2.jar:na]
at org.sonar.server.ui.JRubyFacade.createDatabaseForPreview(JRubyFacade.java:471) [JRubyFacade.class:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_45]
(... snip ...)
followed by
2014.03.19 11:17:35 ERROR [o.s.s.ui.JRubyFacade] Fail to render: http://hulk:9000/batch_bootstrap/db?project=E2PR-12.0
attempt to unlock read lock, not locked by current thread
java.util.concurrent.locks.ReentrantReadWriteLock$Sync.unmatchedUnlockException(ReentrantReadWriteLock.java:447)
java.util.concurrent.locks.ReentrantReadWriteLock$Sync.tryReleaseShared(ReentrantReadWriteLock.java:431)
java.util.concurrent.locks.AbstractQueuedSynchronizer.releaseShared(AbstractQueuedSynchronizer.java:1340)
java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock.unlock(ReentrantReadWriteLock.java:883)
org.sonar.core.preview.PreviewCache.getDatabaseForPreview(PreviewCache.java:92)
org.sonar.server.ui.JRubyFacade.createDatabaseForPreview(JRubyFacade.java:471)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:606)
(... snip ...)
Subsequent analysis runs triggered by the eclipse plugin seem to hang at 11:28:46.317 DEBUG - Download: http://hulk:9000/batch_bootstrap/db?project=E2PR-12.0 (no proxy)
I can provide the logfile if that would help you to find out what's wrong.
It looks like your project has not been analyzed in SonarQube prior to running preview analyses in Eclipse. See http://docs.codehaus.org/display/SONAR/Configuring+SonarQube+in+Eclipse.
So, after a lot of digging I was able to resolve this issue. What pointed into the right direction was this discussion: http://comments.gmane.org/gmane.comp.java.sonar.general/33747
In the end this was caused by duplicate manual rules in the RULES table. I have no idea how they ended up there, but they were not visible from the UI, which made it kinda hard to spot.
After deleting these rules in the DB I'm now able to trigger the analysis from eclipse.

Resources