Error when trying to add SonarQube connection

  • Operating system: Windows 10
  • SonarLint plugin version: 10.8.0.79133
  • IntelliJ version: ULTIMATE 2024.2 (242.20224.300)
  • Programming language you’re coding in: Java

After the IntelliJ update to 2024.2, my connection to SonarQube was lost.

I am doing the following steps to add it:

  1. Settings
  2. Tools
  3. SonarLint
  4. Connections > Add
  5. Choose SonarQube
  6. Enter a name
  7. Enter the URL to our SonarQube instance (https without trailing slash)
  8. Click on “Next”
  9. Use Authentication Type “Token”
  10. Click “Create Token”
  11. Browser opens
  12. Allow Connection
  13. Browser says “OK”
  14. Going back to the IDE

Expected:
Token is inserted into the token field.

Actual:
Token is inserted into the token field and an error message is displayed:
Failed to connect to the server. Please check the configuration. Cause: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 12 path $

I can click on “OK” in the error message and then click on “Next”, but then the same error message appears again.

Hello @max.bachhuber.kvb, do you use any proxy to access your SonarQube?

This error typically happens when the HTTP client tries to parse as JSON a response that is definitely not JSON - usually, it’s a HTML page with the proxy authentication error.

I’d suggest to check your IntelliJ proxy settings. We also have a documentation page explaining the properties you can set for SonarLint.

Thank you for using SonarLint! :sonarlint:

Yes that was the issue.

The IntelliJ upgrade enabled automatic proxy detection. (See What's New in IntelliJ IDEA - 2024.2)

I have disabled the proxy again and now it works.

Would be good if the error message could be improved somehow :smiley:

1 Like

I am glad to hear your issue is resolved. Thank you for sharing that automatic proxy detection. I have created a ticket on our side to improve the behavior of such errors, here is the ticket for reference.

If you enjoy SonarLint, do not hesitate to give a review on our marketplace, thank you! :sonarlint:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.