9172facb-d232-4b81-9eb0-9e264eae7d82
SonarQube 품질 게이트가 실패하여 파이프라인이 품질 기준을 통과하지 못했습니다.
SonarScanner 실행 중 품질 게이트 검증 단계에서 'QUALITY GATE STATUS: FAILED' 메시지가 출력되었습니다. 이는 코드 자체의 컴파일이나 런타임 오류가 아니라 정적 분석 결과(예: 커버리지 부족, 규칙 위반 등)에서 정의된 품질 기준을 충족하지 못했음을 의미합니다. 파이프라인은 catchError로 오류를 잡아 전체 빌드는 SUCCESS로 표시되었지만, 품질 게이트 실패는 배포 전 검증 단계에서 차단됩니다. 해당 프로젝트의 SonarQube 대시보드에서 구체적인 위반 항목을 확인하고 수정해야 합니다.
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)
Commit message: "initial commit: counter app"
> 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
> 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:47:45.706 INFO Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
06:47:45.711 INFO Project root configuration file: /usr/src/sonar-project.properties
06:47:45.732 INFO SonarScanner CLI 8.0.1.6346
06:47:45.739 INFO Linux 6.1.168-203.330.amzn2023.x86_64 amd64
06:47:47.959 INFO Communicating with SonarQube Server 9.9.8.100196
06:47:50.667 INFO Load global settings
06:47:50.888 INFO Load global settings (done) | time=223ms
06:47:50.894 INFO Server id: 1ACAD261-AZ45x0zDrrHhR2tnhNFS
06:47:50.907 INFO User cache: /opt/sonar-scanner/.sonar/cache
06:47:50.918 INFO Load/download plugins
06:47:50.918 INFO Load plugins index
06:47:50.985 INFO Load plugins index (done) | time=67ms
06:47:53.817 INFO Load/download plugins (done) | time=2900ms
06:47:54.656 INFO Process project properties
06:47:54.668 INFO Process project properties (done) | time=12ms
06:47:54.674 INFO Execute project builders
06:47:54.676 INFO Execute project builders (done) | time=2ms
06:47:54.682 INFO Project key: counter-app-dirty
06:47:54.682 INFO Base dir: /usr/src
06:47:54.682 INFO Working dir: /tmp/.scannerwork
06:47:54.701 INFO Load project settings for component key: 'counter-app-dirty'
06:47:54.733 INFO Load project settings for component key: 'counter-app-dirty' (done) | time=32ms
06:47:54.977 INFO Load quality profiles
06:47:55.098 INFO Load quality profiles (done) | time=121ms
06:47:55.127 INFO Load active rules
06:47:58.443 INFO Load active rules (done) | time=3315ms
06:47:58.449 INFO Load analysis cache
06:47:58.467 INFO Load analysis cache (1.6 kB) | time=18ms
06:47:58.568 INFO Load project repositories
06:47:58.592 INFO Load project repositories (done) | time=24ms
06:47:58.643 INFO Indexing files...
06:47:58.644 INFO Project configuration:
06:47:58.645 INFO Excluded sources: Dockerfile, Jenkinsfile, **/*.md
06:47:58.819 INFO 3 files indexed
06:47:58.820 INFO 2 files ignored because of inclusion/exclusion patterns
06:47:58.821 INFO 0 files ignored because of scm ignore settings
06:47:58.824 INFO Quality profile for py: variable-naming-sample
06:47:58.824 INFO ------------- Run sensors on module Counter App (dirty)
06:47:58.980 INFO Load metrics repository
06:47:59.032 INFO Load metrics repository (done) | time=52ms
06:48:01.096 INFO Sensor Python Sensor [python]
06:48:01.101 WARN No explicit support for version 3.12. Python version has been set to 3.10.
06:48:01.138 INFO Starting global symbols computation
06:48:01.152 INFO 1 source file to be analyzed
06:48:01.650 INFO 1/1 source file has been analyzed
06:48:01.742 INFO Starting rules execution
06:48:01.755 INFO 1 source file to be analyzed
06:48:02.010 INFO 1/1 source file has been analyzed
06:48:02.011 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:48:02.011 INFO Sensor Python Sensor [python] (done) | time=916ms
06:48:02.011 INFO Sensor Cobertura Sensor for Python coverage [python]
06:48:02.022 INFO Sensor Cobertura Sensor for Python coverage [python] (done) | time=11ms
06:48:02.023 INFO Sensor PythonXUnitSensor [python]
06:48:02.026 INFO Sensor PythonXUnitSensor [python] (done) | time=3ms
06:48:02.031 INFO Sensor JaCoCo XML Report Importer [jacoco]
06:48:02.033 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:48:02.034 INFO No report imported, no coverage information will be imported by JaCoCo XML Report Importer
06:48:02.034 INFO Sensor JaCoCo XML Report Importer [jacoco] (done) | time=3ms
06:48:02.034 INFO Sensor CSS Rules [javascript]
06:48:02.039 INFO No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
06:48:02.040 INFO Sensor CSS Rules [javascript] (done) | time=6ms
06:48:02.040 INFO Sensor C# Project Type Information [csharp]
06:48:02.041 INFO Sensor C# Project Type Information [csharp] (done) | time=1ms
06:48:02.042 INFO Sensor C# Analysis Log [csharp]
06:48:02.067 INFO Sensor C# Analysis Log [csharp] (done) | time=25ms
06:48:02.075 INFO Sensor C# Properties [csharp]
06:48:02.078 INFO Sensor C# Properties [csharp] (done) | time=5ms
06:48:02.079 INFO Sensor HTML [web]
06:48:02.085 INFO Sensor HTML [web] (done) | time=6ms
06:48:02.085 INFO Sensor TextAndSecretsSensor [text]
06:48:02.123 INFO 1 source file to be analyzed
06:48:02.130 INFO 1/1 source file has been analyzed
06:48:02.131 INFO Sensor TextAndSecretsSensor [text] (done) | time=46ms
06:48:02.131 INFO Sensor VB.NET Project Type Information [vbnet]
06:48:02.142 INFO Sensor VB.NET Project Type Information [vbnet] (done) | time=10ms
06:48:02.144 INFO Sensor VB.NET Analysis Log [vbnet]
06:48:02.171 INFO Sensor VB.NET Analysis Log [vbnet] (done) | time=27ms
06:48:02.173 INFO Sensor VB.NET Properties [vbnet]
06:48:02.173 INFO Sensor VB.NET Properties [vbnet] (done) | time=0ms
06:48:02.174 INFO Sensor IaC Docker Sensor [iac]
06:48:02.192 INFO 0 source files to be analyzed
06:48:02.260 INFO 0/0 source files have been analyzed
06:48:02.260 INFO Sensor IaC Docker Sensor [iac] (done) | time=86ms
06:48:02.264 INFO ------------- Run sensors on project
06:48:02.457 INFO Sensor Analysis Warnings import [csharp]
06:48:02.458 INFO Sensor Analysis Warnings import [csharp] (done) | time=1ms
06:48:02.459 INFO Sensor Zero Coverage Sensor
06:48:02.467 INFO Sensor Zero Coverage Sensor (done) | time=8ms
06:48:02.530 INFO CPD Executor Calculating CPD for 1 file
06:48:02.583 INFO CPD Executor CPD calculation finished (done) | time=27ms
06:48:02.802 INFO Analysis report generated in 203ms, dir size=116.1 kB
06:48:02.820 INFO Analysis report compressed in 17ms, zip size=18.0 kB
06:48:02.883 INFO Analysis report uploaded in 62ms
06:48:02.886 INFO ------------- Check Quality Gate status
06:48:02.887 INFO Waiting for the analysis report to be processed (max 300s)
06:48:08.121 INFO EXECUTION FAILURE
06:48:08.122 INFO Total time: 22.421s
06:48:08.122 ERROR Error during SonarScanner CLI execution
06:48:08.122 ERROR QUALITY GATE STATUS: FAILED - View details on https://sonar.architecture-service-center.cloud/dashboard?id=counter-app-dirty
06:48:08.123 ERROR
06:48:08.125 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:11 -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 [2/5] WORKDIR /app
#6 CACHED
#7 [3/5] COPY requirements.txt .
#7 CACHED
#8 [4/5] RUN pip install --no-cache-dir -r requirements.txt
#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:11 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
cb962f9062db92851cbd3a7365fcbc6a4f923fecba123072e7620df40796d866
+ sleep 3
+ docker ps --filter name=counter-app-dirty
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
cb962f9062db 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/11/",
"buildNumber": 11,
"jiraIssueKey": "TEST-6",
"consoleLogUrl": "https://jenkins.architecture-service-center.cloud/job/counter-app-dirty-pipeline/11/consoleText"
}