user3086925
user3086925

Reputation: 149

SonarQube Proxy Configuration, Tricky

I cannot get the proxy configuration to work for SonarQube 4.0 so that I can install plugins.

When i open http://localhost:9000/updatecenter/available it displays the error: "Not connected to update center. Please check your internet connection and logs."

In sonar.log I read: "org.sonar.api.utils.HttpDownloader$HttpException: Fail to download [http://update.sonarsource.org/update-center.properties]. Response code: 403"

In sonar.properties I configured it with the same proxy which I use for other programs:

sonar.updatecenter.activate=true
http.proxyHost=<host>
http.proxyPort=<port>
http.proxyUser=<username>
http.proxyPassword=<password>

I tried the same to configure in wrapper.properties, but it didn't work either by the way.

For the proxy host I tried the short and the full name. For the username I tried just the username and with <DOMAINNAME>\<username> and <DOMAINNAME>\\<username>.

Nothing of it worked. Any ideas?

Upvotes: 14

Views: 36292

Answers (6)

user2310395
user2310395

Reputation: 307

Appart from http, don't forget to set your https proxy configuration in sonar.properties (update server is behind HTTPS):

https.proxyHost=<host>
https.proxyPort=<port>
https.proxyUser=<username>
https.proxyPassword=<password>

Upvotes: 0

Renato Sim&#227;o
Renato Sim&#227;o

Reputation: 3

At sonar.properties set the proxy without "http://", only http.proxyHost=myproxy.domain.pt

Another suggestion is to also add this lines on wrapper.conf:

wrapper.java.additional.3=-Dhttp.proxySet=true
wrapper.java.additional.4=-Dhttp.proxyHost=myproxy.domain.pt
wrapper.java.additional.5=-Dhttp.proxyPort=myproxy.port
wrapper.java.additional.6=-Dhttps.proxyHost=myproxy.domain.pt
wrapper.java.additional.7=-Dhttps.proxyPort=myproxy.port

Careful if you have a docker volume, remove it before deploy the new one with this configuration, or otherwise it will keep the original configuration

Upvotes: 0

For those running SonarQube in Docker, I had no luck with any suggestion mentioned here. But I found following solution that worked for me (here):

docker run -d sonarqube -Dhttp.proxyHost=<myproxy.url.com> -Dhttp.proxyPort=<port>

and equivalent of this in a docker-compose notation:

services:
  sonarqube:
    image: sonarqube
    command: -Dhttp.proxyHost=<myproxy.url.com> -Dhttp.proxyPort=<port>

Upvotes: 6

Gabriel PASCUAL
Gabriel PASCUAL

Reputation: 66

I used the official documentation and it works: Using the Update Center behind a Proxy

http.proxyHost=<your.proxy.host>
http.proxyPort=<yout.proxy.port>

Regards,

Upvotes: 4

Stipan Beljan
Stipan Beljan

Reputation: 83

Just an information: I had this problem also. I can see the PlugIns but cannot download it. The problem is, you have to add this line into your sonar.properties, for the https:

# https-proxy
sonar.web.javaAdditionalOpts=-Dhttps.proxyHost=xxxxx -Dhttps.proxyPort=xxxx -Dhttps.proxyUser=xxxx -Dhttps.proxyPassword=xxxx

Upvotes: 4

TimStefanHauschildt
TimStefanHauschildt

Reputation: 594

My proxy configuration works and looks the following way:

http.proxyHost=proxy.domain.de
http.proxyPort=8888

Note that there is no "http://" or anything else before the URL.

Also, I do not use proxy authentication, so I left "proxyUser" and "proxyPassword" commented out.

Upvotes: 10

Related Questions