Hello,
I’m having problems with performing SonarQube analysis on Jenkins and I can’t figure out how to fix it.
When the workflow reaches the SonarQube analysis
step, it just hangs indefinitely until it hits the timeout.
Setup:
I’m hosting my Jenkins server on an EC2 t2 micro instance, the cloud agents are setup as 2 Lambda functions.
Additional notes:
- I’m not using a reverse proxy
- security groups of the instance allow HTTPS and HTTP traffic
- the agents run Java11 and are able to perform any non-sonarqube type of jobs
- I have enabled
Inbound TCP Agent Protocol/4 (TLS encryption
- I have enabled
50000 TCP port for inbound agents
(required for the Lambda connections)
Observations:
- when I attempt to ping the SonarCloud domain from the agent, I don’t receive any response (possible network issue?)
- Jenkins system logs are not showing any errors
Console log:
process apparently never started in /tmp/workspace/multi_feat_django-app-controller@tmp/durable-013b3b48
(running Jenkins temporarily with -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_DIAGNOSTICS=true might make the problem clearer)
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Quality Gate)
Stage "Quality Gate" skipped due to earlier failure(s)
[Pipeline] getContext
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code -2
GitHub has been notified of this commit’s build result
Finished: FAILURE
Jenkins declaration:
pipeline {
agent any
options {
disableConcurrentBuilds()
}
stages {
stage('Git checkout') {
agent { label 'lambda-java'}
steps {
git branch: env.BRANCH_NAME , url: 'https://github.com/IliyanKostov9/portfolio.git'
}
}
stage("SonarQube analysis") {
agent { label 'lambda-java'}
environment {
scannerHome = tool 'SonarTool';
}
steps {
script {
withSonarQubeEnv(installationName: 'SonarCloud', credentialsId: '8049a509-1e79-4369-8240-2f413248d607') {
sh "${scannerHome}/bin/sonar-scanner"
}
}
}
}
stage("Quality Gate") {
agent { label 'lambda-java'}
steps {
timeout(time: 1, unit: 'HOURS') {
waitForQualityGate abortPipeline: true, credentialsId: 'Sonar-token'
}
}
}
}
}
Any help would be much appreciated!