DroidsOnRoids / bitrise-step-sonarqube-scanner

Step for running SonarQube Scanner CLI
MIT License
6 stars 19 forks source link

Exception in thread "main" - Xcode 12.5.x - jdk8 and jdk11 tested #22

Closed mglaze closed 3 years ago

mglaze commented 3 years ago

This error just started for us this morning. I've tried updating to jdk11, same error. Any ideas? Was working fine on:

Sonar Scanner 4.3.0.2102. Xcode 12.5.x

id: sonarqube-scanner version: 1.0.8 collection: https://github.com/bitrise-io/bitrise-steplib.git toolkit: bash time: 2021-09-01T17:02:03Z +------------------------------------------------------------------------------+
INFO[17:02:03] [OK] Step dependency (unzip) installed, available. INFO[17:02:03] [OK] Step dependency (wget) installed, available. INFO[17:02:03] * [OK] Step dependency (curl) installed, available. \e[93mSonar Scanner CLI "4.6.2.2472" requires JRE or JDK version 11 or newer. Version "8" has been detected, CLI may not work properly.\e[0m /var/folders/g2/xnd8hpjs50v433gfrybz2nxh0000gn/T/tmp.qwAKyVV6 ~/git --2021-09-01 17:02:05-- https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.2.2472.zip Resolving binaries.sonarsource.com (binaries.sonarsource.com)... 91.134.125.245 Connecting to binaries.sonarsource.com (binaries.sonarsource.com) 91.134.125.245 :443... connected. HTTP request sent, awaiting response... 200 OK Length: 589299 (575K) [application/zip] Saving to: ‘sonar-scanner-cli-4.6.2.2472.zip’ 0K .......... .......... .......... .......... .......... 8% 153K 3s 50K .......... .......... .......... .......... .......... 17% 307K 2s 100K .......... .......... .......... .......... .......... 26% 67.1M 1s 150K .......... .......... .......... .......... .......... 34% 307K 1s 200K .......... .......... .......... .......... .......... 43% 37.2M 1s 250K .......... .......... .......... .......... .......... 52% 54.3M 1s 300K .......... .......... .......... .......... .......... 60% 68.5M 0s 350K .......... .......... .......... .......... .......... 69% 68.8M 0s 400K .......... .......... .......... .......... .......... 78% 312K 0s 450K .......... .......... .......... .......... .......... 86% 115M 0s 500K .......... .......... .......... .......... .......... 95% 53.9M 0s 550K .......... .......... ..... 100% 57.1M=0.8s 2021-09-01 17:02:07 (703 KB/s) - ‘sonar-scanner-cli-4.6.2.2472.zip’ saved [589299/589299] Archive: sonar-scanner-cli-4.6.2.2472.zip creating: sonar-scanner-4.6.2.2472/ creating: sonar-scanner-4.6.2.2472/bin/ creating: sonar-scanner-4.6.2.2472/conf/ creating: sonar-scanner-4.6.2.2472/lib/ inflating: sonar-scanner-4.6.2.2472/bin/sonar-scanner.bat
inflating: sonar-scanner-4.6.2.2472/bin/sonar-scanner-debug.bat
inflating: sonar-scanner-4.6.2.2472/bin/sonar-scanner-debug
inflating: sonar-scanner-4.6.2.2472/bin/sonar-scanner
inflating: sonar-scanner-4.6.2.2472/conf/sonar-scanner.properties
inflating: sonar-scanner-4.6.2.2472/lib/sonar-scanner-cli-4.6.2.2472.jar
~/git Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 0 at java.lang.String.charAt(String.java:658) at org.sonarsource.scanner.cli.Cli.processNextArg(Cli.java:76) at org.sonarsource.scanner.cli.Cli.parse(Cli.java:68) at org.sonarsource.scanner.cli.Main.main(Main.java:59)
dinisnunes1 commented 3 years ago

Same problem happening with me.

barnavarga commented 3 years ago

@mglaze it's the same here. I've just come here to even send the same message as you wrote. 🥲 So, I can confirm what has been written by @mglaze.

Circumstances: SonarQube Scanner 1.0.8 Scanner CLI version 4.6.2.2472 (by default the latest) Java 8/Java 11

Interesting thing but when I tried to change the CLI version it didn't work for me.

Fix: The version of the SonarQube Scanner plugin has been downgraded to 1.0.7 Thanks.

koral-- commented 3 years ago

Thanks for the report. Will check that.

shoaibsadanaut commented 3 years ago

@koral-- We are having same issue as well.

Screenshot 2021-09-02 at 10 52 45 AM

LiuCrane commented 3 years ago

@mglaze it's the same here. I've just come here to even send the same message as you wrote. 🥲 So, I can confirm what has been written by @mglaze.

Circumstances: SonarQube Scanner 1.0.8 Scanner CLI version 4.6.2.2472 (by default the latest) Java 8/Java 11

Interesting thing but when I tried to change the CLI version it didn't work for me.

Fix: The version of the SonarQube Scanner plugin has been downgraded to 1.0.7 Thanks.

Hi, could you please share the steps for how to downgrade the version in bitrise?

dinisnunes1 commented 3 years ago

Is there any option to select explicitly the version 1.0.7 on Bitrise? (while the 1.0.8 has problems)?

Also an alternative would be, when you have some new features, instead of increasing the patch version, you could increase the minor or major version. That would enable us to actually control with version change we are able to have on Bitrise configuration.

barnavarga commented 3 years ago

@mglaze it's the same here. I've just come here to even send the same message as you wrote. 🥲 So, I can confirm what has been written by @mglaze. Circumstances: SonarQube Scanner 1.0.8 Scanner CLI version 4.6.2.2472 (by default the latest) Java 8/Java 11 Interesting thing but when I tried to change the CLI version it didn't work for me. Fix: The version of the SonarQube Scanner plugin has been downgraded to 1.0.7 Thanks.

Hi, could you please share the steps for how to downgrade the version in bitrise?

Yeah, of course. If you can edit the bitrise.yml file, you can use a fix version: - sonarqube-scanner@1.0.7:

barnavarga commented 3 years ago

Is there any option to select explicitly the version 1.0.7 on Bitrise? (while the 1.0.8 has problems)?

Also an alternative would be, when you have some new features, instead of increasing the patch version, you could increase the minor or major version. That would enable us to actually control with version change we are able to have on Bitrise configuration.

Hi @dinisnunes1, My previous comment includes a solution how you can set an explicit version. I can agree with your opinion. It could have been better if the number of the minor version was changed because these version-changes are not correlated to each others. But there is a quick fix and @koral-- is on it. 👍😄

SatishDevOps-azure commented 3 years ago

@koral-- I do have the same issue SonarQube Scanner plugin has been downgraded to 1.0.7 but it didn't work to me.

Capture

koral-- commented 3 years ago

Should be fixed in 1.0.9 https://github.com/bitrise-io/bitrise-steplib/pull/3198

ofalvai commented 3 years ago

Hey everyone, the updated step version (1.0.9) is available in the step library and in workflow editor. Apologies for the inconvenience.

barnavarga commented 3 years ago

Hey everyone, the updated step version (1.0.9) is available in the step library and in workflow editor. Apologies for the inconvenience.

Hi @ofalvai & @koral-- , No worries, I've just tried and it is okay now. Thank you for your quick reaction.

dinisnunes1 commented 3 years ago

Thanks guys for the quick fix. I can confirm it's working normally. 💯