c7304006-95c8-4bdf-81ba-a114c52cc0fa
SonarQube 품질 게이트가 실패하여 빌드가 정적 품질 기준을 충족하지 못했습니다.
SonarScanner 실행 중 품질 게이트 검증 단계에서 FAIL 상태가 반환되었습니다. 이는 코드 자체의 런타임 오류가 아니라 정적 분석 결과(예: 커버리지 부족, 규칙 위반 등)로 인해 품질 기준을 만족하지 못했기 때문입니다. Jenkins 파이프라인은 catchError 구문으로 오류를 잡아 전체 빌드 결과를 SUCCESS로 처리했지만, 품질 게이트 실패는 여전히 보고됩니다.
개발자는 SonarQube 대시보드에서 실패 원인을 확인하고, 커버리지, 규칙 위반 등 정적 품질 문제를 해결한 뒤 다시 스캔해야 합니다.
Started by user admin
[Pipeline] Start of Pipeline
[Pipeline] node
Running on build-agent in /home/ec2-user/jenkins-agent/workspace/counter-app-dirty-pipeline
[Pipeline] {
[Pipeline] withEnv
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Checkout)
[Pipeline] git
The recommended git tool is: NONE
using credential gitlab-cred
Fetching changes from the remote Git repository
> git rev-parse --resolve-git-dir /home/ec2-user/jenkins-agent/workspace/counter-app-dirty-pipeline/.git # timeout=10
> git config remote.origin.url https://gitlab.architecture-service-center.cloud/root/counter-app-dirty.git # timeout=10
Fetching upstream changes from https://gitlab.architecture-service-center.cloud/root/counter-app-dirty.git
> git --version # timeout=10
> git --version # 'git version 2.50.1'
using GIT_ASKPASS to set credentials GitLab root + PAT
> git fetch --tags --force --progress -- https://gitlab.architecture-service-center.cloud/root/counter-app-dirty.git +refs/heads/*:refs/remotes/origin/* # timeout=10
Checking out Revision e7f93ac5bfdeb19364e385c0059fc00767dcc1f4 (refs/remotes/origin/main)
> git rev-parse refs/remotes/origin/main^{commit} # timeout=10
> git config core.sparsecheckout # timeout=10
> git checkout -f e7f93ac5bfdeb19364e385c0059fc00767dcc1f4 # timeout=10
> git branch -a -v --no-abbrev # timeout=10
> git branch -D main # timeout=10
> git checkout -b main e7f93ac5bfdeb19364e385c0059fc00767dcc1f4 # timeout=10
Commit message: "initial commit: counter app"
> git rev-list --no-walk e7f93ac5bfdeb19364e385c0059fc00767dcc1f4 # timeout=10
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (SonarQube Analysis)
[Pipeline] catchError
[Pipeline] {
[Pipeline] withCredentials
Masking supported pattern matches of $SONAR_TOKEN
[Pipeline] {
[Pipeline] sh
+ docker run --rm -e SONAR_HOST_URL=https://sonar.architecture-service-center.cloud -e SONAR_TOKEN=**** -v /home/ec2-user/jenkins-agent/workspace/counter-app-dirty-pipeline:/usr/src sonarsource/sonar-scanner-cli -Dsonar.qualitygate.wait=true
06:37:06.503 INFO Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
06:37:06.508 INFO Project root configuration file: /usr/src/sonar-project.properties
06:37:06.530 INFO SonarScanner CLI 8.0.1.6346
06:37:06.538 INFO Linux 6.1.168-203.330.amzn2023.x86_64 amd64
06:37:08.821 INFO Communicating with SonarQube Server 9.9.8.100196
06:37:11.212 INFO Load global settings
06:37:11.449 INFO Load global settings (done) | time=239ms
06:37:11.452 INFO Server id: 1ACAD261-AZ45x0zDrrHhR2tnhNFS
06:37:11.458 INFO User cache: /opt/sonar-scanner/.sonar/cache
06:37:11.463 INFO Load/download plugins
06:37:11.463 INFO Load plugins index
06:37:11.526 INFO Load plugins index (done) | time=63ms
06:37:13.729 INFO Load/download plugins (done) | time=2266ms
06:37:14.539 INFO Process project properties
06:37:14.551 INFO Process project properties (done) | time=12ms
06:37:14.559 INFO Execute project builders
06:37:14.562 INFO Execute project builders (done) | time=3ms
06:37:14.568 INFO Project key: counter-app-dirty
06:37:14.568 INFO Base dir: /usr/src
06:37:14.569 INFO Working dir: /tmp/.scannerwork
06:37:14.589 INFO Load project settings for component key: 'counter-app-dirty'
06:37:14.638 INFO Load project settings for component key: 'counter-app-dirty' (done) | time=48ms
06:37:14.860 INFO Load quality profiles
06:37:14.944 INFO Load quality profiles (done) | time=84ms
06:37:14.972 INFO Load active rules
06:37:18.878 INFO Load active rules (done) | time=3906ms
06:37:18.884 INFO Load analysis cache
06:37:18.902 INFO Load analysis cache (1.6 kB) | time=18ms
06:37:19.019 INFO Load project repositories
06:37:19.043 INFO Load project repositories (done) | time=24ms
06:37:19.123 INFO Indexing files...
06:37:19.124 INFO Project configuration:
06:37:19.125 INFO Excluded sources: Dockerfile, Jenkinsfile, **/*.md
06:37:19.306 INFO 3 files indexed
06:37:19.306 INFO 2 files ignored because of inclusion/exclusion patterns
06:37:19.306 INFO 0 files ignored because of scm ignore settings
06:37:19.309 INFO Quality profile for py: variable-naming-sample
06:37:19.309 INFO ------------- Run sensors on module Counter App (dirty)
06:37:19.484 INFO Load metrics repository
06:37:19.566 INFO Load metrics repository (done) | time=82ms
06:37:21.513 INFO Sensor Python Sensor [python]
06:37:21.518 WARN No explicit support for version 3.12. Python version has been set to 3.10.
06:37:21.555 INFO Starting global symbols computation
06:37:21.578 INFO 1 source file to be analyzed
06:37:21.997 INFO 1/1 source file has been analyzed
06:37:22.028 INFO Starting rules execution
06:37:22.030 INFO 1 source file to be analyzed
06:37:22.157 INFO 1/1 source file has been analyzed
06:37:22.157 INFO The Python analyzer was able to leverage cached data from previous analyses for 0 out of 1 files. These files were not parsed.
06:37:22.158 INFO Sensor Python Sensor [python] (done) | time=646ms
06:37:22.158 INFO Sensor Cobertura Sensor for Python coverage [python]
06:37:22.162 INFO Sensor Cobertura Sensor for Python coverage [python] (done) | time=4ms
06:37:22.163 INFO Sensor PythonXUnitSensor [python]
06:37:22.166 INFO Sensor PythonXUnitSensor [python] (done) | time=3ms
06:37:22.166 INFO Sensor JaCoCo XML Report Importer [jacoco]
06:37:22.167 INFO 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
06:37:22.168 INFO No report imported, no coverage information will be imported by JaCoCo XML Report Importer
06:37:22.168 INFO Sensor JaCoCo XML Report Importer [jacoco] (done) | time=2ms
06:37:22.168 INFO Sensor CSS Rules [javascript]
06:37:22.169 INFO No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
06:37:22.169 INFO Sensor CSS Rules [javascript] (done) | time=1ms
06:37:22.169 INFO Sensor C# Project Type Information [csharp]
06:37:22.170 INFO Sensor C# Project Type Information [csharp] (done) | time=1ms
06:37:22.170 INFO Sensor C# Analysis Log [csharp]
06:37:22.191 INFO Sensor C# Analysis Log [csharp] (done) | time=21ms
06:37:22.191 INFO Sensor C# Properties [csharp]
06:37:22.192 INFO Sensor C# Properties [csharp] (done) | time=1ms
06:37:22.192 INFO Sensor HTML [web]
06:37:22.194 INFO Sensor HTML [web] (done) | time=2ms
06:37:22.194 INFO Sensor TextAndSecretsSensor [text]
06:37:22.210 INFO 1 source file to be analyzed
06:37:22.213 INFO 1/1 source file has been analyzed
06:37:22.214 INFO Sensor TextAndSecretsSensor [text] (done) | time=20ms
06:37:22.214 INFO Sensor VB.NET Project Type Information [vbnet]
06:37:22.215 INFO Sensor VB.NET Project Type Information [vbnet] (done) | time=1ms
06:37:22.215 INFO Sensor VB.NET Analysis Log [vbnet]
06:37:22.230 INFO Sensor VB.NET Analysis Log [vbnet] (done) | time=15ms
06:37:22.230 INFO Sensor VB.NET Properties [vbnet]
06:37:22.230 INFO Sensor VB.NET Properties [vbnet] (done) | time=0ms
06:37:22.230 INFO Sensor IaC Docker Sensor [iac]
06:37:22.237 INFO 0 source files to be analyzed
06:37:22.307 INFO 0/0 source files have been analyzed
06:37:22.307 INFO Sensor IaC Docker Sensor [iac] (done) | time=77ms
06:37:22.311 INFO ------------- Run sensors on project
06:37:22.403 INFO Sensor Analysis Warnings import [csharp]
06:37:22.404 INFO Sensor Analysis Warnings import [csharp] (done) | time=1ms
06:37:22.406 INFO Sensor Zero Coverage Sensor
06:37:22.415 INFO Sensor Zero Coverage Sensor (done) | time=9ms
06:37:22.428 INFO CPD Executor Calculating CPD for 1 file
06:37:22.435 INFO CPD Executor CPD calculation finished (done) | time=7ms
06:37:22.562 INFO Analysis report generated in 122ms, dir size=116.1 kB
06:37:22.577 INFO Analysis report compressed in 14ms, zip size=18.0 kB
06:37:22.616 INFO Analysis report uploaded in 38ms
06:37:22.618 INFO ------------- Check Quality Gate status
06:37:22.619 INFO Waiting for the analysis report to be processed (max 300s)
06:37:27.716 INFO EXECUTION FAILURE
06:37:27.717 INFO Total time: 21.219s
06:37:27.717 ERROR Error during SonarScanner CLI execution
06:37:27.717 ERROR QUALITY GATE STATUS: FAILED - View details on https://sonar.architecture-service-center.cloud/dashboard?id=counter-app-dirty
06:37:27.718 ERROR
06:37:27.718 ERROR Re-run SonarScanner CLI using the -X switch to enable full debug logging.
[Pipeline] }
[Pipeline] // withCredentials
[Pipeline] }
ERROR: script returned exit code 2
[Pipeline] // catchError
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Docker Build)
[Pipeline] sh
+ docker build -t counter-app-dirty:10 -t counter-app-dirty:latest .
#0 building with "default" instance using docker driver
#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 255B done
#1 DONE 0.0s
#2 [internal] load metadata for docker.io/library/python:3.12-slim
#2 DONE 0.9s
#3 [internal] load .dockerignore
#3 transferring context: 2B done
#3 DONE 0.0s
#4 [internal] load build context
#4 transferring context: 173B done
#4 DONE 0.0s
#5 [1/5] FROM docker.io/library/python:3.12-slim@sha256:090ba77e2958f6af52a5341f788b50b032dd4ca28377d2893dcf1ecbdfdfe203
#5 resolve docker.io/library/python:3.12-slim@sha256:090ba77e2958f6af52a5341f788b50b032dd4ca28377d2893dcf1ecbdfdfe203 0.0s done
#5 DONE 0.0s
#6 [3/5] COPY requirements.txt .
#6 CACHED
#7 [4/5] RUN pip install --no-cache-dir -r requirements.txt
#7 CACHED
#8 [2/5] WORKDIR /app
#8 CACHED
#9 [5/5] COPY app.py .
#9 CACHED
#10 exporting to image
#10 exporting layers done
#10 writing image sha256:6f7123dde2a1fcbc537d472c62e12651102a701fb1e9eccdf6a38f9df9cc61af done
#10 naming to docker.io/library/counter-app-dirty:10 done
#10 naming to docker.io/library/counter-app-dirty:latest done
#10 DONE 0.0s
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Deploy to Target)
[Pipeline] sh
+ docker rm -f counter-app-dirty
counter-app-dirty
+ docker run -d --name counter-app-dirty --restart unless-stopped -p 8082:5000 counter-app-dirty:latest
e20c7247a42d99565d18154cf765b67eb4b4d48460d3b1d5333edc34ef9d12c2
+ sleep 3
+ docker ps --filter name=counter-app-dirty
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e20c7247a42d counter-app-dirty:latest "python app.py" 4 seconds ago Up 3 seconds 0.0.0.0:8082->5000/tcp, :::8082->5000/tcp counter-app-dirty
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Declarative: Post Actions)
[Pipeline] script
[Pipeline] {
[Pipeline] writeFile
[Pipeline] }
[Pipeline] // script
[Pipeline] sh
{
"result": "SUCCESS",
"jobName": "counter-app-dirty-pipeline",
"buildUrl": "https://jenkins.architecture-service-center.cloud/job/counter-app-dirty-pipeline/10/",
"buildNumber": 10,
"jiraIssueKey": "TEST-6",
"consoleLogUrl": "https://jenkins.architecture-service-center.cloud/job/counter-app-dirty-pipeline/10/consoleText"
}