otymko / acc-export

Экспорт диагности 1С: АПК для SonarQube 1C (BSL) Community Plugin
MIT License
94 stars 25 forks source link

Error during SonarQube Scanner execution #24

Closed fenixnow closed 5 years ago

fenixnow commented 5 years ago

Возможно не сюда, но столкнулся с такой проблемой

image

17:21:33.530 INFO: Parsing 'BSL Language Server' analysis results:
17:21:33.530 INFO: D:\Sonar\acc-json.json
17:21:35.310 INFO: ------------------------------------------------------------------------
17:21:35.310 INFO: EXECUTION FAILURE
17:21:35.310 INFO: ------------------------------------------------------------------------
17:21:35.310 INFO: Total time: 6:56.134s
17:21:35.467 INFO: Final Memory: 43M/4320M
17:21:35.467 INFO: ------------------------------------------------------------------------
17:21:35.467 ERROR: Error during SonarQube Scanner execution
java.lang.IllegalArgumentException: 40 is not a valid line offset for pointer. File src/Ext/ExternalConnectionModule.bsl has 0 character(s) at line 18
        at org.sonar.api.internal.google.common.base.Preconditions.checkArgument(Preconditions.java:145)
        at org.sonar.api.batch.fs.internal.DefaultInputFile.checkValid(DefaultInputFile.java:339)
        at org.sonar.api.batch.fs.internal.DefaultInputFile.newPointer(DefaultInputFile.java:272)
        at org.sonar.api.batch.fs.internal.DefaultInputFile.newRange(DefaultInputFile.java:288)
        at com.github._1c_syntax.sonar.bsl.IssuesLoader.getTextRange(IssuesLoader.java:208)
        at com.github._1c_syntax.sonar.bsl.IssuesLoader.getNewIssueLocation(IssuesLoader.java:179)
        at com.github._1c_syntax.sonar.bsl.IssuesLoader.createExternalIssue(IssuesLoader.java:128)
        at com.github._1c_syntax.sonar.bsl.IssuesLoader.createIssue(IssuesLoader.java:77)
        at com.github._1c_syntax.sonar.bsl.LanguageServerDiagnosticsLoaderSensor.processDiagnostic(LanguageServerDiagnosticsLoaderSensor.java:108)
        at com.github._1c_syntax.sonar.bsl.LanguageServerDiagnosticsLoaderSensor.lambda$processFileInfo$0(LanguageServerDiagnosticsLoaderSensor.java:104)
        at java.util.ArrayList.forEach(ArrayList.java:1249)
        at com.github._1c_syntax.sonar.bsl.LanguageServerDiagnosticsLoaderSensor.processFileInfo(LanguageServerDiagnosticsLoaderSensor.java:104)
        at com.github._1c_syntax.sonar.bsl.LanguageServerDiagnosticsLoaderSensor.parseAndSaveResults(LanguageServerDiagnosticsLoaderSensor.java:88)
        at java.util.ArrayList.forEach(ArrayList.java:1249)
        at com.github._1c_syntax.sonar.bsl.LanguageServerDiagnosticsLoaderSensor.execute(LanguageServerDiagnosticsLoaderSensor.java:74)
        at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
        at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
        at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:59)
        at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:77)
        at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:59)
        at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java: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.scan.ProjectScanContainer.scan(ProjectScanContainer.java:359)
        at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:354)
        at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:317)
        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.doAfterStart(GlobalContainer.java:128)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
        at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:73)
        at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
        at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
        at com.sun.proxy.$Proxy0.execute(Unknown Source)
        at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:185)
        at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:137)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:111)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
        at org.sonarsource.scanner.cli.Main.main(Main.java:61)

D:\Sonar>
otymko commented 5 years ago

Это проблема одиночных CR. Ее можно решить двумя путями:

fenixnow commented 5 years ago
  • Использовать выгрузку в формат report-json

Его и использовал по умолчанию, тк выгружал обработкой из develop ветки

fenixnow commented 5 years ago

Я так понимаю что ошибка эта на стороне bsl-language-server?

fenixnow commented 5 years ago

выгрузил в reportjson прогнал updatecr.os, что он сделал....

Запустил на выгрузку, получил

D:\Sonar>sonar-scanner
INFO: Scanner configuration file: D:\sonar-scanner\bin\..\conf\sonar-scanner.properties
INFO: Project root configuration file: D:\Sonar\sonar-project.properties
INFO: SonarQube Scanner 3.3.0.1492
INFO: Java 1.8.0_121 Oracle Corporation (64-bit)
INFO: Windows 10 10.0 amd64
INFO: SONAR_SCANNER_OPTS=-Xmx6G
INFO: User cache: C:\Users\poletaev.as_adm\.sonar\cache
INFO: SonarQube server 7.7.0
INFO: Default locale: "ru_RU", source code encoding: "UTF-8"
INFO: Load global settings
INFO: Load global settings (done) | time=63ms
INFO: Server id: 41330257-AWpEZL5s1TAcUUwo9456
INFO: User cache: C:\Users\poletaev.as_adm\.sonar\cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=31ms
INFO: Load/download plugins (done) | time=47ms
INFO: Process project properties
INFO: Project key: Retail22
INFO: Base dir: D:\Sonar
INFO: Working dir: D:\Sonar\.scannerwork
INFO: Load project settings for component key: 'Retail22'
INFO: Load project settings for component key: 'Retail22' (done) | time=15ms
INFO: Load project repositories
INFO: Load project repositories (done) | time=31ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=16ms
INFO: Load active rules
INFO: Load active rules (done) | time=63ms
INFO: Indexing files...
INFO: Project configuration:
INFO:   Included sources: **/*.bsl
INFO: 3938 files indexed
INFO: 0 files ignored because of inclusion/exclusion patterns
INFO: Quality profile for bsl: BSL Language Server rules
INFO: ------------- Run sensors on module Retail22
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=31ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=0ms
INFO: Sensor BSL Core Sensor [communitybsl]
INFO: Parsing files...
 100% [=======================================] 3938/3938 (0:06:21 / 0:00:00)
INFO: Analyze files...
INFO: Reflections took 423 ms to scan 87 urls, producing 0 keys and 0 values
INFO: Reflections took 63 ms to scan 87 urls, producing 0 keys and 0 values
INFO: Reflections took 62 ms to scan 87 urls, producing 0 keys and 0 values
INFO: Reflections took 63 ms to scan 87 urls, producing 0 keys and 0 values
INFO: Reflections took 46 ms to scan 87 urls, producing 0 keys and 0 values
INFO: Reflections took 63 ms to scan 87 urls, producing 0 keys and 0 values
INFO: Reflections took 141 ms to scan 87 urls, producing 0 keys and 0 values
INFO: Reflections took 62 ms to scan 87 urls, producing 1 keys and 1 values
INFO: Reflections took 47 ms to scan 87 urls, producing 1 keys and 1 values
INFO: Reflections took 46 ms to scan 87 urls, producing 0 keys and 0 values
INFO: Reflections took 47 ms to scan 87 urls, producing 1 keys and 1 values
INFO: Reflections took 47 ms to scan 87 urls, producing 1 keys and 1 values
INFO: Reflections took 47 ms to scan 87 urls, producing 0 keys and 0 values
INFO: Reflections took 46 ms to scan 87 urls, producing 0 keys and 0 values
INFO: Reflections took 47 ms to scan 87 urls, producing 0 keys and 0 values
INFO: Reflections took 47 ms to scan 87 urls, producing 0 keys and 0 values
INFO: Reflections took 62 ms to scan 87 urls, producing 0 keys and 0 values
INFO: Reflections took 47 ms to scan 87 urls, producing 0 keys and 0 values
INFO: Reflections took 53 ms to scan 87 urls, producing 0 keys and 0 values
INFO: Reflections took 51 ms to scan 87 urls, producing 0 keys and 0 values
 100% [=======================================] 3938/3938 (0:00:05 / 0:00:00)
INFO: Saving issues...
INFO: Saving measures...
INFO: Saving CPD info...
INFO: Saving highlighting...
INFO: Sensor BSL Core Sensor [communitybsl] (done) | time=412772ms
INFO: Sensor BSL Language Server diagnostics loader [communitybsl]
INFO: Parsing 'BSL Language Server' analysis results:
INFO: D:\Sonar\bsl-json.json
ERROR: Can't read analysis report file
java.io.FileNotFoundException: File 'D:\Sonar\bsl-json.json' does not exist
        at org.apache.commons.io.FileUtils.openInputStream(FileUtils.java:297)
        at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:1805)
        at com.github._1c_syntax.sonar.bsl.LanguageServerDiagnosticsLoaderSensor.getAnalysisInfo(LanguageServerDiagnosticsLoaderSensor.java:126)
        at com.github._1c_syntax.sonar.bsl.LanguageServerDiagnosticsLoaderSensor.parseAndSaveResults(LanguageServerDiagnosticsLoaderSensor.java:81)
        at java.util.ArrayList.forEach(ArrayList.java:1249)
        at com.github._1c_syntax.sonar.bsl.LanguageServerDiagnosticsLoaderSensor.execute(LanguageServerDiagnosticsLoaderSensor.java:74)
        at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
        at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
        at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:59)
        at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:77)
        at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:59)
        at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java: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.scan.ProjectScanContainer.scan(ProjectScanContainer.java:359)
        at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:354)
        at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:317)
        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.doAfterStart(GlobalContainer.java:128)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
        at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:73)
        at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
        at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
        at com.sun.proxy.$Proxy0.execute(Unknown Source)
        at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:185)
        at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:137)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:111)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
        at org.sonarsource.scanner.cli.Main.main(Main.java:61)

INFO: Parsing 'BSL Language Server' analysis results:
INFO: D:\Sonar\acc-json.json
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 7:05.311s
INFO: Final Memory: 46M/4487M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
ERROR: 40 is not a valid line offset for pointer. File src/Ext/ExternalConnectionModule.bsl has 0 character(s) at line 18
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
otymko commented 5 years ago

Порядок действий был какой?

fenixnow commented 5 years ago

В посте выше же написано

otymko commented 5 years ago

Сначала нужно выполнить обработку одиночных CR, а потом только запуск bsl ls (экспорт в json)

otymko commented 5 years ago

@fenixnow актуально?

fenixnow commented 5 years ago

@fenixnow актуально?

Нет, забил