VSTS task Run Code Analysis error with no reason


(Sergio Rodriguez) #1

I am using a Hosted agent. The “Run code analysis” task fails with no reason, this is the final log:

2018-09-07T07:09:02.6126650Z INFO: Source encoding: UTF-8, default locale: en_US

2018-09-07T07:09:02.6127094Z INFO: Index files

2018-09-07T07:09:03.5704871Z INFO: 849 files indexed

2018-09-07T07:09:03.5705200Z INFO: Quality profile for cs: Sonar way

2018-09-07T07:09:03.5705362Z INFO: Quality profile for css: Sonar way

2018-09-07T07:09:03.5705539Z INFO: Quality profile for js: Sonar way

2018-09-07T07:09:03.5705697Z INFO: Quality profile for ts: Sonar way

2018-09-07T07:09:03.5705854Z INFO: Quality profile for web: Sonar way

2018-09-07T07:09:03.5706032Z INFO: Quality profile for xml: Sonar way

2018-09-07T07:09:03.5706193Z INFO: Sensor SonarCSS Metrics [cssfamily]

2018-09-07T07:09:03.6387353Z WARNING: WARN: Metric 'comment_lines_data' is deprecated. Provided value is ignored.

2018-09-07T07:09:08.2128195Z INFO: Sensor SonarCSS Metrics [cssfamily] (done) | time=4663ms

2018-09-07T07:09:08.2128470Z INFO: Sensor SonarCSS Rules [cssfamily]

2018-09-07T07:12:33.7053290Z INFO: ------------------------------------------------------------------------

2018-09-07T07:12:33.7054286Z INFO: EXECUTION FAILURE

2018-09-07T07:12:33.7054741Z INFO: ------------------------------------------------------------------------

2018-09-07T07:12:33.7054919Z INFO: Total time: 4:33.590s

2018-09-07T07:12:33.9011176Z ##[error]ERROR: Error during SonarQube Scanner execution

2018-09-07T07:12:33.9013110Z ERROR: Error during SonarQube Scanner execution

2018-09-07T07:12:33.9013830Z ##[error]ERROR: null

2018-09-07T07:12:33.9014347Z ERROR: null

2018-09-07T07:12:33.9014950Z INFO: Final Memory: 34M/414M

2018-09-07T07:12:33.9015379Z INFO: ------------------------------------------------------------------------

2018-09-07T07:12:33.9015811Z ##[error]ERROR:

2018-09-07T07:12:33.9016158Z ERROR:

2018-09-07T07:12:34.0678768Z ##[error]The SonarQube Scanner did not complete successfully

2018-09-07T07:12:34.0696633Z The SonarQube Scanner did not complete successfully

2018-09-07T07:12:34.0752395Z 07:12:34.074 Creating a summary markdown file...

2018-09-07T07:12:34.0765914Z ##[error]07:12:34.075 Post-processing failed. Exit code: 1

2018-09-07T07:12:34.0767197Z 07:12:34.075 Post-processing failed. Exit code: 1

2018-09-07T07:12:34.0963265Z ##[error]D:\a\_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\1.3.2\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe failed with return code: 1

What´s is going on?


(Fabrice Bellingard) #2

Hi Sergio,

to help debug further, you can add the following parameter on the “Prepare Analysis” task: sonar.verbose=true
Once you have relaunched the analysis, we might be able to get more details in the logs.


(Sergio Rodriguez) #3

I have tested it on a private agent and it fails too.

This are the warns and errors.

12:53:02.324 WARN: Missing blame information for the following files:

12:53:02.339 WARN: * MotorWorkFlows.Domain.Entities/Properties/AssemblyInfo.cs

12:53:02.339 WARN: This may lead to missing/broken features in SonarQube

12:53:03.011 WARN: Missing blame information for the following files:

12:53:03.011 WARN: * MotorWorkFlows.Application.Core/Properties/AssemblyInfo.cs

12:53:03.011 WARN: This may lead to missing/broken features in SonarQube

12:53:03.495 WARN: Missing blame information for the following files:

12:53:03.495 WARN: * Crosscutting.Commons/Properties/AssemblyInfo.cs

12:53:03.495 WARN: This may lead to missing/broken features in SonarQube

12:53:06.886 WARN: Metric 'comment_lines_data' is deprecated. Provided value is ignored.

13:00:39.494 ERROR: Error during SonarQube Scanner execution

13:00:39.494 ERROR: null

13:00:39.494 ERROR:

The SonarQube Scanner did not complete successfully

13:00:39.963 Post-processing failed. Exit code: 1

C:\a2\_work\_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\1.3.2\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe failed with return code: 1

This are the end of the log with verbose option active:

2018-09-07T10:53:06.8398259Z 12:53:06.824 DEBUG: 'Go Unit Test Report' skipped because there is no related file in current project

2018-09-07T10:53:06.8399129Z 12:53:06.824 DEBUG: 'Import of go vet issues' skipped because there is no related file in current project

2018-09-07T10:53:06.8400107Z 12:53:06.824 DEBUG: 'Import of Golint issues' skipped because there is no related file in current project

2018-09-07T10:53:06.8401003Z 12:53:06.824 DEBUG: 'Import of GoMetaLinter issues' skipped because there is no related file in current project

2018-09-07T10:53:06.8401807Z 12:53:06.824 DEBUG: 'Kotlin Sensor' skipped because there is no related file in current project

2018-09-07T10:53:06.8402616Z 12:53:06.824 DEBUG: 'Import of detekt issues' skipped because there is no related file in current project

2018-09-07T10:53:06.8403430Z 12:53:06.824 DEBUG: 'Import of Android Lint issues' skipped because one of the required properties is missing

2018-09-07T10:53:06.8404531Z 12:53:06.824 DEBUG: 'T-SQL Sensor' skipped because there is no related file in current project

2018-09-07T10:53:06.8405340Z 12:53:06.824 DEBUG: 'SonarJS Coverage' skipped because one of the required properties is missing

2018-09-07T10:53:06.8406149Z 12:53:06.824 DEBUG: 'Import of ESLint issues' skipped because one of the required properties is missing

2018-09-07T10:53:06.8407214Z 12:53:06.824 DEBUG: 'Ruby Sensor' skipped because there is no related file in current project

2018-09-07T10:53:06.8408033Z 12:53:06.824 DEBUG: 'Import of RuboCop issues' skipped because one of the required properties is missing

2018-09-07T10:53:06.8408862Z 12:53:06.824 DEBUG: 'SimpleCov Sensor for Ruby coverage' skipped because there is no related file in current project

2018-09-07T10:53:06.8428599Z 12:53:06.839 DEBUG: 'PHP sensor' skipped because there is no related file in current project

2018-09-07T10:53:06.8435122Z 12:53:06.839 DEBUG: 'Analyzer for "php.ini" files' skipped because there is no related file in current project

2018-09-07T10:53:06.8435972Z 12:53:06.839 DEBUG: 'AbapSquidSensor' skipped because there is no related file in current project

2018-09-07T10:53:06.8436715Z 12:53:06.839 DEBUG: Sensors : SonarCSS Metrics -> SonarCSS Rules -> C# Properties -> SonarJavaXmlFileSensor -> Web -> XML Sensor -> SonarTS -> SonarTS Coverage -> SonarJS

2018-09-07T10:53:06.8437385Z 12:53:06.839 INFO: Sensor SonarCSS Metrics [cssfamily]

2018-09-07T10:53:06.9031676Z ##[error]12:53:06.886 WARN: Metric 'comment_lines_data' is deprecated. Provided value is ignored.

2018-09-07T10:53:06.9033391Z 12:53:06.886 WARN: Metric 'comment_lines_data' is deprecated. Provided value is ignored.

2018-09-07T10:53:23.3511122Z 12:53:23.339 INFO: Sensor SonarCSS Metrics [cssfamily] (done) | time=16500ms

2018-09-07T10:53:23.3512085Z 12:53:23.339 INFO: Sensor SonarCSS Rules [cssfamily]

2018-09-07T10:53:23.3512735Z 12:53:23.339 DEBUG: Checking node version

2018-09-07T10:53:23.6334546Z 12:53:23.620 DEBUG: Using Node.js v8.11.4

2018-09-07T10:53:23.6336077Z 12:53:23.620 DEBUG: Deploying bundle to C:\a2\_work\1\.sonarqube\out\.sonar\xxxxxx_E8D2D9B6-08BF-4F37-947B-92FEFF3C669B

2018-09-07T11:00:39.3267216Z 13:00:39.322 INFO: ------------------------------------------------------------------------

2018-09-07T11:00:39.3269305Z 13:00:39.322 INFO: EXECUTION FAILURE

2018-09-07T11:00:39.3270329Z 13:00:39.322 INFO: ------------------------------------------------------------------------

2018-09-07T11:00:39.3271123Z 13:00:39.322 INFO: Total time: 7:50.525s

2018-09-07T11:00:39.4980947Z 13:00:39.494 INFO: Final Memory: 25M/189M

2018-09-07T11:00:39.4982268Z 13:00:39.494 INFO: ------------------------------------------------------------------------

2018-09-07T11:00:39.4986410Z ##[error]13:00:39.494 ERROR: Error during SonarQube Scanner execution

13:00:39.494 ERROR: null

13:00:39.494 ERROR:

2018-09-07T11:00:39.4987895Z 13:00:39.494 ERROR: Error during SonarQube Scanner execution

2018-09-07T11:00:39.4988934Z 13:00:39.494 ERROR: null

2018-09-07T11:00:39.4989287Z 13:00:39.494 ERROR:

2018-09-07T11:00:39.9196293Z Process returned exit code 1

2018-09-07T11:00:39.9366665Z ##[error]The SonarQube Scanner did not complete successfully

2018-09-07T11:00:39.9441176Z The SonarQube Scanner did not complete successfully

2018-09-07T11:00:39.9712586Z 13:00:39.963 Creating a summary markdown file...

2018-09-07T11:00:39.9790665Z ##[error]13:00:39.963 Post-processing failed. Exit code: 1

2018-09-07T11:00:39.9791822Z 13:00:39.963 Post-processing failed. Exit code: 1

2018-09-07T11:00:40.1127310Z ##[error]C:\a2\_work\_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\1.3.2\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe failed with return code: 1

2018-09-07T11:00:40.1579439Z ##[section]Finishing: Run Code Analysis

(Elena Vilchik) #6

Hey,

There is a ticket created for your problem https://github.com/SonarSource/sonar-css/issues/124. We will release the fix asap.

In meantime you can exclude CSS files (sonar.exclusions=**/*.css)


(Sergio Rodriguez) #7

It fails again with that exclusion, same error:

11:47:32.282 WARN: Missing blame information for the following files:
11:47:32.282 WARN:   * MotorWorkFlows.Domain.Entities/Properties/AssemblyInfo.cs
11:47:32.282 WARN: This may lead to missing/broken features in SonarQube

11:47:33.391 WARN: Missing blame information for the following files:

11:47:33.391 WARN:   * MotorWorkFlows.Application.Core/Properties/AssemblyInfo.cs

11:47:33.391 WARN: This may lead to missing/broken features in SonarQube

11:47:34.032 WARN: Missing blame information for the following files:
11:47:34.032 WARN:   * Crosscutting.Commons/Properties/AssemblyInfo.cs
11:47:34.032 WARN: This may lead to missing/broken features in SonarQube

11:47:37.079 WARN: Metric 'comment_lines_data' is deprecated. Provided value is ignored.

11:55:55.662 ERROR: Error during SonarQube Scanner execution
11:55:55.662 ERROR: null
11:55:55.662 ERROR:

The SonarQube Scanner did not complete successfully

11:55:55.865  Post-processing failed. Exit code: 1

C:\a2\_work\_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\1.3.2\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe failed with return code: 1

I can see the exclusion applied in the log:

2018-09-10T09:46:54.1165134Z sonar.exclusions=**/*.css

2018-09-10T09:46:54.1165415Z sonar.verbose=true

2018-09-10T09:46:54.1165748Z sonar.visualstudio.enable=false

(Elena Vilchik) #8

Can you show verbose logs?

Do you have css files with other extensions? scss, less


(Sergio Rodriguez) #9

OK, I have excluded this additional extensions and now the error changes:

sonar.exclusions= **/*.css,**/*.less,**/*.scss

2018-09-10T10:48:41.2739457Z ##[error]12:48:41.268 WARN: [JOURNAL_FLUSHER] WARNING Journal flush operation took 22.335ms last 8 cycles average is 2.792ms

2018-09-10T10:48:41.2742135Z 12:48:41.268 WARN: [JOURNAL_FLUSHER] WARNING Journal flush operation took 22.335ms last 8 cycles average is 2.792ms

2018-09-10T10:48:41.5421303Z 12:48:41.534 INFO: ------------------------------------------------------------------------

2018-09-10T10:48:41.5428117Z 12:48:41.534 INFO: EXECUTION FAILURE

2018-09-10T10:48:41.5428675Z 12:48:41.534 INFO: ------------------------------------------------------------------------

2018-09-10T10:48:41.5429049Z 12:48:41.534 INFO: Total time: 4:48.529s

2018-09-10T10:48:41.9822791Z 12:48:41.971 INFO: Final Memory: 13M/989M

2018-09-10T10:48:41.9826309Z 12:48:41.971 INFO: ------------------------------------------------------------------------

2018-09-10T10:48:41.9828014Z ##[error]12:48:41.971 ERROR: Error during SonarQube Scanner execution

12:48:41.971 ERROR: Java heap space

12:48:41.971 ERROR:

2018-09-10T10:48:41.9829386Z 12:48:41.971 ERROR: Error during SonarQube Scanner execution

2018-09-10T10:48:41.9829739Z 12:48:41.971 ERROR: Java heap space

2018-09-10T10:48:41.9830051Z 12:48:41.971 ERROR:

2018-09-10T10:48:42.1533510Z Process returned exit code 1

2018-09-10T10:48:42.1746943Z ##[error]The SonarQube Scanner did not complete successfully

2018-09-10T10:48:42.1748853Z The SonarQube Scanner did not complete successfully

2018-09-10T10:48:42.1749468Z 12:48:42.159 Creating a summary markdown file...

2018-09-10T10:48:42.1750282Z ##[error]12:48:42.159 Post-processing failed. Exit code: 1

2018-09-10T10:48:42.1751541Z 12:48:42.159 Post-processing failed. Exit code: 1

2018-09-10T10:48:42.2002969Z ##[error]C:\a2\_work\_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\1.3.2\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe failed with return code: 1

Is it better or worse? :sweat_smile:


(Elena Vilchik) #10

Can you show all logs? in verbose


(Sergio Rodriguez) #11

verboselog.txt (356.9 KB)

Here you have!


(Elena Vilchik) #12

Looks like we have trouble parsing or analysing js file PortalEmpleadoMVC/Scripts/dx.all.debug.js.

Can you show it?
P.S. try to exclude this one as well to finish analysis


(Nicolas Bontoux) #13

Just in case: would it be this file below ?


(HTML5 JavaScript Component Suite for Responsive Web Development)

Note @YiNHo that if this is a file of a library and/or dependency you do not own, then it’s anyhow recommended to exclude it from the analysis (since ultimately you’re in a position to maintain it).

To the latest error you’ve observed: that dx.all.debug.js in GitHub file is 170 thousands lines long! Seems legitimate for the analyzer to not have enough memory at its disposal.


(Sergio Rodriguez) #14

Yes, this are DevExpress scripts, and that was the problem. Excluding that it works.

Thank you for your help!