- SonarQube Enterprise Edition Version 9.2.1 (build 49989)
- sonarsource/sonar-scanner-cli :latest ( d182cb611a88)
- GITLAB-CI
- Sonar URL = https://sonarqube.domain
My SonarQube server is accessed by my Docker server through an http proxy but the url is in https.
The CI config
stages:
- test
quality:
image:
name: sonarsource/sonar-scanner-cli:latest
entrypoint: [""]
stage: test
variables:
PROXY_HOST: '10.x.x.x'
PROXY_PORT: '8080'
HTTP_PROXY: 'http://${PROXY_HOST}:${PROXY_PORT}'
HTTPS_PROXY: 'http://${PROXY_HOST}:${PROXY_PORT}'
SONAR_URL: 'https://sonarqube.domain'
SONAR_TOKEN: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
script:
- 'curl -k https://sonarqube.domain/batch/index -I'
- 'sonar-scanner -X "-Djava.net.useSystemProxies=true" "-Dsonar.host.url=${SONAR_URL}" "-Dsonar.login=${SONAR_TOKEN}" "-Dsonar.projectVersion=${CI_COMMIT_BRANCH}" "-Dsonar.projectKey=xxxxxxx" "-Dsonar.projectName=xxxxx" "-Dsonar.sources=." "-Djava.net.preferIPv4Stack=true"'
tags:
- docker
I’ve tested the http.proxy and https.proxy variables without a better result
"-Dhttp.proxyHost=${PROXY_HOST}" "-Dhttp.proxyPort=${PROXY_PORT}"
13:46:55.659 DEBUG: Download: https://sonarqube.domain/batch/index
13:47:25.766 INFO: ------------------------------------------------------------------------
13:47:25.766 INFO: EXECUTION FAILURE
13:47:25.765 ERROR: SonarQube server [https://sonarqube.domain] can not be reached
The curl request works fine
`` $ curl -k https://sonarqube.domain/batch/index -I
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0HTTP/1.1 200 Connection established
0 0 0 0 0 0 0 0 --:--:-- --:--:--
HTTP/1.1 200
I've searched the java proxy settings without much result too..
I hope you'll have some ideas..
David