Job stuck on running even after runner terminates correctly
Summary
When running a pipeline, the runner exists correctly but the job gets stuck in "running" state
Steps to reproduce
the runner config:
concurrent = 1
check_interval = 1
[[runners]]
name = "CNWK1N2"
url = "http://git.private.com/"
token = "a03f86cb5a4e6252cb64be4690fa77"
executor = "docker"
[runners.docker]
tls_verify = false
image = "docker:stable"
privileged = true
disable_cache = false
volumes = ["/cache", "C:/Users/Jacinto.Barbeira/.m2:/root/.m2"]
shm_size = 0
The pipeline yaml
stages:
- build
- publish
- deploy
variables:
MAVEN_CLI_OPTS: "--batch-mode"
# MAVEN_OPTS: "-Xmx512m -XX:MaxPermSize=128m"
JACOCO_OPTS: "org.jacoco:jacoco-maven-plugin:prepare-agent -Dmaven.test.failure.ignore=false"
SONAR_OPTS: "sonar:sonar -Dsonar.host.url=$SONAR_URL -Dsonar.login=$SONAR_LOGIN"
DOCKER_DRIVER: overlay2
DOCKER_HOST: "tcp://docker:2375"
cache:
paths:
- target
- implementation/target
image: maven:3.5.3-jdk-8
services:
- name: docker:dind
entrypoint: ["dockerd-entrypoint.sh"]
command: ["--insecure-registry=nexus.private.com:5000"]
#before_script:
# - docker info
#we will not separate all steps of the build phase since Maven is doing the hard work for us
buildservice:
stage: build
script:
- mvn $MAVEN_CLI_OPTS clean $JACOCO_OPTS install
- mvn $MAVEN_CLI_OPTS $SONAR_OPTS
- echo "done"
tags:
- jazz
#the image will be pushed to nexus using the dockerfile-maven-plugin
publishservice:
stage: publish
script:
- mvn $MAVEN_CLI_OPTS deploy
tags:
- jazz
deployservice:
stage: deploy
script: something
image: williamyeh/ansible:mini-alpine3
What is the current bug behavior?
The job gets stuck in running mvn $MAVEN_CLI_OPTS $SONAR_OPTS
What is the expected correct behavior?
the job should terminate and the next job should be started
Relevant logs and/or screenshots
Runner log:
$ mvn $MAVEN_CLI_OPTS $SONAR_OPTS
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] PocService [pom]
[INFO] clients [pom]
[INFO] dtos [jar]
[INFO] implementation [jar]
[INFO] PocService - Remote Client [jar]
[INFO] PocService - Remote Client Test [jar]
[INFO]
[INFO] -------------------< com.private.pocservice:parent >-------------------
[INFO] Building PocService 1.0-SNAPSHOT [1/6]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- sonar-maven-plugin:3.4.0.905:sonar (default-cli) @ parent ---
[INFO] User cache: /root/.sonar/cache
[INFO] SonarQube version: 7.0.0
[INFO] Default locale: "en", source code encoding: "UTF-8"
[INFO] Publish mode
[INFO] Load global settings
[INFO] Load global settings (done) | time=302ms
[INFO] Server id: AWK_4j0YPwefQwGQ4by0
[INFO] User cache: /root/.sonar/cache
[INFO] Load plugins index
[INFO] Load plugins index (done) | time=140ms
[INFO] Load/download plugins
[INFO] Load/download plugins (done) | time=54092ms
[INFO] Process project properties
[INFO] Load project repositories
[INFO] Load project repositories (done) | time=377ms
[INFO] Execute project builders
[INFO] Execute project builders (done) | time=3ms
[INFO] Load quality profiles
[INFO] Load quality profiles (done) | time=84ms
[INFO] Load active rules
[INFO] Load active rules (done) | time=2212ms
[INFO] Load metrics repository
[INFO] Load metrics repository (done) | time=80ms
[INFO] Project key: com.private.pocservice:parent
[INFO] ------------- Scan implementation
[INFO] Load server rules
[INFO] Load server rules (done) | time=735ms
[INFO] Base dir: /builds/pocservice/pocservice/implementation
[INFO] Working dir: /builds/pocservice/pocservice/implementation/target/sonar
[INFO] Source paths: pom.xml, src/main/java
[INFO] Source encoding: UTF-8, default locale: en
[INFO] Index files
[INFO] 4 files indexed
[INFO] Quality profile for java: Private Way
[INFO] Quality profile for xml: Sonar way
[INFO] Sensor JavaSquidSensor [java]
[INFO] Configured Java source version (sonar.java.source): 8
[INFO] JavaClasspath initialization
[INFO] JavaClasspath initialization (done) | time=722ms
[INFO] JavaTestClasspath initialization
[INFO] JavaTestClasspath initialization (done) | time=151ms
[INFO] Java Main Files AST scan
[INFO] 3 source files to be analyzed
[INFO] 3/3 source files have been analyzed
[WARNING] Classes not found during the analysis : [javax.annotation.meta.When]
[INFO] Java Main Files AST scan (done) | time=1345ms
[INFO] Java Test Files AST scan
[INFO] 0 source files to be analyzed
[INFO] 0/0 source files have been analyzed
[INFO] Java Test Files AST scan (done) | time=65ms
[INFO] Sensor JavaSquidSensor [java] (done) | time=4445ms
[INFO] Sensor SurefireSensor [java]
[INFO] parsing [/builds/pocservice/pocservice/implementation/target/surefire-reports]
[ERROR] Reports path not found or is not a directory: /builds/pocservice/pocservice/implementation/target/surefire-reports
[INFO] Sensor SurefireSensor [java] (done) | time=31ms
[INFO] Sensor JaCoCoSensor [java]
[INFO] Sensor JaCoCoSensor [java] (done) | time=2ms
[INFO] Sensor SonarJavaXmlFileSensor [java]
[INFO] 1 source files to be analyzed
[INFO] 1/1 source files have been analyzed
[INFO] Sensor SonarJavaXmlFileSensor [java] (done) | time=1129ms
[INFO] Sensor XML Sensor [xml]
[INFO] Sensor XML Sensor [xml] (done) | time=223ms
[INFO] ------------- Scan PocService - Remote Client
[INFO] Base dir: /builds/pocservice/pocservice/clients/pocservice-remote-client
[INFO] Working dir: /builds/pocservice/pocservice/clients/pocservice-remote-client/target/sonar
[INFO] Source paths: pom.xml
[INFO] Source encoding: UTF-8, default locale: en
[INFO] Index files
[INFO] 1 file indexed
[INFO] Quality profile for xml: Sonar way
[INFO] Sensor SonarJavaXmlFileSensor [java]
[INFO] 1 source files to be analyzed
[INFO] Sensor SonarJavaXmlFileSensor [java] (done) | time=156ms
[INFO] 1/1 source files have been analyzed
[INFO] Sensor XML Sensor [xml]
[INFO] Sensor XML Sensor [xml] (done) | time=48ms
[INFO] ------------- Scan dtos
[INFO] Base dir: /builds/pocservice/pocservice/clients/dtos
[INFO] Working dir: /builds/pocservice/pocservice/clients/dtos/target/sonar
[INFO] Source paths: pom.xml
[INFO] Source encoding: UTF-8, default locale: en
[INFO] Index files
[INFO] 1 file indexed
[INFO] Quality profile for xml: Sonar way
[INFO] Sensor SonarJavaXmlFileSensor [java]
[INFO] 1 source files to be analyzed
[INFO] 1/1 source files have been analyzed
[INFO] Sensor SonarJavaXmlFileSensor [java] (done) | time=112ms
[INFO] Sensor XML Sensor [xml]
[INFO] Sensor XML Sensor [xml] (done) | time=23ms
[INFO] ------------- Scan PocService - Remote Client Test
[INFO] Base dir: /builds/pocservice/pocservice/clients/pocservice-remote-client-test
[INFO] Working dir: /builds/pocservice/pocservice/clients/pocservice-remote-client-test/target/sonar
[INFO] Source paths: pom.xml
[INFO] Source encoding: UTF-8, default locale: en
[INFO] Index files
[INFO] 1 file indexed
[INFO] Quality profile for xml: Sonar way
[INFO] Sensor SonarJavaXmlFileSensor [java]
[INFO] 1 source files to be analyzed
[INFO] 1/1 source files have been analyzed
[INFO] Sensor SonarJavaXmlFileSensor [java] (done) | time=89ms
[INFO] Sensor XML Sensor [xml]
[INFO] Sensor XML Sensor [xml] (done) | time=41ms
[INFO] ------------- Scan clients
[INFO] Base dir: /builds/pocservice/pocservice/clients
[INFO] Working dir: /builds/pocservice/pocservice/clients/target/sonar
[INFO] Source paths: pom.xml
[INFO] Source encoding: UTF-8, default locale: en
[INFO] Index files
[INFO] 1 file indexed
[INFO] Quality profile for xml: Sonar way
[INFO] Sensor SonarJavaXmlFileSensor [java]
[INFO] 1 source files to be analyzed
[INFO] 1/1 source files have been analyzed
[INFO] Sensor SonarJavaXmlFileSensor [java] (done) | time=90ms
[INFO] Sensor XML Sensor [xml]
[INFO] Sensor XML Sensor [xml] (done) | time=13ms
[INFO] ------------- Scan PocService
[INFO] Base dir: /builds/pocservice/pocservice
[INFO] Working dir: /builds/pocservice/pocservice/target/sonar
[INFO] Source paths: pom.xml
[INFO] Source encoding: UTF-8, default locale: en
[INFO] Index files
[INFO] 1 file indexed
[INFO] Quality profile for xml: Sonar way
[INFO] Sensor SonarJavaXmlFileSensor [java]
[INFO] 1 source files to be analyzed
[INFO] 1/1 source files have been analyzed
[INFO] Sensor SonarJavaXmlFileSensor [java] (done) | time=125ms
[INFO] Sensor XML Sensor [xml]
[INFO] Sensor XML Sensor [xml] (done) | time=24ms
[INFO] Sensor Zero Coverage Sensor
[INFO] Sensor Zero Coverage Sensor (done) | time=48ms
[INFO] Sensor CPD Block Indexer
[INFO] Sensor CPD Block Indexer (done) | time=30ms
[INFO] Calculating CPD for 3 files
[INFO] CPD calculation finished
[INFO] Analysis report generated in 191ms, dir size=88 KB
[INFO] Analysis reports compressed in 58ms, zip size=30 KB
[INFO] Analysis report uploaded in 221ms
[INFO] ANALYSIS SUCCESSFUL, you can browse http://sonar.PRivate.com/dashboard/index/com.Private.pocservice:parent
[INFO] Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
[INFO] More about the report processing at http://sonar.Private.com/api/ce/task?id=AWPvDUQqQ2-3-0iBsRes
[INFO] Task total time: 14.489 s
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] PocService 1.0-SNAPSHOT ............................ SUCCESS [01:47 min]
[INFO] clients ............................................ SKIPPED
[INFO] dtos ............................................... SKIPPED
[INFO] implementation ..................................... SKIPPED
[INFO] PocService - Remote Client ......................... SKIPPED
[INFO] PocService - Remote Client Test 1.0-SNAPSHOT ....... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:51 min
[INFO] Finished at: 2018-06-11T13:33:31Z
[INFO] ------------------------------------------------------------------------
$ echo "done"
done
Job Log:
$ mvn $MAVEN_CLI_OPTS $SONAR_OPTS
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] PocService [pom]
[INFO] clients [pom]
[INFO] dtos [jar]
[INFO] implementation [jar]
[INFO] PocService - Remote Client [jar]
[INFO] PocService - Remote Client Test [jar]
[INFO]
[INFO] -------------------< com.Private.pocservice:parent >-------------------
[INFO] Building PocService 1.0-SNAPSHOT [1/6]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- sonar-maven-plugin:3.4.0.905:sonar (default-cli) @ parent ---
[INFO] User cache: /root/.sonar/cache
[INFO] SonarQube version: 7.0.0
[INFO] Default locale: "en", source code encoding: "UTF-8"
[INFO] Publish mode
[INFO] Load global settings
[INFO] Load global settings (done) | time=302ms
[INFO] Server id: AWK_4j0YPwefQwGQ4by0
[INFO] User cache: /root/.sonar/cache
[INFO] Load plugins index
[INFO] Load plugins index (done) | time=140ms
[INFO] Load/download plugins
/label gitlab-ce~2278648
Edited by Jacinto Barbeira