C++ community plugin: Sonar-runner scans wrong file types + Lexical errors - sonarqube

I have setup a Sonar server and am trying to pull some metrics by setting up a test project, but I encounter some problems.
Environment:
OS: Windows Server 2008 R2 / amd64 / 6.1
App Server:Tomcat/7.0.40I, deployed the Sonar WAR file (3.5.1).
DB: MySQL v5.6.11
(relevant) Plugins:
Sonar C++ Community Plugin (0.2)
The plugin is visible under General Settings --> Sonar C++ Community Plugin
sonar-project.properties:
# Required metadata
sonar.projectKey=mistral:pmc
sonar.projectName=PMC
sonar.projectVersion=1.0
sonar.language=c++
# Comma-separated paths to directories with sources (required)
sonar.sources=e:/Development/mistral/PMC/trunk/
# Optional path to the CppCheck program required to activate some CppCheck rules
sonar.cpp.cppcheck.path=C:/Program Files (x86)/Cppcheck/cppcheck.exe
# Encoding of the source files
sonar.sourceEncoding=UTF-8
Issue 1:
When running the sonar-runner it fails as it tries to analyse irrelevant filetypes, like .DOC (see below)
C:\Users\Administrator\Documents\sonar-runner-2.2.1
Sonar Runner 2.2.1
Java 1.7.0_21 Oracle Corporation (64-bit)
Windows Server 2008 R2 6.1 amd64
INFO: Runner configuration file: C:\Users\Administrator\Documents\sonar-runner-2.2.1\conf\sonar-runner.properties
INFO: Project configuration file: C:\Users\Administrator\Documents\sonar-projects\PMC\sonar-project.properties
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Work directory: C:\Users\Administrator\Documents\sonar-projects\PMC\.sonar
INFO: Sonar Server 3.5.1
13:18:23.320 INFO - Load batch settings
13:18:23.429 INFO - User cache: C:\Users\Administrator\.sonar\cache
13:18:23.444 INFO - Install plugins
13:18:24.287 INFO - ------------- Executing Project Scan
13:18:24.848 INFO - Install JDBC driver
13:18:24.848 INFO - Apply project exclusions
13:18:24.864 INFO - Create JDBC datasource for jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8
13:18:25.129 INFO - Initializing Hibernate
13:18:27.563 INFO - ------------- Inspecting PMC
13:18:27.578 INFO - Load module settings
13:18:28.780 INFO - Quality profile : [name=Default C++ Profile,language=c++]
13:18:28.795 INFO - Excluded tests:
13:18:28.795 INFO - **/package-info.java
13:18:28.826 INFO - Configure Maven plugins
13:18:28.982 INFO - Compare to previous analysis (2013-05-30)
13:18:29.045 INFO - Compare over 5 days (2013-05-25, analysis of 2013-05-29 09:23:04.0)
13:18:29.092 INFO - Compare over 30 days (2013-04-30, analysis of 2013-05-29 09:23:04.0)
13:18:29.294 INFO - Base dir: C:\Users\Administrator\Documents\sonar-projects\PMC
13:18:29.294 INFO - Working dir: C:\Users\Administrator\Documents\sonar-projects\PMC\.sonar
13:18:29.294 INFO - Source dirs: e:\Development\mistral\PMC\trunk
13:18:29.294 INFO - Source encoding: UTF-8, default locale: en_US
13:18:29.560 INFO - Sensor CxxSourceImporter...
13:18:30.932 WARN - SQL Error: 1366, SQLState: HY000
13:18:30.932 ERROR - Incorrect string value: '\xF2\x97\xA4\xB9\xDC\xAE...' for column 'data' at row 1
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 8.408s
Final Memory: 12M/352M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Unable to read and import the source file : 'e:\Development\mistral\PMC\trunk\doc\guides\Mistral_PMC_BroadcastEnvironmentImporter_user_guide.doc' with the charset : 'UTF-8'.
ERROR: Caused by: Unable to persist : SnapshotSource[snapshot_id=1742,data=??◄?→? > ♥ ?? ♠ ♀ ?♣ ► ?♣ ☺ ???? ?♣ ?♣ ?♣ ?♣ ?♣ ?♣ ?♣ ?♣ ?♣ ?♣ ?♣ ?♣ ?
??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? g? ♦ ?↕?
??☼ ??☼ ??☼ ? ?§ ?§ ?" ?" 0# 0# 0# $ ???? T# T# T# P ?# ? ($ ? T# ?? ?☺ ?$ ?☻ ?' ( ?'
?' ?' ?+ j♦ ►0 l☺ |1 ? (? ☻ *? *? *? *? *? *? $ ?? ?☻ =? ?☺ N? § 0# 42 H+ H+ ^ ...]
ERROR: Caused by: org.hibernate.exception.GenericJDBCException: could not insert: [org.sonar.api.database.model.SnapshotSource]
ERROR: Caused by: could not insert: [org.sonar.api.database.model.SnapshotSource]
ERROR: Caused by: Incorrect string value: '\xF2\x97\xA4\xB9\xDC\xAE...' for column 'data' at row 1
ERROR:
ERROR: To see the full stack trace of the errors, re-run Sonar Runner with the -e switch.
ERROR: Re-run Sonar Runner using the -X switch to enable full debug logging.
When I forcefully exclude the offending file types by adding: sonar.exclusions=**/*.doc,**/*.svc to the sonar-project.properties file I can work around this problem, but I rather get it to work as expected (only take files into account as configured)
Issue 2:
The analysis throws allot of “Lexical error in file” errors while scanning (see below). I believe this might happen if the source encoding differs.
C:\Users\Administrator\Documents\sonar-projects\PMC>sonar-runner
C:\Users\Administrator\Documents\sonar-runner-2.2.1
Sonar Runner 2.2.1
Java 1.7.0_21 Oracle Corporation (64-bit)
Windows Server 2008 R2 6.1 amd64
INFO: Runner configuration file: C:\Users\Administrator\Documents\sonar-runner-2.2.1\conf\sonar-runner.properties
INFO: Project configuration file: C:\Users\Administrator\Documents\sonar-projects\PMC\sonar-project.properties
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Work directory: C:\Users\Administrator\Documents\sonar-projects\PMC\.sonar
INFO: Sonar Server 3.5.1
13:22:35.048 INFO - Load batch settings
13:22:35.154 INFO - User cache: C:\Users\Administrator\.sonar\cache
13:22:35.157 INFO - Install plugins
13:22:35.878 INFO - ------------- Executing Project Scan
13:22:36.471 INFO - Install JDBC driver
13:22:36.476 INFO - Apply project exclusions
13:22:36.481 INFO - Create JDBC datasource for jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8
13:22:36.730 INFO - Initializing Hibernate
13:22:38.990 INFO - ------------- Inspecting PMC
13:22:38.995 INFO - Load module settings
13:22:40.078 INFO - Quality profile : [name=Default C++ Profile,language=c++]
13:22:40.096 INFO - Excluded sources:
13:22:40.097 INFO - **/*.doc
13:22:40.097 INFO - **/*.svc
13:22:40.097 INFO - Excluded tests:
13:22:40.098 INFO - **/package-info.java
13:22:40.125 INFO - Configure Maven plugins
13:22:40.266 INFO - Compare to previous analysis (2013-05-30)
13:22:40.326 INFO - Compare over 5 days (2013-05-25, analysis of 2013-05-29 09:23:04.0)
13:22:40.366 INFO - Compare over 30 days (2013-04-30, analysis of 2013-05-29 09:23:04.0)
13:22:40.575 INFO - Base dir: C:\Users\Administrator\Documents\sonar-projects\PMC
13:22:40.575 INFO - Working dir: C:\Users\Administrator\Documents\sonar-projects\PMC\.sonar
13:22:40.576 INFO - Source dirs: e:\Development\mistral\PMC\trunk
13:22:40.576 INFO - Source encoding: UTF-8, default locale: en_US
13:22:40.902 INFO - Sensor CxxSourceImporter...
13:22:42.888 INFO - Sensor CxxSourceImporter done: 1986 ms
13:22:42.889 INFO - Sensor CpdSensor...
13:22:42.889 INFO - SonarBridgeEngine is used
13:22:42.985 INFO - Cross-project analysis disabled
net.sourceforge.pmd.cpd.cppast.TokenMgrError: Lexical error in file e:\Development\mistral\PMC\trunk\AppServer\ApplicationDistributionScheduler\Logic\ActivateItvApplicationOnMcmDistributionRequestP
essor.cs at line 1, column 1. Encountered: "\ufeff" (65279), after : ""
at net.sourceforge.pmd.cpd.cppast.CPPParserTokenManager.getNextToken(CPPParserTokenManager.java:1655)
at net.sourceforge.pmd.cpd.CPPTokenizer.tokenize(CPPTokenizer.java:26)
at org.sonar.duplications.internal.pmd.TokenizerBridge.chunk(TokenizerBridge.java:60)
at org.sonar.duplications.internal.pmd.TokenizerBridge.chunk(TokenizerBridge.java:52)
at org.sonar.plugins.cpd.SonarBridgeEngine.analyse(SonarBridgeEngine.java:102)
at org.sonar.plugins.cpd.CpdSensor.analyse(CpdSensor.java:80)
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:70)
at org.sonar.batch.phases.Phases.execute(Phases.java:101)
at org.sonar.batch.scan.ScanContainer.doStart(ScanContainer.java:147)
at org.sonar.batch.bootstrap.Container.start(Container.java:72)
at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:65)
at org.sonar.batch.scan.ScanTask.scanRecursively(ScanTask.java:56)
at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:49)
at org.sonar.batch.bootstrap.TaskContainer.doStart(TaskContainer.java:188)
at org.sonar.batch.bootstrap.Container.start(Container.java:72)
at org.sonar.batch.bootstrap.TaskBootstrapContainer.executeTask(TaskBootstrapContainer.java:73)
at org.sonar.batch.bootstrap.TaskBootstrapContainer.doStart(TaskBootstrapContainer.java:62)
at org.sonar.batch.bootstrap.Container.start(Container.java:72)
at org.sonar.batch.bootstrap.BootstrapContainer.doStart(BootstrapContainer.java:104)
at org.sonar.batch.bootstrap.Container.start(Container.java:72)
at org.sonar.batch.bootstrapper.Batch.startBatch(Batch.java:88)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:72)
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:75)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:63)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:57)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:71)
at org.sonar.runner.api.Runner.execute(Runner.java:89)
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:41)
Skipping e:\Development\mistral\PMC\trunk\AppServer\ApplicationDistributionScheduler\Logic\ActivateItvApplicationOnMcmDistributionRequestProcessor.cs due to parse error
net.sourceforge.pmd.cpd.cppast.TokenMgrError: Lexical error in file e:\Development\mistral\PMC\trunk\AppServer\ApplicationDistributionScheduler\Logic\ApplicationDistributionRequestProcessor.cs at l
1, column 1. Encountered: "\ufeff" (65279), after : ""
at net.sourceforge.pmd.cpd.cppast.CPPParserTokenManager.getNextToken(CPPParserTokenManager.java:1655)
at net.sourceforge.pmd.cpd.CPPTokenizer.tokenize(CPPTokenizer.java:26)
at org.sonar.duplications.internal.pmd.TokenizerBridge.chunk(TokenizerBridge.java:60)
at org.sonar.duplications.internal.pmd.TokenizerBridge.chunk(TokenizerBridge.java:52)
at org.sonar.plugins.cpd.SonarBridgeEngine.analyse(SonarBridgeEngine.java:102)
at org.sonar.plugins.cpd.CpdSensor.analyse(CpdSensor.java:80)
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:70)
at org.sonar.batch.phases.Phases.execute(Phases.java:101)
at org.sonar.batch.scan.ScanContainer.doStart(ScanContainer.java:147)
at org.sonar.batch.bootstrap.Container.start(Container.java:72)
at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:65)
at org.sonar.batch.scan.ScanTask.scanRecursively(ScanTask.java:56)
at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:49)
at org.sonar.batch.bootstrap.TaskContainer.doStart(TaskContainer.java:188)
at org.sonar.batch.bootstrap.Container.start(Container.java:72)
at org.sonar.batch.bootstrap.TaskBootstrapContainer.executeTask(TaskBootstrapContainer.java:73)
at org.sonar.batch.bootstrap.TaskBootstrapContainer.doStart(TaskBootstrapContainer.java:62)
at org.sonar.batch.bootstrap.Container.start(Container.java:72)
at org.sonar.batch.bootstrap.BootstrapContainer.doStart(BootstrapContainer.java:104)
at org.sonar.batch.bootstrap.Container.start(Container.java:72)
at org.sonar.batch.bootstrapper.Batch.startBatch(Batch.java:88)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:72)
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:75)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:63)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:57)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:71)
at org.sonar.runner.api.Runner.execute(Runner.java:89)
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:41)
Skipping e:\Development\mistral\PMC\trunk\AppServer\ApplicationDistributionScheduler\Logic\ApplicationDistributionRequestProcessor.cs due to parse error
The thing is, I have set the sourceEncoding to UTF-8 but the files throwing the error are also encoded in UTF-8 (see below):
These might be simple beginner errors but I cannot find a quick/easy fix for this. Could you help on my way?

The .doc file is scanned because its file name ends with 'c'.
The c++ plugin's default source suffixes are: cxx,cpp,cc,c
Notice that there isn't any dot '.' character in there. So any file whose file name ends with 'c' character will be taken: abc, ab.c, a.bc. The same apply for the other suffixes.
If you want exact suffixes, you need to use something like this:
sonar.cxx.suffixes.sources=.cxx,.cpp,.cc,.c

Related

Unable to run analysis on SonarQube after upgrade to version 6.2

I’m trying to run the analysis on SonarQube 6.2 using MSBuild scanner but I'm receiving an error immediately on the first C# file analyzed.
The error occurs also on a very simple test solution containing only two C# files.
The error is the following:
SonarAnalyzer for C# version 1.20.1.1275
0/2 files analyzed, starting to analyze: C:\TF\16\35\src\Net Projects\Solutions\Test\TestSonarQube\Program.cs
Failed to analyze the file: C:\TF\16\35\src\Net Projects\Solutions\Test\TestSonarQube\Program.cs
System.UnauthorizedAccessException: Access to the path 'C:\TF\16\35\src\Net Projects\Solutions\Test\TestSonarQube\Program.cs' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at SonarAnalyzer.Runner.CompilationHelper.GetSolutionFromFiles(String filePath, Encoding encoding, AnalyzerLanguage language)
at SonarAnalyzer.Runner.Program.RunAnalysis(ScannerAnalyzerConfiguration conf)
The analysis was working fine before the upgrade. The user used to run the analysis has full rights on all files to be analyzed. The files do not appear to be locked before the analysis.
I'm using the following configuration:
SonarQube v. 6.2
C# Plugin v 5.5.1.522
Sonar scanner for MsBuild v2.2.0.24
Here the full scanner log:
SonarQube Scanner for MSBuild 2.2
Default properties file was found at C:\SonarQube\sonar-scanner-msbuild-2.2.0.24\SonarQube.Analysis.xml
Loading analysis properties from C:\SonarQube\sonar-scanner-msbuild-2.2.0.24\SonarQube.Analysis.xml
sonar.verbose=true was specified - setting the log verbosity to 'Debug'
Pre-processing started.
Preparing working directories...
Using environment variables to determine the download directory...
Removing the existing directory: C:\**root path***\Sonar\.sonarqube
Creating directory: C:\**root path***\Sonar\.sonarqube
SonarQube server URL: http://**server***:9000
SonarQube Scanner for MSBuild 2.2
10:40:36.698 Loading analysis properties from C:\SonarQube\sonar-scanner-msbuild-2.2.0.24\SonarQube.Analysis.xml
10:40:36.713 sonar.verbose=true was specified - setting the log verbosity to 'Debug'
10:40:36.715 Updating build integration targets...
10:40:36.72 Installed SonarQube.Integration.ImportBefore.targets to C:\Users\**user***\AppData\Local\Microsoft\MSBuild\14.0\Microsoft.Common.targets\ImportBefore
10:40:36.721 Installed SonarQube.Integration.ImportBefore.targets to C:\Users\**user***\AppData\Local\Microsoft\MSBuild\12.0\Microsoft.Common.targets\ImportBefore
10:40:36.724 Installed SonarQube.Integration.targets to C:\**root path***\Sonar\.sonarqube\bin\targets
10:40:36.726 Creating config and output folders...
10:40:36.726 Creating directory: C:\**root path***\Sonar\.sonarqube\conf
10:40:36.727 Creating directory: C:\**root path***\Sonar\.sonarqube\out
10:40:36.736 Fetching analysis configuration settings...
10:40:36.745 Fetching properties for project 'TestSonarQube:MAIN' from http://**server***:9000/api/properties?resource=TestSonarQube%3AMAIN...
10:40:36.746 Downloading from http://**server***:9000/api/properties?resource=TestSonarQube%3AMAIN...
10:40:37.514 Downloading from http://**server***:9000/api/updatecenter/installed_plugins...
10:40:37.575 Fetching quality profile for project 'TestSonarQube:MAIN' from http://**server***:9000/api/qualityprofiles/search?projectKey=TestSonarQube%3AMAIN...
10:40:37.575 Downloading from http://**server***:9000/api/qualityprofiles/search?projectKey=TestSonarQube%3AMAIN...
10:40:37.755 Downloading from http://**server***:9000/api/rules/search?f=repo,name,severity,lang,internalKey,templateKey,params,actives&ps=500&activation=true&qprofile=cs-sonar-way-15151&p=1...
10:40:37.898 No active rules for cs
10:40:37.953 Pre-processing succeeded.
SonarQube Scanner for MSBuild 2.2
Default properties file was found at C:\SonarQube\sonar-scanner-msbuild-2.2.0.24\SonarQube.Analysis.xml
Loading analysis properties from C:\SonarQube\sonar-scanner-msbuild-2.2.0.24\SonarQube.Analysis.xml
Post-processing started.
SonarQube Scanner for MSBuild 2.2
10:40:39.425 Loading the SonarQube analysis config from C:\**root path***\Sonar\.sonarqube\conf\SonarQubeAnalysisConfig.xml
10:40:39.428 Not running under TeamBuild
10:40:39.428 Analysis base directory: C:\**root path***\Sonar\.sonarqube
Build directory:
Bin directory: C:\**root path***\Sonar\.sonarqube\bin
Config directory: C:\**root path***\Sonar\.sonarqube\conf
Output directory: C:\**root path***\Sonar\.sonarqube\out
Config file: C:\**root path***\Sonar\.sonarqube\conf\SonarQubeAnalysisConfig.xml
Generating SonarQube project properties file to C:\**root path***\Sonar\.sonarqube\out\sonar-project.properties
The supplied Code Analysis ErrorLog file is a valid json file and does not need to be fixed: C:\Software Development\Net Projects\Solutions\Test\TestSonarQube\bin\Debug\SampleProjectForAnalysis.exe.RoslynCA.json
WARNING: File is not under the project directory and cannot currently be analysed by SonarQube. File: C:\Users\**user***\AppData\Local\Temp\.NETFramework,Version=v4.5.1.AssemblyAttributes.cs, project: C:\Software Development\Net Projects\Solutions\Test\TestSonarQube\SampleProjectForAnalysis.csproj
Setting analysis property: sonar.visualstudio.enable=false
Writing processing summary to C:\**root path***\Sonar\.sonarqube\out\ProjectInfo.log
SONAR_SCANNER_OPTS is already set. Value: -Xmx2048m
Calling the SonarQube Scanner...
Overwriting the value of environment variable 'SONAR_SCANNER_OPTS'. Old value: -Xmx2048m, new value: -Xmx2048m
Executing file C:\SonarQube\sonar-scanner-msbuild-2.2.0.24\sonar-scanner-2.8\bin\sonar-scanner.bat
Args: -Dsonar.scanAllFiles=true -Dproject.settings=C:\**root path***\Sonar\.sonarqube\out\sonar-project.properties
Working directory: C:\**root path***\Sonar
Timeout (ms):-1
Process id: 17152
C:\SonarQube\sonar-scanner-msbuild-2.2.0.24\sonar-scanner-2.8\bin\..
INFO: Scanner configuration file: C:\SonarQube\sonar-scanner-msbuild-2.2.0.24\sonar-scanner-2.8\bin\..\conf\sonar-scanner.properties
INFO: Project root configuration file: C:\**root path***\Sonar\.sonarqube\out\sonar-project.properties
10:40:40.025 INFO: SonarQube Scanner 2.8
10:40:40.031 INFO: Java 1.8.0_101 Oracle Corporation (64-bit)
10:40:40.032 INFO: Windows 10 10.0 amd64
10:40:40.032 INFO: SONAR_SCANNER_OPTS=-Xmx2048m
10:40:40.345 DEBUG: keyStore is :
10:40:40.346 DEBUG: keyStore type is : jks
10:40:40.346 DEBUG: keyStore provider is :
10:40:40.346 DEBUG: init keystore
10:40:40.347 DEBUG: init keymanager of type SunX509
10:40:40.575 INFO: User cache: C:\Users\**user***\.sonar\cache
10:40:40.575 DEBUG: Extract sonar-scanner-api-batch in temp...
10:40:40.583 DEBUG: Get bootstrap index...
10:40:40.584 DEBUG: Download: http://**server***:9000/batch_bootstrap/index
10:40:40.701 DEBUG: Get bootstrap completed
10:40:40.702 DEBUG: Create isolated classloader...
10:40:40.715 DEBUG: Start temp cleaning...
10:40:40.753 DEBUG: Temp cleaning done
10:40:40.754 DEBUG: Execution getVersion
10:40:40.764 DEBUG: Execution start
10:40:41.295 DEBUG: Publish global mode
10:40:41.454 INFO: Load global repositories
10:40:41.635 DEBUG: GET 200 http://**server***:9000/batch/global | time=176ms
10:40:41.729 INFO: Load global repositories (done) | time=276ms
10:40:41.754 INFO: User cache: C:\Users\**user***\.sonar\cache
10:40:42.059 INFO: Load plugins index
10:40:42.071 DEBUG: GET 200 http://**server***:9000/deploy/plugins/index.txt | time=12ms
10:40:42.071 INFO: Load plugins index (done) | time=12ms
10:40:42.073 DEBUG: Load plugins
10:40:42.093 DEBUG: Load plugins (done) | time=20ms
10:40:42.110 DEBUG: API compatibility mode is enabled on plugin ***custom*** Analyzer [***custom***codeanalysiscsharp] (built with API lower than 5.2)
10:40:42.112 DEBUG: API compatibility mode is enabled on plugin TFVC [scmtfvc] (built with API lower than 5.2)
10:40:42.403 DEBUG: Plugins:
10:40:42.404 DEBUG: * C# 5.5.1.522 (csharp)
10:40:42.404 DEBUG: * ***custom*** Analyzer 1.0.0.4 (***custom***codeanalysiscsharp)
10:40:42.404 DEBUG: * LDAP 2.1.0.507 (ldap)
10:40:42.404 DEBUG: * JavaScript 2.19.0.3866 (javascript)
10:40:42.405 DEBUG: * TFVC 2.1.2 (scmtfvc)
10:40:42.426 DEBUG: Execution getVersion
10:40:42.427 INFO: SonarQube server 6.2
10:40:42.427 INFO: Default locale: "en_US", source code encoding: "UTF-8"
10:40:42.428 DEBUG: Work directory: C:\**root path***\Sonar\.sonarqube\out\.sonar
10:40:42.429 DEBUG: Execution getVersion
10:40:42.429 DEBUG: Execution execute
10:40:43.192 INFO: Process project properties
10:40:43.206 DEBUG: Process project properties (done) | time=15ms
10:40:43.320 INFO: Load project repositories
10:40:43.791 DEBUG: GET 200 http://**server***:9000/batch/project.protobuf?key=TestSonarQube%3AMAIN | time=469ms
10:40:43.904 INFO: Load project repositories (done) | time=584ms
10:40:43.980 DEBUG: Available languages:
10:40:43.980 DEBUG: * C# => "cs"
10:40:43.980 DEBUG: * JavaScript => "js"
10:40:43.984 INFO: Load quality profiles
10:40:44.039 DEBUG: GET 200 http://**server***:9000/api/qualityprofiles/search.protobuf?projectKey=TestSonarQube%3AMAIN | time=54ms
10:40:44.045 INFO: Load quality profiles (done) | time=61ms
10:40:44.050 INFO: Load active rules
10:40:44.097 DEBUG: GET 200 http://**server***:9000/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives&activation=true&qprofile=cs-sonar-way-15151&p=1&ps=500 | time=46ms
10:40:44.169 DEBUG: GET 200 http://**server***:9000/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives&activation=true&qprofile=js-sonar-way-47608&p=1&ps=500 | time=49ms
10:40:44.176 INFO: Load active rules (done) | time=126ms
10:40:44.251 INFO: Publish mode
10:40:44.251 DEBUG: Start recursive analysis of project modules
10:40:44.253 INFO: ------------- Scan SampleProjectForAnalysis
10:40:44.393 INFO: Load server rules
10:40:44.610 DEBUG: GET 200 http://**server***:9000/api/rules/list.protobuf | time=217ms
10:40:44.632 INFO: Load server rules (done) | time=239ms
10:40:44.695 DEBUG: Initializers : GenericCoverageSensor
10:40:44.696 INFO: Initializer GenericCoverageSensor
10:40:44.696 INFO: Initializer GenericCoverageSensor (done) | time=0ms
10:40:44.697 INFO: Base dir: C:\Software Development\Net Projects\Solutions\Test\TestSonarQube
10:40:44.697 INFO: Working dir: C:\**root path***\Sonar\.sonarqube\out\.sonar\TestSonarQube_MAIN_TestSonarQube_MAIN_F1F49A3C-2CDE-4DC2-943C-BDE756CF7E64
10:40:44.698 INFO: Source paths: Program.cs, Properties/AssemblyInfo.cs, app.config, NuGet.config, packages.config
10:40:44.698 INFO: Source encoding: UTF-8, default locale: en_US
10:40:44.699 INFO: Index files
10:40:44.703 DEBUG: Declared extensions of language C# were converted to sonar.lang.patterns.cs : **/*.cs
10:40:44.703 DEBUG: Declared extensions of language JavaScript were converted to sonar.lang.patterns.js : **/*.js
10:40:44.710 DEBUG: Language of file 'Program.cs' is detected to be 'cs'
10:40:44.711 DEBUG: Language of file 'Properties/AssemblyInfo.cs' is detected to be 'cs'
10:40:44.728 INFO: Analyzer working directory does not exist
10:40:44.729 INFO: 2 files indexed
10:40:44.737 INFO: Quality profile for cs: Sonar way
10:40:44.741 DEBUG: Code colorizer, supported languages:
10:40:45.768 DEBUG: 'Generic Coverage Report' skipped because one of the required properties is missing
10:40:45.768 DEBUG: 'Generic Test Executions Report' skipped because one of the required properties is missing
10:40:45.779 DEBUG: 'JavaScript Squid Sensor' skipped because there is no related file in current project
10:40:45.781 DEBUG: Sensors : Lines Sensor -> SCM Sensor -> C# -> Coverage Report Import -> Coverage Report Import -> Unit Test Results Import -> Zero Coverage Sensor -> Code Colorizer Sensor -> CPD Block Indexer
10:40:45.782 INFO: Sensor Lines Sensor
10:40:45.800 INFO: Sensor Lines Sensor (done) | time=18ms
10:40:45.807 INFO: Sensor SCM Sensor
10:40:45.840 INFO: Sensor SCM Sensor (done) | time=33ms
10:40:45.841 INFO: Sensor C#
10:40:45.859 INFO: SonarAnalyzer.Scanner needs to be executed: true
10:40:47.974 INFO: SonarAnalyzer for C# version 1.20.1.1275
10:40:48.355 INFO: 0/2 files analyzed, starting to analyze: C:\Software Development\Net Projects\Solutions\Test\TestSonarQube\Program.cs
10:40:49.606 ERROR: Failed to analyze the file: C:\Software Development\Net Projects\Solutions\Test\TestSonarQube\Program.cs
10:40:49.611 ERROR: System.UnauthorizedAccessException: Access to the path 'C:\Software Development\Net Projects\Solutions\Test\TestSonarQube\Program.cs' is denied.
10:40:49.611 ERROR: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
10:40:49.611 ERROR: at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
10:40:49.611 ERROR: at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
10:40:49.611 ERROR: at SonarAnalyzer.Runner.CompilationHelper.GetSolutionFromFiles(String filePath, Encoding encoding, AnalyzerLanguage language)
10:40:49.612 ERROR: at SonarAnalyzer.Runner.Program.RunAnalysis(ScannerAnalyzerConfiguration conf)
10:40:49.637 INFO: ------------------------------------------------------------------------
10:40:49.637 INFO: EXECUTION FAILURE
10:40:49.637 INFO: ------------------------------------------------------------------------
10:40:49.637 INFO: Total time: 9.694s
10:40:49.769 INFO: Final Memory: 47M/254M
10:40:49.769 INFO: ------------------------------------------------------------------------
10:40:49.770 ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: The .NET analyzer failed with exit code: 1 - Verify that the .NET Framework version 4.5.2 at least is installed.
at org.sonar.plugins.csharp.CSharpSensor.analyze(CSharpSensor.java:159)
at org.sonar.plugins.csharp.CSharpSensor.executeInternal(CSharpSensor.java:104)
at org.sonar.plugins.csharp.CSharpSensor.execute(CSharpSensor.java:82)
at org.sonar.scanner.sensor.SensorWrapper.analyse(SensorWrapper.java:53)
at org.sonar.scanner.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:57)
at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:49)
at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:78)
at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:182)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:247)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:242)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:240)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:232)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:47)
at org.sonar.scanner.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.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:115)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:116)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:62)
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.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)
10:40:49.806 ERROR:
10:40:49.806 ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
Process returned exit code 1
The SonarQube Scanner did not complete successfully
10:40:49.946 Creating a summary markdown file...
10:40:49.948 Post-processing failed. Exit code: 1

Error processing file named sonar-reports/oclint.xml

I am facing an issue when I am trying analyzing iPhone app code with the help of sonarqube.
I am getting below error when trying to execute sonar-runner from app root directory.
11:06:17.040 INFO - Index files<br/>
11:06:18.276 INFO - 214 files indexed<br/>
11:06:18.966 INFO - Quality profile for objc: OCLint<br/>
11:06:19.016 INFO - Sensor QProfileSensor...<br/>
11:06:19.020 INFO - Sensor QProfileSensor done: 4 ms<br/>
11:06:19.020 INFO - Sensor ObjectiveCSquidSensor...<br/>
11:06:19.334 INFO - Sensor ObjectiveCSquidSensor done: 314 ms<br/>
11:06:19.334 INFO - Sensor Objective-C SurefireSensor...<br/>
11:06:19.334 INFO - parsing sonar-reports<br/>
11:06:19.334 INFO - Sensor Objective-C SurefireSensor done: 0 ms<br/>
11:06:19.335 INFO - Sensor org.sonar.plugins.objectivec.coverage.CoberturaSensor#6544899b...<br/>
11:06:19.342 INFO - Sensor
org.sonar.plugins.objectivec.coverage.CoberturaSensor#6544899b done: 7 ms<br/>
11:06:19.342 INFO - Sensor org.sonar.plugins.objectivec.violations.OCLintSensor#6da54910...<br/>
11:06:19.342 INFO - Processing OCLint report /Users/org/Documents/C/ISH/projects/Proj1/mobile2.2.0.5/mobile/ios/Proj1-Mobile/./sonar-reports/oclint.xml<br/>
11:06:19.346 ERROR - Error processing file named /Users/org/Documents/C/ISH/projects/Proj1/mobile2.2.0.5/mobile/ios/Proj1-Mobile/./sonar-reports/oclint.xml<br/>
java.io.FileNotFoundException: /Users/org/Documents/C/ISH/projects/Proj1/mobile2.2.0.5/mobile/ios/Proj1-Mobile/./sonar-reports/oclint.xml (No such file or directory)
at java.io.FileInputStream.open0(Native Method) ~[na:1.8.0_60]
at java.io.FileInputStream.open(FileInputStream.java:195) ~[na:1.8.0_60]
at java.io.FileInputStream.<init>(FileInputStream.java:138) ~[na:1.8.0_60]
at org.sonar.plugins.objectivec.violations.OCLintParser.parseReport(OCLintParser.java:49) ~[sonar-objective-c-plugin-0.4.0.jar:na]
Thanks in advance ,Let me know if someone faced same problem before.
If my understanding is correct, you're using the community SonarQube Objective-C plugin (https://github.com/octo-technology/sonar-objective-c), the best best to get some help is to create an issue here : https://github.com/octo-technology/sonar-objective-c/issues
I met same issue before, I solved it by using
sudo ./run-sonar.sh
The reason could be the oclint.xml is generated by root user before, and you are running as non-root user, so no privilege for you to access oclint.xml
Another possible reason is the dot(.) prefix in sonar-project.properties, Proj1-Mobile/./sonar-reports/oclint.xml, try to remove the ./ prefix in your properties file for the oclint.xml

SonarQube with Sonar-runner cannot store report

I have SonarQube 5.1 installed with sonar-runner 2.4, using Oracle database. When running sonar-runner on my project the analysis goes well and all steps until publishing the report is without problem, but then the logger gives me this:
08:04:45.705 INFO - Sensor JavaSquidSensor (done) | time=147026ms
08:04:45.705 INFO - Sensor Lines Sensor
08:04:46.007 INFO - Sensor Lines Sensor (done) | time=302ms
08:04:46.008 INFO - Sensor QProfileSensor
08:04:46.016 INFO - Sensor QProfileSensor (done) | time=8ms
08:04:46.017 INFO - Sensor InitialOpenIssuesSensor
08:04:46.363 INFO - Sensor InitialOpenIssuesSensor (done) | time=346ms
08:04:46.364 INFO - Sensor ProjectLinksSensor
08:04:46.474 INFO - Sensor ProjectLinksSensor (done) | time=110ms
08:04:46.475 INFO - Sensor VersionEventsSensor
08:04:46.908 INFO - Sensor VersionEventsSensor (done) | time=433ms
08:04:46.909 INFO - Sensor SurefireSensor
08:04:46.911 INFO - parsing /app/aim/jenkinsNew/jobs/Unit Testing with Code Coverage (DEV)/workspace/download/Omegapoint/.sonar/build/surefire-reports
08:04:46.911 WARN - Reports path not found: /app/aim/jenkinsNew/jobs/Unit Testing with Code Coverage (DEV)/workspace/download/Omegapoint/.sonar/build/surefire-reports
08:04:46.912 INFO - Sensor SurefireSensor (done) | time=3ms
08:04:46.912 INFO - Sensor SCM Sensor
08:04:46.912 INFO - No SCM system was detected. You can use the 'sonar.scm.provider' property to explicitly specify it.
08:04:46.912 INFO - Sensor SCM Sensor (done) | time=0ms
08:04:46.912 INFO - Sensor CPD Sensor
08:04:46.912 INFO - JavaCpdEngine is used for java
08:04:46.915 INFO - Cross-project analysis disabled
08:04:53.913 INFO - Sensor CPD Sensor (done) | time=7001ms
08:04:53.917 INFO - No quality gate is configured.
08:04:55.523 INFO - Execute decorators...
08:05:13.250 INFO - Store results in database
08:05:39.050 INFO - Analysis reports generated in 2135ms, dir size=1 MB
08:05:42.067 INFO - Analysis reports compressed in 3016ms, zip size=927 KB
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 4:09.242s
Final Memory: 26M/230M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Fail to execute request [code=500, url=http://XXX.XXX.XXX.XXX:9010/api/computation/submit_report?projectKey=SonarCube-report]: {"errors":[{"msg":"Fail to store analysis report of project SonarCube-report"}]}
ERROR:
ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with the -e switch.
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
The server SonarQube log sonar.log gives a long output (truncated here):
2015.06.05 08:58:41 ERROR web[o.s.s.w.WebServiceEngine] Fail to process request http://XXX.XXX.XXX.XXX:9010/api/computation/submit_report?projectKey=SonarCube-report
java.lang.IllegalStateException: Fail to store analysis report of project SonarCube-report
at org.sonar.server.computation.ReportQueue.add(ReportQueue.java:67) ~[sonar-server-5.1.jar:na]
at org.sonar.server.computation.ws.SubmitReportWsAction.handle(SubmitReportWsAction.java:75) ~[sonar-server-5.1.jar:na]
at org.sonar.server.ws.WebServiceEngine.execute(WebServiceEngine.java:84) ~[sonar-server-5.1.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95) ~[na:1.7.0]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56) ~[na:1.7.0]
at java.lang.reflect.Method.invoke(Method.java:620) ~[na:2.6 (12-15-2014)]
and
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1157) [na:1.7.0]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:627) [na:1.7.0]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.0.18.jar:8.0.18]
at java.lang.Thread.run(Thread.java:863) [na:1.7.0]
Caused by: java.io.IOException: not opened for reading
at org.jruby.util.io.ChannelStream.checkReadable(ChannelStream.java:134) ~[jruby-complete-1.7.9.jar:na]
at org.jruby.util.io.ChannelStream.bufferedRead(ChannelStream.java:994) ~[jruby-complete-1.7.9.jar:na]
at org.jruby.util.io.ChannelStream.access$300(ChannelStream.java:62) ~[jruby-complete-1.7.9.jar:na]
at org.jruby.util.io.ChannelStream$InputStreamAdapter.read(ChannelStream.java:1570) ~[jruby-complete-1.7.9.jar:na]
at java.io.InputStream.read(InputStream.java:114) ~[na:1.7.0]
at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1792) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1769) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.IOUtils.copy(IOUtils.java:1744) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.FileUtils.copyInputStreamToFile(FileUtils.java:1512) ~[commons-io-2.4.jar:2.4]
at org.sonar.server.computation.ReportQueue.saveReportOnDisk(ReportQueue.java:88) ~[sonar-server-5.1.jar:na]
at org.sonar.server.computation.ReportQueue.add(ReportQueue.java:61) ~[sonar-server-5.1.jar:na]
... 357 common frames omitted
I have double-checked that the database contains all sonar tables and data, and that it is reachable. Since I get this far in the process I suppose that connecting to the database is not problem? Any suggestions what to do?
Since I can't comment (need more "reputation" on stackoverflow) here's what I'm thinking:
First, I believe you're right that it isn't a database issue. This seems to be an issue with the server gathering the stored data.
So to resolve this, please check these things:
Check that your server's port 9010 is open/free while your sonar analysis is running.
Check your sonar.properties file for how you've configured the web server.
Check your wrapper.conf file
Check your access.log
Let me know what you find.
I had a similar issue on SonarQube server. Root cause was iNode count. SonarQube dir had couple of million files under its tmp directory. I deleted all the files under this tmp to free up inodes & did a restart. inode count (df -ih) then looked normal and SQ started working just fine.

Read timed out on /batch/project (SonarQube 4.5)

I am struggling with the following problem.
Log of the executed when sonar-runner in Jenkins.
SonarQube Runner 2.4
Java 1.7.0_67 Oracle Corporation (64-bit)
Windows 7 6.1 amd64
SONAR_RUNNER_OPTS=-Xms256m -Xmx512m
INFO: Runner configuration file: D:\CI_BUILD\sonar-runner-2.4\conf\sonar-runner.properties
INFO: Project configuration file: NONE
INFO: Default locale: "ko_KR", source code encoding: "UTF-8"
INFO: Work directory: D:\CI_BUILD\jenkins_home\jobs\CAFE-CLIENT\workspace\.sonar
INFO: SonarQube Server 4.5
05:17:52.119 INFO - Load global referentials...
05:17:53.382 INFO - Load global referentials done: 1263 ms
05:17:53.414 INFO - User cache: C:\Users\pcms_build\.sonar\cache
05:17:53.445 INFO - Install plugins
05:17:54.225 INFO - Install JDBC driver
05:17:54.303 INFO - Create JDBC datasource for jdbc:jtds:sqlserver://10.240.232.145/sonardb;SelectMethod=Cursor
05:17:56.222 INFO - Initializing Hibernate
05:17:59.217 INFO - Load project referentials...
05:18:19.232 INFO - Load project referentials done: 20015 ms
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 34.757s
Final Memory: 21M/291M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Unable to request: /batch/project?key=CAFE-CLIENT&preview=false
ERROR: Caused by: Read timed out
ERROR:
ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with the -e switch.
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
Build step 'Invoke Standalone Sonar Analysis' marked build as failure
05:18:19.232 INFO - Load project referentials done: 20015 ms
When "Load project referentials done" value is larger than 20,000 ms,
Always "Read timed out" occurs.
Loading of project referentials is not expected to take more than a few seconds. It is very likely you have a performance issue on your SQ server (or with your DB). Here are some criteria that may increase duration of this web service:
you have installed a lot of language plugins or you have enabled a lot of rules in quality profiles
your project is a multi-module project with a lot of modules
Compare for example with:
http://nemo.sonarqube.org/batch/project?key=org.codehaus.sonar%3Asonar&preview=true
that returns more than 1000 rules and 33 modules. It takes less than 2 seconds to return data.
EDIT: it seems there was some SQL issues depending on your DB vendor. See http://jira.codehaus.org/browse/SONAR-5849 and http://jira.codehaus.org/browse/SONAR-6063. Should be fixed in upcoming 4.5.3

Sonar runner 2.3 throws exception with Sonar 3.7 --> IllegalDataException

I am trying to analyse Java project using SOnar 3.7 & sonar-runner 2.3.
I was successfully able to analyse same codebase using Sonar 3.6.1 & Sonar runner 2.2.1 with same rule set/profile.
However, when I have upgraded version then I am having following errors...
org.jdom.IllegalDataException: The data "null" is not legal for a JDO
M attribute: A null is not a legal XML value
Console Output :
SonarQube Runner 2.3 Java 1.6.0_30 Sun Microsystems Inc. (64-bit) Windows 7 6.1 amd64
INFO: Error stacktraces are turned on.
INFO: Runner configuration file: C:\Dhruba\InstallationFolder\Sonar\sonar-runner-2.3\conf\sonar-runner.properties
INFO: Project configuration file: C:\Dhruba\Projects\Elsevier-OPSBANK_II_AIS\R11_Service_Workspace\sonar-project.properties
INFO: Default locale: "en_US", source code encoding: "windows-1252" (analysis is platform dependent)
INFO: Work directory: C:\Dhruba\Projects\Elsevier-OPSBANK_II_AIS\R11_Service_Workspace\.sonar
INFO: SonarQube Server 3.7
13:38:29.376 INFO - Load batch settings
13:38:29.482 INFO - User cache: C:\Users\Dhruba\.sonar\cache
13:38:29.487 INFO - Install plugins
13:38:31.219 INFO - Install JDBC driver
13:38:31.227 INFO - Create JDBC datasource for jdbc:oracle:thin:#localhost:1521 /orcl
13:38:32.382 INFO - Initializing Hibernate 13:38:34.579 INFO - Load project settings
13:38:34.665 INFO - Apply project exclusions
13:38:34.788 INFO - ------------- Scan OPSBankIIUtilityService
13:38:34.790 INFO - Load module settings
13:38:35.382 INFO - Quality profile : [name=OBBase1,language=java]
13:38:35.394 INFO - Excluded sources:
13:38:35.394 INFO - **/*_*.java
13:38:35.394 INFO - **/bo/**
13:38:35.395 INFO - */stub/**
13:38:35.395 INFO - **/*FacadeSoap*.java
13:38:35.395 INFO - com.ibm.ejs.container._EJSWrapper_**/src
13:38:35.395 INFO - *_Deser/src
13:38:35.395 INFO - *Proxy.java
13:38:35.395 INFO - */*FacadeHome.java
13:38:35.395 INFO - */*FacadeLocalHome.java 13:38:35.395 INFO - com/elsevier/obii/xml/*
13:38:35.395 INFO - Excluded tests:
13:38:35.395 INFO - */package-info.java
13:38:35.430 INFO - Configure Maven plugins
13:38:35.502 INFO - Compare to previous analysis
13:38:35.532 INFO - Compare over 7 days (2013-09-14)
13:38:35.558 INFO - Compare to previous version
13:38:35.734 INFO - Base dir: C:\Dhruba\Projects\Elsevier-OPSBANK_II_AIS\R11_Service_Workspace\OPSBankIIUtilityService
13:38:35.734 INFO - Working dir: C:\Dhruba\Projects\Elsevier-OPSBANK_II_AIS\R11_Service_Workspace\.sonar\dhrsrvc_OPSBankIIUtilityService
13:38:35.735 INFO - Source dirs: C:\Dhruba\Projects\Elsevier-OPSBANK_II_AIS\R11_Service_Workspace\OPSBankIIUtilityService\src
13:38:35.735 INFO - Source encoding: windows-1252, default locale: en_US
13:38:36.090 INFO - Sensor JavaSourceImporter...
13:38:37.021 INFO - Sensor JavaSourceImporter done: 931 ms
13:38:37.021 INFO - Sensor JavaSquidSensor...
13:38:37.160 INFO - Java AST scan...
13:38:40.518 INFO - Java AST scan done: 3358 ms
13:38:40.763 INFO - Sensor JavaSquidSensor done: 3742 ms
13:38:40.764 INFO - Sensor SurefireSensor...
13:38:40.765 INFO - parsing C:\Dhruba\Projects\Elsevier-OPSBANK_II_AIS\R11_Service_Workspace\.sonar\dhrsrvc_OPSBankIIUtilityService\build\surefire-reports
13:38:40.767 INFO - Sensor SurefireSensor done: 3 ms
13:38:40.769 INFO - Sensor CpdSensor...
13:38:40.770 INFO - SonarEngine is used
13:38:40.846 INFO - Cross-project analysis disabled
13:38:41.511 INFO - Sensor CpdSensor done: 742 ms
13:38:41.511 INFO - Sensor CheckstyleSensor...
13:38:41.514 INFO - Execute Checkstyle 5.6...
13:38:41.534 INFO - Checkstyle configuration: C:\Dhruba\Projects\Elsevier-OPSBANK_II_AIS\R11_Service_Workspace\.sonar\dhrsrvc_OPSBankIIUtilityService\checkstyle.xml
13:38:43.845 INFO - Execute Checkstyle 5.6 done: 2331 ms
13:38:43.849 INFO - Sensor CheckstyleSensor done: 2338 ms
13:38:43.850 INFO - Sensor PmdSensor...
13:38:43.853 INFO - Execute PMD 4.3...
13:38:43.864 INFO - Java version: 1.5
13:38:44.008 INFO - Execute PMD 4.3 done: 155 ms
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 17.761s Final Memory: 15M/406M
INFO: ------------------------------------------------------------------------
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(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.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
at org.sonar.runner.api.Runner.execute(Runner.java:90)
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:41) Caused by: org.sonar.api.utils.XmlParserException: org.jdom.IllegalDataException : The data "null" is not legal for a JDOM attribute: A null is not a legal XML value.
at org.sonar.plugins.pmd.PmdSensor.analyse(PmdSensor.java:55)
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:72)
at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:114)
at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:142)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:88)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:73)
at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:186)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:181)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:179)
at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:174)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:88)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:73)
at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:57)
at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:45)
at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:82)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:88)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:73)
at org.sonar.batch.bootstrap.BootstrapContainer.executeTask(BootstrapContainer.java:156)
at org.sonar.batch.bootstrap.BootstrapContainer.doAfterStart(BootstrapContainer.java:144)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:88)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:73)
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(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
... 9 more
**Caused by: org.jdom.IllegalDataException: The data "null" is not legal for a JDO M attribute: A null is not a legal XML value.**
at org.jdom.Attribute.setValue(Attribute.java:486)
at org.jdom.Attribute.<init>(Attribute.java:229)
at org.jdom.Attribute.<init>(Attribute.java:252)
at org.jdom.Element.setAttribute(Element.java:1109)
at org.sonar.plugins.pmd.PmdProfileExporter.exportPmdRulesetToXml(PmdProfileExporter.java:126)
at org.sonar.plugins.pmd.PmdProfileExporter.exportProfile(PmdProfileExporter.java:63)
at org.sonar.plugins.pmd.PmdExecutor.createRulesets(PmdExecutor.java:107)
at org.sonar.plugins.pmd.PmdExecutor.executeRules(PmdExecutor.java:89)
at org.sonar.plugins.pmd.PmdExecutor.executePmd(PmdExecutor.java:75)
at org.sonar.plugins.pmd.PmdExecutor.execute(PmdExecutor.java:61)
at org.sonar.plugins.pmd.PmdSensor.analyse(PmdSensor.java:52)
... 37 more ERROR: ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
Can you please help to resolve this one ?
I was analyzing the issue and found that imported profile from Sonar 3.6.1 to 3.7 had issue. Sonar 3.7 was not able to parse few of the XPath rules.
Therefore, I have just removed those XPath rules and re-added them manually and it starts working. This issue is not a bug of Sonar-runner instead Sonar 3.7 could not restore profiles correctly.

Resources