I am trying to set up Sonar Gerrit - Jenkins Plugin on a Jenkins job.
Context
I suspect there's a issue with your REST API connection between Jenkins and Gerrit.
The "Sonar Gerrit" plugin uses the "Gerrit Trigger" plugin to post messages in Gerrit. The "Gerrit Trigger" plugin can use two different methods to post messages in Gerrit: SSH or REST API.
The "Build Failed ... FAILURE" message is posted directly by "Gerrit Trigger" plugin and it can be performed using SSH. The "Sonar Gerrit" messages CAN'T be performed using SSH, they need to be done using REST API so the "Gerrit Trigger" plugin needs to be configured to use REST API to enable "Sonar Gerrit" plugin to post in Gerrit.
See more info here.
Go to Jenkins > Manage Jenkins > Gerrit Trigger > Edit > Advanced
And check if the REST API is enabled and if it's working as expected (using the "Test REST Connection" button)
Does it work with section "post score?" Unchecked?
What category do you use for score posting? (Have you created it in Gerrit?)
If I remember correctly, an exception (provided by Gerrit Trigger) causing message
Unable to post review: Request failed.
is always exactly the same and doesn't help to understand the reason of RestApiException
anyway.
a new version of sonar-gerrit plugin has been released. I'm sorry for the delay.
I can't completely fix the problem JENKINS-32851 right now as reasons of the exception may vary, but I have added an ability to see the RestAPIException stacktrace. See details in the project Wiki. Please let me know if it helps (or not) and what (was?) causing your problem. I feel like I have to add some possible reasons of the exception to the troubleshooting section of the project Wiki :)