Enter adress : {SonarQube URL}/static/cpp/build-wrapper-linux-x86.zip as mentionned in the doc
In my case at my local adress http://192.168.XX.YY:9000/static/cpp/build-wrapper-linux-x86.zip
OR via my internet connection : https://myPublicAdress.com/sonarqube/static/cpp/build-wrapper-linux-x86.zip
Expected result : Zip is downloaded locally
Current result : "HTTP Status 404"
Extract form my docker-compose.yml :
version: '2'
services:
sonarqube:
image: 'sonarqube:8.4.1-developer'
container_name: sonarqube
restart: always
hostname: 'sonarqube.publicAdresse.com'
environment:
- SONARQUBE_JDBC_URL=jdbc:postgresql://localhost:5432/sonarqube_DB
- SONARQUBE_JDBC_USERNAME=sonarqube
- SONARQUBE_JDBC_PASSWORD=PWD
command: -Dsonar.web.context=/sonarqube
ports:
- '9000:9000'
- '9080:80'
- '9443:443'
volumes:
- '/srv/sonarqube/sonarqube_logs:/opt/sonarqube/logs'
- '/srv/sonarqube/sonarqube_data:/opt/sonarqube/data'
- '/srv/sonarqube/sonarqube_extentions:/opt/sonarqube/extensions'
- '/srv/sonarqube/sonarqube_conf:/opt/sonarqube/conf'
network_mode: "host" #to make link with localhost key word above and host machine
Do I miss Something ? Is this download working properly with a docker image of sonarqube ?
yeah the context was missing from the URL you specified to download the build wrapper from. you wrote
And it should be
The base URL should not matter when accessing sonarqube via ip, so let’s not focus on it right now. i just wanted to make sure that nothing strange was going on there.
When you access sonarqube via IP, is there a reverse proxy in front of the application?
For the proxy as I am in local and http only I suppose it is not used. I Only set proxy for message over https (port 443). Please find an extract of the proxy conf :
<VirtualHost *:443>
DocumentRoot "/var/www"
ServerAdmin webmaster@localhost
SSLProxyEngine On
ProxyPreserveHost On
#Add by VDE for sonarqube conf
ProxyRequests Off
Servername www.mypublicIp.com
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
#Sonarqube conf added by VDE
ProxyPass /sonarqube http://192.168.XX.YY:9000/sonarqube
ProxyPassReverse /sonarqube http://192.168.XX.YY:9000/sonarqube
#VDE for sonarqube
RequestHeader set X-Forwarded-Port "443"
RequestHeader set X-Forwarded-Proto "https"
I try also locally on the server via command line following :
try to download with wget the file :
~/docker-sonarqube$ wget http://192.168.XX.YY:9000/static/cpp/build-wrapper-linux-x86.zip
--2020-09-25 10:46:52-- http://192.168.XX.YY:9000/static/cpp/build-wrapper-linux-x86.zip
Connexion à 192.168.XX.YY:9000… connecté.
requête HTTP transmise, en attente de la réponse… 404
2020-09-25 10:46:52 erreur 404 : (pas de description).
~/docker-sonarqube$ wget http://192.168.XX.YY:9000/sonarqube/static/cpp/build-wrapper-linux-x86.zip
--2020-09-25 10:48:01-- http://192.168.XX.YY:9000/sonarqube/static/cpp/build-wrapper-linux-x86.zip
Connexion à 192.168.XX.YY:9000… connecté.
requête HTTP transmise, en attente de la réponse… 404
2020-09-25 10:48:01 erreur 404 : (pas de description).
~/docker-sonarqube$ wget http://localhost:9000/sonarqube/static/cpp/build-wrapper-linux-x86.zip
--2020-09-25 10:48:18-- http://localhost:9000/sonarqube/static/cpp/build-wrapper-linux-x86.zip
Résolution de localhost (localhost)… 127.0.0.1
Connexion à localhost (localhost)|127.0.0.1|:9000… connecté.
requête HTTP transmise, en attente de la réponse… 404
2020-09-25 10:48:18 erreur 404 : (pas de description).
~/docker-sonarqube$ wget http://localhost:9000/static/cpp/build-wrapper-linux-x86.zip
--2020-09-25 10:48:23-- http://localhost:9000/static/cpp/build-wrapper-linux-x86.zip
Résolution de localhost (localhost)… 127.0.0.1
Connexion à localhost (localhost)|127.0.0.1|:9000… connecté.
requête HTTP transmise, en attente de la réponse… 404
2020-09-25 10:48:23 erreur 404 : (pas de description).
Still 404 error … I do not understand why it does not work even on the server itself. I can only think of an issue or something that goes wrong in the docker… @Tobias_Trabelsi, any suggestion or test to do ?
now let’s take a look at your setup.
First think that comes into my mind would be that your directory mounts are not cleaned (which btw you should not use anyway). i could recreate this by using the compose file first with a community image and the developer image afterwards. this resulted in the extensions volume already populated with the plugins from the community edition and a 404 on the download on the build wrapper, so please check that.
The second thing that i already noted is that you set the sonar.web.context via a command, so please switch this to the environment variable SONAR_WEB_CONTEXT to not interfere with something here.
The last thing that i could think of is a /static rule in your reverse proxy somewhere, so please try to download the file for debugging purposes without it.
Your first point was the correct one : First think that comes into my mind would be that your directory mounts are not cleaned (which btw you should not use anyway). i could recreate this by using the compose file first with a community image and the developer image afterwards. this resulted in the extensions volume already populated with the plugins from the community edition and a 404 on the download on the build wrapper, so please check that.
I change my bind mounts to volume as you suggest and it works fine now !
Zip is accessible from my public adress correctly !