After the IntelliJ update to 2024.2, my connection to SonarQube was lost.
I am doing the following steps to add it:
Settings
Tools
SonarLint
Connections > Add
Choose SonarQube
Enter a name
Enter the URL to our SonarQube instance (https without trailing slash)
Click on “Next”
Use Authentication Type “Token”
Click “Create Token”
Browser opens
Allow Connection
Browser says “OK”
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.
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!