Required Data: An issue with a Build of a Job in Jenkins X

Issue

  • A job build is not behaving as expected.

Required Data for analysing issues with a particular job (and build)

This article describes how to collect the minimum required information for troubleshooting general issues related to Jenkins X jobs.

If the required data is bigger than 20 MB you will not be able to use ZenDesk to upload all the information. On this case we would like to encourage you to use our upload service in order to attach all the required information.

Environment

Required Data check list

  • Description and Diagnosis of the Jenkins X cluster
  • Time around the issue is exposed
  • The job name and the issued build
  • Status of the steps from the issued build
  • The configuration of the job
  • Last successful and failed build logs

Description and Diagnosis of the Jenkins X cluster

The files jx-diagnose.txt and jenkins-x-details.txt as output from:

$> jx diagnose > jx-diagnose.txt 2>&1
$> jx get addon | tee jenkins-x-details.txt
NAME           CHART                    ENABLED STATUS   VERSION
vault-operator jenkins-x/vault-operator         DEPLOYED 0.3.1
$> helm list -a | tee -a jenkins-x-details.txt
...

Time around the issue is exposed

Grab the time around the issue is exposed so it is possible to correlate the build console logs with the other pods from the Jenkins X architecture.

The job name and the issued build

From the output of jx get pipelines the Name, URL, LAST_BUILD and STATUS from the issued build.

$> jx get pipelines
Name                                                               URL LAST_BUILD STATUS DURATION
example-user/java-project/master                                      N/A N/A        N/A    N/A
jx-support-beescloud/environment-support-cjxd-v2-dev/master        N/A N/A        N/A    N/A
jx-support-beescloud/environment-support-cjxd-v2-production/master N/A N/A        N/A    N/A
jx-support-beescloud/environment-support-cjxd-v2-staging/master    N/A N/A        N/A    N/A
jx-support-beescloud/my-imported-ruby-project/master                              N/A N/A        N/A    N/A
jx-support-beescloud/my-example-issued-pipeline/master                 N/A N/A        N/A    N/A

Status of the steps from the issued build

Run the build and get the output from jx get activities

$> jx get activities -f my-example-issued-pipeline -w | tee jenkins-x-activities-my-example-pipeline.txt
STEP                                                       STARTED AGO DURATION STATUS
jx-support-beescloud/my-example-issued-pipeline/master #1      21m30s    2m31s Succeeded Version: 0.0.1
  from build pack                                          21m30s    2m31s Succeeded 
    Credential Initializer 9jr7l                           21m30s       0s Succeeded 
    Working Dir Initializer Vtdrs                          21m29s       0s Succeeded 
    Place Tools                                            21m28s       0s Succeeded 
    Git Source Jx Support Beescloud My First G Blgdn       21m27s       9s Succeeded https://github.com/jx-support-beescloud/my-example-issued-pipeline.git
    Git Merge                                              21m27s       9s Succeeded 
    Setup Jx Git Credentials                               21m26s       9s Succeeded 
    Build Make Build                                       21m26s      24s Succeeded 
    Build Container Build                                  21m23s      32s Succeeded 
    Build Post Build                                       21m22s      31s Succeeded 
    Promote Changelog                                      21m22s      35s Succeeded 
    Promote Helm Release                                   21m21s      39s Succeeded 
    Promote Jx Promote                                     21m21s    2m22s Succeeded 
  Promote: staging                                         20m27s    1m28s Succeeded 
    PullRequest                                            20m27s    1m27s Succeeded  PullRequest: https://github.com/jx-support-beescloud/environment-support-cjxd-v2-staging/pull/1 Merge SHA: aa53d8b6130bcc8c5ae575bc81f7fbe04830b6c1
    Update                                                  19m0s       1s Succeeded 

The configuration of the job

The configuration of the job will consist on

  • Dockerfile to build your application as a docker image
  • Jenkinsfile (jenkins-x.yml) to implement the CI / CD pipeline
  • Helm charts to run your application inside Kubernetes (charts folder)

Failed Build logs

$> jx get build log jx-support-beescloud/my-example-issued-pipeline/pr-2 | tee build-logs.txt
Showing logs for build jx-support-beescloud-environmen-fskgr-1 stage pr and container step-credential-initializer-nn7dp
{"level":"warn","ts":1568737703.7157629,"logger":"fallback-logger","caller":"logging/config.go:69","msg":"Fetch GitHub commit ID from kodata failed: \"ref: refs/heads/master\" is not a valid GitHub commit ID"}
{"level":"info","ts":1568737703.716427,"logger":"fallback-logger","caller":"creds-init/main.go:40","msg":"Credentials initialized."}

Showing logs for build jx-support-beescloud-environmen-fskgr-1 stage pr and container step-working-dir-initializer-m6khw
{"level":"warn","ts":1568737705.0841393,"logger":"fallback-logger","caller":"logging/config.go:69","msg":"Fetch GitHub commit ID from kodata failed: open /var/run/ko/HEAD: no such file or directory"}
{"level":"info","ts":1568737705.086208,"logger":"fallback-logger","caller":"bash/main.go:65","msg":"Successfully executed command \"mkdir -p /workspace/source /workspace/source/env\""}

Showing logs for build jx-support-beescloud-environmen-fskgr-1 stage pr and container step-place-tools
...

Have more questions?

0 Comments

Please sign in to leave a comment.