Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dartanalyzer sensor error #11

Closed
cutux opened this issue Mar 17, 2020 · 23 comments
Closed

dartanalyzer sensor error #11

cutux opened this issue Mar 17, 2020 · 23 comments
Labels
bug Something isn't working fixed on develop

Comments

@cutux
Copy link

cutux commented Mar 17, 2020

Hi, when executing dartanalyzer error after some minutes it caughts an exception:

org.buildobjects.process.ExternalProcessFailureException: External process 'dartanalyzer lib/* returned 3 after 201868ms

Any clue about this error?

Thanks!

@Clearedkinkajou
Copy link

Clearedkinkajou commented Mar 17, 2020

I keep getting this error also +1

@Clearedkinkajou
Copy link

Clearedkinkajou commented Mar 17, 2020

Here is a stacktrace. I'm running this in a docker container. ***** <- is for privacy

21:55:37.661 INFO: Sensor Dart sensor [flutter] (done) | time=2088ms
21:55:37.661 INFO: Sensor dartanalyzer sensor [flutter]
21:55:37.661 INFO: Backup of original analysis_options.yaml file to analysis_options.yaml.sonar
21:55:42.735 INFO: ------------------------------------------------------------------------
21:55:42.735 INFO: EXECUTION FAILURE
21:55:42.735 INFO: ------------------------------------------------------------------------
21:55:42.736 INFO: Total time: 27.454s
21:55:42.954 INFO: Final Memory: 59M/423M
21:55:42.954 INFO: ------------------------------------------------------------------------
21:55:42.955 ERROR: Error during SonarQube Scanner execution
org.buildobjects.process.ExternalProcessFailureException: External process 'dartanalyzer *****' returned 3 after 4784ms

        at org.buildobjects.process.Proc.<init>(Proc.java:124)
        at org.buildobjects.process.ProcBuilder.run(ProcBuilder.java:205)
        at fr.insideapp.sonarqube.dart.lang.issues.dartanalyzer.DartAnalyzerSensor.execute(DartAnalyzerSensor.java:94)
        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:408)
        at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:403)
        at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:360)
        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:126)
        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:189)
        at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
        at org.sonarsource.scanner.cli.Main.main(Main.java:61)

@cutux
Copy link
Author

cutux commented Mar 24, 2020

Here is a stacktrace. I'm running this in a docker container. ***** <- is for privacy

21:55:37.661 INFO: Sensor Dart sensor [flutter] (done) | time=2088ms
21:55:37.661 INFO: Sensor dartanalyzer sensor [flutter]
21:55:37.661 INFO: Backup of original analysis_options.yaml file to analysis_options.yaml.sonar
21:55:42.735 INFO: ------------------------------------------------------------------------
21:55:42.735 INFO: EXECUTION FAILURE
21:55:42.735 INFO: ------------------------------------------------------------------------
21:55:42.736 INFO: Total time: 27.454s
21:55:42.954 INFO: Final Memory: 59M/423M
21:55:42.954 INFO: ------------------------------------------------------------------------
21:55:42.955 ERROR: Error during SonarQube Scanner execution
org.buildobjects.process.ExternalProcessFailureException: External process 'dartanalyzer *****' returned 3 after 4784ms

        at org.buildobjects.process.Proc.<init>(Proc.java:124)
        at org.buildobjects.process.ProcBuilder.run(ProcBuilder.java:205)
        at fr.insideapp.sonarqube.dart.lang.issues.dartanalyzer.DartAnalyzerSensor.execute(DartAnalyzerSensor.java:94)
        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:408)
        at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:403)
        at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:360)
        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:126)
        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:189)
        at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
        at org.sonarsource.scanner.cli.Main.main(Main.java:61)

Jake one question, I was just wondering, do you have Android Sdk on that machine you're testing the plugin?

@Clearedkinkajou
Copy link

Clearedkinkajou commented Mar 24, 2020

yes, version 29 of the Android Sdk also here is my docker container. container

@Clearedkinkajou
Copy link

I manually ran the exact same command while inside the docker container and got no errors, dartanalyzer is only an issue with sonar-scanner

@cutux
Copy link
Author

cutux commented Mar 24, 2020

@Clearedkinkajou Mmm I think is because it is expecting exit status 0 by default as is defined here ProcBuilder class

Btw do you know what does status 3 mean for the analyzer? I've been searching but haven't found any info about it.

@Clearedkinkajou
Copy link

Clearedkinkajou commented Mar 24, 2020

Apparently it just means error
0 - no error
1 - hints
2 - warnings
3 - errors
dart-lang/sdk#21991

@Clearedkinkajou
Copy link

I also want to add that I only get this error in a contained environment such as Travis or a docker container. On all PC's I've tried it works with no error. I've tried 4 different computers, 2 Linux, 1 mac and 1 windows

@zippy1978
Copy link
Contributor

Hi,

Did you check that "dartanalyzer" is on the path ?
If it is the case, you can add it, or install the Dart SDK in standalone (https://dart.dev/get-dart) .

@zippy1978 zippy1978 added the waiting for feedback A feeback is necessary to investigate further label Mar 26, 2020
@Clearedkinkajou
Copy link

Clearedkinkajou commented Mar 26, 2020

It is 100% I entered the docker container and ran dart --version
image

@skindud
Copy link

skindud commented Apr 3, 2020

  1. I have the same error: org.buildobjects.process.ExternalProcessFailureException: External process 'dartanalyzer lib/*' returned 3 after 13728ms
  2. And yes, when I run the command 'dartanalyzer lib/*' manually it works well.

@skindud
Copy link

skindud commented Apr 6, 2020

I've checked it with docker sonarqube:7.6-community and sonarqube:8.2-community and I have got the same error.

@mm44m6
Copy link

mm44m6 commented May 8, 2020

Sadly, I'm facing the same issue ):
Trying to run it inside an azure pipeline, using a macOS machine.
I have a step just to make sure dartanalyzer is on the path.

##[error]ERROR: Error during SonarScanner execution
2020-05-08T22:37:22.4559660Z ERROR: Error during SonarScanner execution
2020-05-08T22:37:22.4593370Z ##[error]org.buildobjects.process.ExternalProcessFailureException: External process 'dartanalyzer lib/branch_locator_page.dart lib/config/apiKey.dart lib/config/location.dart lib/main.dart lib/models/branch.dart lib/models/branch_provider.dart lib/models/custom_coordinates.dart lib/providers/branch_provider.dart lib/services/places_service.dart lib/splash.dart lib/widgets/branch_list.dart lib/widgets/branch_list_card.dart lib/widgets/custom_map.dart lib/widgets/search_bar.dart lib/widgets/selected_branch_card.dart' returned 3 after 4310ms

at org.buildobjects.process.Proc.(Proc.java:124)
at org.buildobjects.process.ProcBuilder.run(ProcBuilder.java:205)
at fr.insideapp.sonarqube.dart.lang.issues.dartanalyzer.DartAnalyzerSensor.execute(DartAnalyzerSensor.java:94)
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:400)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:395)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:358)
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:141)
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:189)
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)

@amondnet
Copy link

@kavkdv
Copy link

kavkdv commented May 11, 2020

Good day,

With new version ExternalProcessFailureException is gone, but right now I am getting the new error:

image
image

I am using Java latest version

@skindud
Copy link

skindud commented May 11, 2020

No, with the new release (https://github.com/insideapp-oss/sonar-flutter/releases/download/0.2.1/sonar-flutter-plugin-0.2.1.jar) I have the same error as earlier (org.buildobjects.process.ExternalProcessFailureException: External process 'dartanalyzer ... lib/elements/button.dart' returned 3 after 11780ms)
There are steps to reproduce (with the example dart repository:
start docker

docker run --rm -it --entrypoint bash --user root sonarsource/sonar-scanner-cli

There are the following commands inside the docker:


cd ~
apt-get -y update && apt-get install -y curl

curl https://storage.googleapis.com/flutter_infra/releases/stable/linux/flutter_linux_1.17.0-stable.tar.xz -o flutter_linux_1.17.0-stable.tar.xz
tar xf flutter_linux_1.17.0-stable.tar.xz
export PATH="$PATH:$HOME/flutter/bin"
export PATH="$PATH:$HOME/flutter/bin/cache/dart-sdk/bin"
git clone https://github.com/dart-lang/dart-pad.git
cd dart-pad/

sonar-scanner \
  -Dsonar.projectKey=some-key \
  -Dsonar.sources=. \
  -Dsonar.host.url=https://sqube.***.com \
  -Dsonar.login=55a***be2

BTW, As I see from the pull request #16 it is still open. Does it mean that pull request #16 is not merged yet?

@amondnet
Copy link

@kavkdv What is your java version?
If possible, use the version included in sonar-scanner.

SonarScanner-4.3.0.2102 -> JRE 11.0.3

IMPLEMENTOR="AdoptOpenJDK"
IMPLEMENTOR_VERSION="AdoptOpenJDK"
JAVA_VERSION="11.0.3"
JAVA_VERSION_DATE="2019-04-16"

@amondnet
Copy link

@skindud
Copy link

skindud commented May 11, 2020

@skindud build from source (mvn clean license:format install), or download from forked repo.

https://github.com/amondnet/sonar-flutter/releases/download/0.2.2-SNAPSHOT/sonar-flutter-plugin-0.2.2-SNAPSHOT.jar

I've used this way and have got the new error:

...
INFO: Sensor dartanalyzer sensor [flutter] (done) | time=14681ms
INFO: Sensor Flutter unit tests [flutter]
ERROR: Failed to parse test report
java.nio.file.NoSuchFileException: /root/dart-pad/tests.output
...
INFO: Sensor dartanalyzer sensor [flutter] (done) | time=14681ms
INFO: Sensor Flutter unit tests [flutter]
ERROR: Failed to parse test report
java.nio.file.NoSuchFileException: /root/dart-pad/tests.output
...

@amondnet
Copy link

@skindud https://github.com/insideapp-oss/sonar-flutter/blob/master/README.md#run-analysis

Use the following commands from the root folder to start an analysis:

# Download dependencies 
flutter pub get 
# Run tests
flutter test --machine > tests.output
# Compute coverage (--machine and --coverage cannot be run at once...)
flutter test --coverage
# Run the analysis and publish to the SonarQube server
sonar-scanner

@skindud
Copy link

skindud commented May 12, 2020

new error

INFO: Sensor Flutter Coverage [flutter]
WARN: No coverage information will be saved because LCOV file cannot be found.
WARN: Provided LCOV file path: coverage/lcov.info. Seek file with path: /root/dart-pad/coverage/lcov.info
INFO: Analysing [null]
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 41.153s
INFO: Final Memory: 64M/217M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
java.lang.NullPointerException
        at fr.insideapp.sonarqube.flutter.coverage.LCOVParser.create(LCOVParser.java:60)

@kavkdv
Copy link

kavkdv commented May 12, 2020

Hi @amondnet , thx for your response, I changed version of Java to 11 and everything working fine right now, but I see in logs one strange warning:

##[error]WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1 (file:/Users/runner/.sonar/cache/52f5340dd05620cd162e2b9a45a57124/sonar-javascript-plugin.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of net.sf.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1 (file:/Users/runner/.sonar/cache/52f5340dd05620cd162e2b9a45a57124/sonar-javascript-plugin.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of net.sf.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Could you help me with that?

@zippy1978 zippy1978 added bug Something isn't working fixed on develop and removed waiting for feedback A feeback is necessary to investigate further labels Aug 9, 2020
@zippy1978
Copy link
Contributor

Hi,
This issue was fixed in 0.3.0.
I close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed on develop
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants