Не анализируется 1C ERP

sonar-bsl-plugin

#1

Настройки сделаны как рекомендовали в документации к sonarqube и sonar scanner.
лог ниже, что еще можно настроит? на сервере с sonar scanner 27 Гб памяти

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread “JOURNAL_FLUSHER”
Exception in thread “CLEANUP_MANAGER” java.lang.OutOfMemoryError: Java heap space
at java.util.ArrayList.(ArrayList.java:153)
at com.persistit.CleanupManager.poll(CleanupManager.java:166)
at com.persistit.CleanupManager.runTask(CleanupManager.java:88)
at com.persistit.IOTaskRunnable.run(IOTaskRunnable.java:144)
at java.lang.Thread.run(Thread.java:748)
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 1:11:40.947s
Final Memory: 5446M/5925M
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 parse file: /var/lib/jenkins/workspace/steklodom_erp/Documents/АктВыполненныхРабот/Forms/ФормаДокумента/Ext/Form/Module.bsl
at org.sonar.squidbridge.AstScanner.scanFiles(AstScanner.java:105)
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.OutOfMemoryError: Java heap space
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


#2

Если через дженкинс добавьте ключик


#3

да, через jenkins, сделал так, прошло чуть дальше
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 1:06:00.724s
Final Memory: 5619M/6510M
INFO: ------------------------------------------------------------------------


#4

ну мало же на первый анализ - там копипаста первого вагон. Поставьте 16Gb


#5

А лучше 24


#6

пробовал -Xmx6G, -Xmx24G, -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -Xmx12G
после каждого изменения перезагружаю сервер
всегда Final Memory около 6 Гб


#7

на всякий случай уточню, сонар сервер и сонар сканнер на разных серверах


#8

Так не бывает (с)

Есть предложение - смотри, я в целях отладки запускаю вначале локально на ноде. Явно устанавливая переменную

SONAR_SCANNER_OPTS=-XX:+UseG1GC -XX:MaxGCPauseMillis=200 -Xmx12g

@ZhdanovR - обрати внимание вот тебе еще один сценарий для vanessa-sonar

Если ЭтоПервыйАнализ() Тогда
   РазмерПамятиВБайтах = (GitРепозиторий.РазмерРепозиторияВСтрокахКода * 2.5) ;
   ПараметрыСонара = "+XMx" + Цел(РазмерПамятиВБайтах/1000000) + "G";
КонецЕсли;

Офтопик:

Как подсчитать количество строк кода:

Обратите внимание на еще один пакетный менеджер


#9

Может у меня неправильная последовательность действией?
делаю так, захожу локально на сервер, далее:
SONAR_SCANNER_OPTS="-XX:+UseG1GC -XX:MaxGCPauseMillis=200 -Xmx20g"
sonar-runner

в итоге получаю это:

12:15:07.427 INFO - 7667/14174 files analyzed, current file: /var/lib/jenkins/workspace/steklodom_erp/Documents/ВнутреннееПотреблениеТоваров/Ext/ManagerModule.bsl
Exception in thread “CLEANUP_MANAGER” Exception in thread “Report about progress of code analyzer” Exception in thread “JOURNAL_FLUSHER”
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread “CLEANUP_MANAGER”

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread “JOURNAL_FLUSHER”
java.lang.OutOfMemoryError: Java heap space
at java.lang.StringCoding$StringEncoder.encode(StringCoding.java:300)
at java.lang.StringCoding.encode(StringCoding.java:344)
at java.lang.StringCoding.encode(StringCoding.java:387)
at java.lang.String.getBytes(String.java:958)
at ch.qos.logback.core.encoder.LayoutWrappingEncoder.convertToBytes(LayoutWrappingEncoder.java:108)
at ch.qos.logback.core.encoder.LayoutWrappingEncoder.encode(LayoutWrappingEncoder.java:116)
12:20:43.852 WARN - [CHECKPOINT_WRITER] WARNING Transaction neither committed nor rolled back Transaction_100000002 depth=1 status=<ts=158,355 tc=UNCOMMITTED mvv=0>
at ch.qos.logback.core.OutputStreamAppender.subAppend(OutputStreamAppender.java:230)
at ch.qos.logback.core.OutputStreamAppender.append(OutputStreamAppender.java:102)
at ch.qos.logback.core.UnsynchronizedAppenderBase.doAppend(UnsynchronizedAppenderBase.java:84)
at ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:51)
at ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:270)
at ch.qos.logback.classic.Logger.callAppenders(Logger.java:257)
at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:421)
at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:383)
at ch.qos.logback.classic.Logger.info(Logger.java:579)
at org.sonar.squidbridge.ProgressReport.log(ProgressReport.java:109)
at org.sonar.squidbridge.ProgressReport.run(ProgressReport.java:64)
at java.lang.Thread.run(Thread.java:748)
Exception in thread “CHECKPOINT_WRITER” java.lang.OutOfMemoryError: Java heap space
at java.util.ArrayList.iterator(ArrayList.java:840)
at com.persistit.TransactionIndex.checkpointAccumulatorSnapshots(TransactionIndex.java:1102)
at com.persistit.CheckpointManager.createCheckpoint(CheckpointManager.java:247)
at com.persistit.CheckpointManager.pollCreateCheckpoint(CheckpointManager.java:197)
at com.persistit.CheckpointManager.runTask(CheckpointManager.java:300)
at com.persistit.IOTaskRunnable.run(IOTaskRunnable.java:144)
at java.lang.Thread.run(Thread.java:748)
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 1:37:59.016s
Final Memory: 5598M/6502M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Unable to parse file: /var/lib/jenkins/workspace/steklodom_erp/Documents/ВнутреннееПотреблениеТоваров/Ext/ManagerModule.bsl
ERROR: Caused by: Java heap space
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.
root@sq-scanner:/var/lib/jenkins/workspace/steklodom_erp# 3.894 INFO - 7393/14174 files analyzed, current file: /var/lib/jenkins/workspace/steklodom_erp/DocumentJournals/Взаимодействия/Forms/ФормаСписка/Ext/Form/Module.bsl
-bash: 3.894: command not found
root@sq-scanner:/var/lib/jenkins/workspace/steklodom_erp# 11:08:42.176 INFO - 7404/14174 files analyzed, current file: /var/lib/jenkins/workspace/steklodom_erp/DocumentJournals/ДокументыУправленияШтатнымРасписанием/Forms/ФормаСписка/Ext/Form/Module.bsl
-bash: 11:08:42.176: command not found
root@sq-scanner:/var/lib/jenkins/workspace/steklodom_erp# 11:08:55.205 INFO - 7445/14174 files analyzed, current file: /var/lib/jenkins/workspace/steklodom_erp/Documents/АвансовыйОтчет/Ext/ManagerModule.bsl
-bash: 11:08:55.205: command not found


#10

6502M - видимо где-то стоит -XMx6G

Windows

set SONAR_SCANNER_OPTS="-XX:+UseG1GC -XX:MaxGCPauseMillis=200 -Xmx20g"
./sonar-runner

Linux

export SONAR_SCANNER_OPTS="-XX:+UseG1GC -XX:MaxGCPauseMillis=200 -Xmx20g"
./sonar-runner

Где смотреть

  • когда ты только запустил sonar-runner
  • в начале журнала он показывает - версию себя, параметры запуска и т.д.

#11

запустил вручную, не увидел параметров запуска в начале журнала

root@sq-scanner:/var/lib/jenkins/workspace/steklodom_erp# export SONAR_SCANNER_OPTS="-XX:+UseG1GC -XX:MaxGCPauseMillis=200 -Xmx20g"
root@sq-scanner:/var/lib/jenkins/workspace/steklodom_erp# sonar-runner
SonarQube Runner 2.4
Java 1.8.0_181 Oracle Corporation (64-bit)
Linux 4.9.0-8-amd64 amd64
INFO: Runner configuration file: /opt/sonar-runner/conf/sonar-runner.properties
INFO: Project configuration file: /var/lib/jenkins/workspace/steklodom_erp/sonar-project.properties
INFO: Default locale: “en_US”, source code encoding: “UTF-8” (analysis is platform dependent)
INFO: Work directory: /var/lib/jenkins/workspace/steklodom_erp/./.sonar
INFO: SonarQube Server 7.3.0.15553
14:02:37.156 INFO - Publish mode
14:02:37.685 INFO - Load global settings
14:02:37.901 INFO - Load global settings (done) | time=218ms
14:02:37.915 INFO - Server id: A7EE8CF2-AWXW61UvsxSxcvPjOhXH
14:02:37.956 INFO - User cache: /root/.sonar/cache
14:02:38.272 INFO - Load/download plugins
14:02:38.272 INFO - Load plugins index
14:02:38.364 INFO - Load plugins index (done) | time=92ms
14:02:38.835 INFO - Load/download plugins (done) | time=563ms
14:02:39.019 INFO - Loaded core extensions:
14:02:40.495 INFO - Process project properties
14:02:40.536 INFO - Load project repositories
14:02:40.556 INFO - Load project repositories (done) | time=20ms
14:02:40.666 INFO - Load quality profiles
14:02:40.722 INFO - Load quality profiles (done) | time=56ms
14:02:40.751 INFO - Load active rules
14:02:41.505 INFO - Load active rules (done) | time=754ms
14:02:41.509 INFO - Load metrics repository
14:02:41.538 INFO - Load metrics repository (done) | time=29ms
14:02:41.633 INFO - Project key: my:Steklodom_erp_mf
14:02:41.633 INFO - Project base dir: /var/lib/jenkins/workspace/steklodom_erp
14:02:41.636 INFO - ------------- Scan Steklodom ERP MF
14:02:42.087 INFO - Base dir: /var/lib/jenkins/workspace/steklodom_erp
14:02:42.088 INFO - Working dir: /var/lib/jenkins/workspace/steklodom_erp/.sonar
14:02:42.090 INFO - Source paths: .
14:02:42.090 INFO - Source encoding: UTF-8, default locale: en_US
14:02:42.097 INFO - Load server rules
14:02:42.245 INFO - Load server rules (done) | time=148ms
14:02:43.063 INFO - Index files
14:02:43.067 INFO - Included sources:
14:02:43.067 INFO - **/.bsl
14:02:43.067 INFO - **/
.os
14:02:46.717 INFO - 14174 files indexed
14:02:46.718 INFO - 56016 files ignored because of inclusion/exclusion patterns
14:02:46.719 INFO - Quality profile for bsl: Sonar way
14:02:48.848 INFO - Sensor SonarJavaXmlFileSensor [java]
14:02:48.921 INFO - Sensor SonarJavaXmlFileSensor [java] (done) | time=73ms
14:02:48.921 INFO - Sensor BSL Squid Sensor [bsl]
14:02:50.161 INFO - Parsing metadata…


#12

сейчас закончилось с другой ошибкой:

14:36:07.697 WARN - [JOURNAL_FLUSHER] WARNING Journal flush operation took 9,610ms last 8 cycles average is 1,201ms
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 33:38.635s
Final Memory: 5407M/6399M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Unable to parse file: /var/lib/jenkins/workspace/steklodom_erp/DataProcessors/ФормированиеРасписанияРабочихЦентров/Forms/ФормированиеРасписанияРабочихЦентров/Ext/Form/Module.bsl
ERROR: Caused by: GC overhead limit exceeded
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.


#13

перезапустите с ключом -X отладки. Лог отладки лучше в личку обсудить. Чую я что-то где-то что-то не так в окружении


#14

вы запускаете неверную утилиту.
sonar-runner - deprecated и естественно не учитывает настройки SONAR_SCANNER_OPTS
запускайте sonar-scanner


#15

всем спасибо, у меня получилось после:
export SONAR_SCANNER_OPTS="-XX:+UseG1GC -XX:MaxGCPauseMillis=200 -Xmx20g"
export SONAR_RUNNER_OPTS="-XX:+UseG1GC -XX:MaxGCPauseMillis=200 -Xmx20g"
export SONARQUBE_SCANNER_OPTS="-XX:+UseG1GC -XX:MaxGCPauseMillis=200 -Xmx20g"
sonar-runner


#16

Если учесть сообщение @nixel2007 то правильная переменная называлась _RUNNER_OPTS а не _SCANNER_OPTS. И советуем перейти на современную утилиту.