Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
813 views
in Technique[技术] by (71.8m points)

sonarqube - Sonar-scanner hangs after 'Load active rules (done)' is shown in the logs

The tail of logging shows the following:

22:09:11.016 DEBUG: GET 200 http://someserversomewhere:9000/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AXaXXXXXXXXXXXXXXXw0&ps=500&p=1 | time=427ms
22:09:11.038 INFO: Load active rules (done) | time=12755ms

I have mounted the running container to see if the scanner process is pegged/running/etc and it shows the following:

Mem: 2960944K used, 106248K free, 67380K shrd, 5032K buff, 209352K cached
CPU:   0% usr   0% sys   0% nic  99% idle   0% io   0% irq   0% sirq
Load average: 5.01 5.03 4.83 1/752 46
  PID  PPID USER     STAT   VSZ %VSZ CPU %CPU COMMAND
    1     0 root     S    3811m 127%   1   0% /opt/java/openjdk/bin/java -Djava.awt.headless=true -classpath /opt/sonar-scanner/lib/sonar-scann
   40     0 root     S     2424   0%   0   0% bash
   46    40 root     R     1584   0%   0   0% top

I was unable to find any logging in the sonar-scanner-cli container to help indicate the state. It appears to just be hung and waiting for something to happen.

I am running Sonarqube locally from docker at the lts version 7.9.5 I am also running the docker container sonarsource:sonar-scanner-cli which is currently using the following version in the Dockerfile.

SONAR_SCANNER_VERSION=4.5.0.2216

I am triggering the scan via the following command:

  docker run --rm 
      -e SONAR_HOST_URL="http://someserversomewhere:9000" 
      -e SONAR_LOGIN="nottherealusername" 
      -e SONAR_PASSWORD="not12345likeinspaceballs" 

      -v "$DOCKER_TEST_DIRECTORY:/usr/src" 
      --link "myDockerContainerNameForSonarQube" 
      sonarsource/sonar-scanner-cli -X -Dsonar.password=not12345likeinspaceballs -Dsonar.verbose=true 
      -Dsonar.sources=app -Dsonar.tests=test -Dsonar.branch=master 
      -Dsonar.projectKey="${PROJECT_KEY}" -Dsonar.log.level=TRACE 
      -Dsonar.projectBaseDir=/usr/src/$PROJECT_NAME -Dsonar.working.directory=/usr/src/$PROJECT_NAME/$SCANNER_WORK_DIR

I have done a lot of digging to try to find anyone with similar issues and found the following older issue which seems to be similar but it is unclear how to determine if I am experiencing something related. Why does sonar-maven-plugin hang at loading global settings or active rules?

I am stuck and not sure what to do next any help or hints would be appreciated.

Additional note is that this process does work for the 8.4.2-developer version of Sonarqube that I am planning migrate to. The purpose of verifying 7.9.5 is to follow the recommended upgrade path from Sonarqube that recommends the interim step of first bringing your current version to the latest LTS then running the data migration before jumping to the next major version.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...