Перестал работать анализ


#1

Добрый день.
Перестал работать анализ, вот последние строки и сама ошибка:

12:11:52.228 INFO - ‘CommonForms/ПредупреждениеБезопасности/Ext/Form/Module.bsl’ generating issue exclusions
12:11:52.278 INFO - ‘CommonForms/ПредупрежденияПриЗавершенииРаботы/Ext/Form/Module.bsl’ generating issue exclusions
12:11:52.313 INFO - ‘CommonForms/ПустойРабочийСтол/Ext/Form/Module.bsl’ generating issue exclusions
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 3:34.413s
Final Memory: 288M/956M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Unable to analyze file: /var/lib/jenkins/workspace/steklodom_tl/CommonForms/Расширения/Ext/Form/Module.bsl
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.
WARN: Unable to locate ‘report-task.txt’ in the workspace. Did the SonarScanner succedeed?
ERROR: SonarQube scanner exited with non-zero code: 1
Finished: FAILURE

После запуска sonar-runner -e -X

12:29:07.307 DEBUG - ‘CommonForms/ПечатьДокументов/Ext/Form/Module.bsl’ generated metadata with charset ‘UTF-8’
12:29:07.410 INFO - ‘CommonForms/ПодготовкаНовогоПисьма/Ext/Form/Module.bsl’ generating issue exclusions
12:29:07.411 DEBUG - ‘CommonForms/ПодготовкаНовогоПисьма/Ext/Form/Module.bsl’ generated metadata with charset ‘UTF-8’
12:29:07.425 INFO - ‘CommonForms/ПоддерживаемыеКлиентскиеПриложения/Ext/Form/Module.bsl’ generating issue exclusions
12:29:07.425 DEBUG - ‘CommonForms/ПоддерживаемыеКлиентскиеПриложения/Ext/Form/Module.bsl’ generated metadata with charset ‘UTF-8’
12:29:07.456 INFO - ‘CommonForms/ПодключениеИнтернетПоддержки/Ext/Form/Module.bsl’ generating issue exclusions
12:29:07.457 DEBUG - ‘CommonForms/ПодключениеИнтернетПоддержки/Ext/Form/Module.bsl’ generated metadata with charset ‘UTF-8’
12:29:07.478 INFO - ‘CommonForms/ПоказателиВыделенныхЯчеек/Ext/Form/Module.bsl’ generating issue exclusions
12:29:07.478 DEBUG - ‘CommonForms/ПоказателиВыделенныхЯчеек/Ext/Form/Module.bsl’ generated metadata with charset ‘UTF-8’
12:29:07.537 INFO - ‘CommonForms/ПраваДоступа/Ext/Form/Module.bsl’ generating issue exclusions
12:29:07.540 DEBUG - ‘CommonForms/ПраваДоступа/Ext/Form/Module.bsl’ generated metadata with charset ‘UTF-8’
12:29:07.672 INFO - ‘CommonForms/ПраваДоступаУпрощенно/Ext/Form/Module.bsl’ generating issue exclusions
12:29:07.677 DEBUG - ‘CommonForms/ПраваДоступаУпрощенно/Ext/Form/Module.bsl’ generated metadata with charset ‘UTF-8’
12:29:07.749 INFO - ‘CommonForms/ПредупреждениеБезопасности/Ext/Form/Module.bsl’ generating issue exclusions
12:29:07.750 DEBUG - ‘CommonForms/ПредупреждениеБезопасности/Ext/Form/Module.bsl’ generated metadata with charset ‘UTF-8’
12:29:07.792 INFO - ‘CommonForms/ПредупрежденияПриЗавершенииРаботы/Ext/Form/Module.bsl’ generating issue exclusions
12:29:07.795 DEBUG - ‘CommonForms/ПредупрежденияПриЗавершенииРаботы/Ext/Form/Module.bsl’ generated metadata with charset ‘UTF-8’
12:29:07.846 INFO - ‘CommonForms/ПустойРабочийСтол/Ext/Form/Module.bsl’ generating issue exclusions
12:29:07.847 DEBUG - ‘CommonForms/ПустойРабочийСтол/Ext/Form/Module.bsl’ generated metadata with charset ‘UTF-8’
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 3:29.829s
Final Memory: 288M/956M
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: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.sonar.squidbridge.api.AnalysisException: Unable to analyze file: /var/lib/jenkins/workspace/steklodom_tl/CommonForms/Расширения/Ext/Form/Module.bsl
at org.sonar.squidbridge.AstScanner.scanFiles(AstScanner.java:131)
at org.sonar.squidbridge.ProgressAstScanner.scanFiles(ProgressAstScanner.java:44)
at org.silverbulleters.sonar.plugins.bsl.BSLSquidSensor.execute(Unknown Source)
at org.sonar.scanner.sensor.SensorWrapper.analyse(SensorWrapper.java:45)
at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:88)
at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:62)
at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:74)
at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:166)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:300)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:295)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:269)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:48)
at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:82)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:131)
at org.sonar.batch.bootstrapper.Batch.doExecuteTask(Batch.java:116)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:71)
at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
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.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
… 9 more
Caused by: java.lang.NullPointerException
at org.silverbulleters.sonar.plugins.bsl.checks.UndocumentedPublicApiCheck.f(Unknown Source)
at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:267)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
at org.silverbulleters.sonar.plugins.bsl.checks.UndocumentedPublicApiCheck.visitFile(Unknown Source)
at com.sonar.sslr.impl.ast.AstWalker.walkAndVisit(AstWalker.java:67)
at org.sonar.squidbridge.AstScanner.scanFiles(AstScanner.java:110)
… 36 more

Где искать причину ошибки?


#2

Пришлите нам, пожалуйста, на help@silverbulleters.org модуль CommonForms/Расширения/Ext/Form/Module.bsl


#3

@Dmitrij_Kalinin Файл получили, у нас на последней версии плагина анализ проходит без ошибок.

Дмитрий, скажите, какая у вас версия плагина?

если я не ошибаюсь, подобная проблема иногда воспроизводилась на старых версиях плагина - 1.12 или 1.11


#4

у нас версия 1.11


#5

Обновляйтесь на новую версию, если у вас есть новая версия.
Если нет, подключайтесь к поддержке/покупайте поддержку и тогда она у вас появится.


#6

Пока временно можно сделать следующее:

  • добавьте данный модуль в исключения для Сонара, тогда падение не будет.
  • или отключите правило “UndocumentedPublicApi”

#7

как добавить модуль в исключения?


#8

В файле sonar-project.properties есть опция exclusions


#9

Добавил строку:
sonar.exclusions=**/CommonForms/Расширения/*

при анализе:
16:16:01.953 INFO - ------------- Scan Steklodom TL
16:16:02.139 INFO - Base dir: /var/lib/jenkins/workspace/steklodom_tl
16:16:02.139 INFO - Working dir: /var/lib/jenkins/workspace/steklodom_tl/.sonar
16:16:02.141 INFO - Source paths: .
16:16:02.141 INFO - Source encoding: UTF-8, default locale: en_US
16:16:02.149 INFO - Load server rules
16:16:02.251 INFO - Load server rules (done) | time=102ms
16:16:02.439 INFO - Index files
16:16:02.443 INFO - Included sources:
16:16:02.443 INFO - **/.bsl
16:16:02.443 INFO - **/
.os
16:16:02.443 INFO - Excluded sources:
16:16:02.443 INFO - */CommonForms/Расширения/
16:16:03.450 INFO - 3706 files indexed
16:16:03.450 INFO - 12702 files ignored because of inclusion/exclusion patterns

16:19:47.188 INFO - ‘CommonForms/ПредупрежденияПриЗавершенииРаботы/Ext/Form/Module.bsl’ generating issue exclusions
16:19:47.211 INFO - ‘CommonForms/ПустойРабочийСтол/Ext/Form/Module.bsl’ generating issue exclusions
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 3:48.388s
Final Memory: 288M/956M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Unable to analyze file: /var/lib/jenkins/workspace/steklodom_tl/CommonForms/Расширения/Ext/Form/Module.bsl
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.
WARN: Unable to locate ‘report-task.txt’ in the workspace. Did the SonarScanner succedeed?
ERROR: SonarQube scanner exited with non-zero code: 1
Finished: FAILURE

получается, что файл при анализе не исключается?


#10

Кодировочка в файле исключений подкачала…


#11

Если память не изменяет, там юникодом надо:
**/CommonForms/%u0420%u0430%u0441%u0448%u0438%u0440%u0435%u043D%u0438%u044F/*


#12

сделал через юникод, все равно не исключил:

16:35:11.584 INFO - ------------- Scan Steklodom TL
16:35:11.773 INFO - Base dir: /var/lib/jenkins/workspace/steklodom_tl
16:35:11.774 INFO - Working dir: /var/lib/jenkins/workspace/steklodom_tl/.sonar
16:35:11.776 INFO - Source paths: .
16:35:11.776 INFO - Source encoding: UTF-8, default locale: en_US
16:35:11.784 INFO - Load server rules
16:35:11.905 INFO - Load server rules (done) | time=121ms
16:35:12.096 INFO - Index files
16:35:12.099 INFO - Included sources:
16:35:12.100 INFO - **/.bsl
16:35:12.100 INFO - **/
.os
16:35:12.100 INFO - Excluded sources:
16:35:12.100 INFO - /var/lib/jenkins/workspace/steklodom_tl/CommonForms/Расширения/Ext/Form/Module.bsl
16:35:13.116 INFO - 3706 files indexed
16:35:13.116 INFO - 12702 files ignored because of inclusion/exclusion patterns
16:35:13.117 INFO - Quality profile for bsl: Sonar way (Steklodom)
16:35:14.519 INFO - Sensor SonarJavaXmlFileSensor [java]
16:35:14.535 INFO - Sensor SonarJavaXmlFileSensor [java] (done) | time=17ms
16:35:14.535 INFO - Sensor BSL Squid Sensor [bsl]
16:35:15.435 INFO - Parsing metadata…

INFO: ------------------------------------------------------------------------ INFO: EXECUTION FAILURE INFO: ------------------------------------------------------------------------ Total time: 3:40.163s

Final Memory: 288M/956M INFO: ------------------------------------------------------------------------ ERROR: Error during Sonar runner execution ERROR: Unable to execute Sonar ERROR: Caused by: Unable to analyze file: /var/lib/jenkins/workspace/steklodom_tl/CommonForms/Расширения/Ext/Form/Module.bsl 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.

WARN: Unable to locate ‘report-task.txt’ in the workspace. Did the SonarScanner succedeed? ERROR: SonarQube scanner exited with non-zero code: 1 Finished: FAILURE


#13

Получилось исключить таким образом:
sonar.exclusions=**/CommonForms/\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f/Ext/Form/Module.bsl


#14

все-таки sonar.exclusions=**/CommonForms/Расширения/**/*.bsl


#15

Файлик надо не забыть, сохранить в utf8 кодировке


#16

Вообще, тому, кто придумал формат файла Java Properties надо в голову гвоздь забить. Я его презираю (с)


#17

ты чего? обычный же ini-файл в Винде :slight_smile:


#18

Ну да, и кириллицу не поддерживает, и экранировать все в нем надо не забывать…