ERROR: SonarQube server [] can not be reached

Kirupa Cse June 22, 2022

Getting Error "ERROR: SonarQube server [] can not be reached"  While Triggering Pipeline .
But I can access "http://PrivateIp:9000/" From my browser .

Both the gitlab runner & sonarqube hosted on same machine .

Configured all the steps accordingly .

Gitlab.yaml

sonarqube-check:
  stage: scan
  image: 
    name: sonarsource/sonar-scanner-cli:latest
    entrypoint: [""]
  variables:
    SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar"  # Defines the location of the analysis task cache
    #GIT_DEPTH: "0"  # Tells git to fetch all the branches of the project, required by the analysis task
    SONAR_PROJECT_KEY: "<YOUR PROJECT KEY>"  
    SONAR_PROJECT_NAME: "$CI_PROJECT_NAME"  
    SONAR_PROJECT_VERSION: "$CI_BUILD_ID"  
  cache:
    key: "${CI_JOB_NAME}"
    paths:
      - .sonar/cache
  script:
    - pwd
    - docker run --rm -e SONAR_HOST_URL="" -e SONAR_LOGIN="" -v "/home/projects/project1:/usr/src"
      sonarsource/sonar-scanner-cli:latest
      sonar.projectKey=""

 sonar-scanner.properties

SONAR_HOST_URL=""
SONAR_LOGIN=""
sonar.project.settings=sonar-project.properties

sonar-project.properties

SONAR_PROJECT_KEY=e2co
SONAR_PROJECT_NAME=e2co
SONAR_PROJECT_VERSION=1.0
sonar.qualitygate.wait=true
#sonar.sources=.
sonar.sourceEncoding=UTF-8

  Can any one suggest what is problem & how it could be resolved 

1 answer

0 votes
lissyaka June 24, 2022

@Kirupa Cse  hi.

Maybe it's a good idea to use SonarCloud pipe for this case.

- pipe: sonarsource/sonarcloud-scan:1.4.0
  variables:
    EXTRA_ARGS: -Dsonar.projectDescription=\"Project with sonarcloud-scan pipe\" -Dsonar.eslint.reportPaths=\"report.json\"
    SONAR_SCANNER_OPTS: -Xmx512m
    DEBUG: "true"

 

Cheers.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events