Gitlab-sonarqube CI hangs forever

I’m using sonar-gitlab-plugin 3.0.2 with SonarQube 6.7.7 to prevent bad codes from being merged. When the job is triggered, 2 Gitlab pipelines start running, one I can see the log that simply running some sort of check on a Gitlab docker which scans literally nothing. The other is an external job that hangs there forever without any sort of log coming out. How can I make the pipelines run properly? Thanks. Below is gitlab-ci.yml .

image:
    name: sonarsource/sonar-scanner-cli:latest
    entrypoint: [""]
variables:
    SONAR_TOKEN: "SONARQUBE_TOKEN"
    SONAR_HOST_URL: "SONARQUBE_DOMAIN"
    GIT_DEPTH: 0
sonarqube-check:
    stage: test
    script:
        - sonar-scanner
            -Dsonar.qualitygate.wait=true
            -Dsonar.host.url=SONARQUBE_DOMAIN
            -Dsonar.login=SONARQUBE_TOKEN
            -Dsonar.gitlab.user_token=GITLAB_USER_TOKEN_WITH_QUOTES
            -Dsonar.gitlab.project_id=$CI_PROJECT_PATH
            -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA
            -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME
            -Dsonar.analysis.mode=preview
    allow_failure: false
    only:
        - merge_requests
        - staging

Hi Tri,

First of all I am wondering why you’d be using SonarQube version 6.7.7? While the current LTS is version 7.9, in version 8.x SonarQube added GitLab branch and merge request integration out of the box - in addition to many other improvements and new features.

Any chance you can upgrade?

Hi Daniel,

The SonarQube server was inherited and was there for years. Upgraded to 8.3. Thanks for your recommendation.