-
Notifications
You must be signed in to change notification settings - Fork 81
Unable to get Sonar Viewer From Stash: Received response with type text/plain instead of JSON #156
Comments
Hi @shaunlee0 , The only communication that has to be possible is from the system running the sonar scanner to both BitBucket and SonarQube. |
I have the correct sonar.stash.url set, what are the redirect urls? and how do I set these, they are not mentioned in the documentation. It would help if you supplied the endpoint you use to authenticate reviewers along with how you create these requests so I can test this communication. If I do a wget from the system running sonar scanner to the bitbucket url used and I get a 200 along with a permission denied when it tries to output the index.html. How do you authenticate these requests? I have supplied a valid bitbucket user and password, would have thought I would receive an authentication failed message rather than this "Received response with type text/plain instead of JSON" error message. |
I can get my user using: https://api.bitbucket.org/1.0/users/shaunlee0 But I cannot using the url structure specified in your stash client class which gives a url of: https://bitbucket.org/ridebooker/rest/1.0/users/shaunlee0 that results in a 404. |
In the debug console log I see the following request fails right before the job fails. Request DefaultFullHttpRequest(decodeResult: success, version: HTTP/1.1, content: EmptyByteBufBE) Response DefaultHttpResponse(decodeResult: success, version: HTTP/1.1) I changed the host to api.bitbucket.org due to having issues using the current url structure (see previous comment). |
Acording to the documentation, a 403 from bibucket cloud API signifies the following: 403 FORBIDDEN : Returned if the caller attempts to make a call or modify a resource for which the caller is not authorized. The request was a valid request, the caller's authentication credentials succeeded but those credentials do not grant the caller permission to access the resource. |
I am using bitbucket cloud if this effects how any of this works and how the API is used (if it even can be). |
@shaunlee0 Unfortunately this plugin only support bitbucket server (so far). Note: you leaked your password in your debug log. I removed it, but you should regard this password as compromised. |
Hi all,
I have followed the installation instructions, set up my user details in sonar/sonar-scanner arguments and executed the sonar-scanner to get the following exception:
ERROR: Unable to get SonarQube reviewer from Stash org.sonar.plugins.stash.exceptions.StashClientException: Received response with type text/plain instead of JSON at org.sonar.plugins.stash.client.StashClient.extractResponse(StashClient.java:371)
Can you please tell me if this is an issue extracting the response or the response itself from bitbucket for the user. If it is the latter can you please provide the URL that is used when getting a user?
Also, does your sonar instance have to be publically accessible by the URL you provide in order to allow bitbucket to communicate with it? Or is it all handled by the user auth within the plugin/arguments.
Thanks,
Shaun
The text was updated successfully, but these errors were encountered: