Required Data: An issue with a Build of a Job

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 jobs.

If the required data is bigger than 50 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

Automatic Data collection

This is the preferred method.

  1. Install and configure cbsupport following Using cbsupport CLI to collect the requested data
  2. Run cbsupport required-data default to gather generic data about your infrastructure and a support bundle.
  3. Run cbsupport required-data item to gather specific data about the job, once for the failing build and once for a working build.
    When asked for the maximum depth, leave the default except if CloudBees Support gave you another value to set.
  4. Collect the archive generated in the working directory of cbsupport and attach it to the ticket using our upload service

Manual Data collection - Required Data check list

  • Time around the issue is exposed
  • A support bundle created when the issue is exposed
  • The full name of the job
  • The configuration of the job
  • Last successful and failed build folders

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 Jenkins master logs when the issue is exposed.

Support Bundle

A support bundle from the problematic instance ideally when the issue is happening, or in the worst case, right after the issue is exposed. Please, follow the KB below in case you don’t know how to generate a support bundle.

The name of the job which is in this situation

Take a note with the full job name which is failing to search for them in the logs.

Example: From the URI of an example job in the browser
http://jenkins.example.com/job/folder.example/job/job.example/ its full name would be folder.example/job.example/.

The configuration of the job

The configuration of the item (config.xml) you are having the issues with from the $JENKINS_HOME/jobs folder.

Exceptionally, when you don’t have access to the filesystem, you can copy the job configuration in an xml file as result of accessing to its /config.xml REST API endpoint.

For example: curl -u $JENKINS_USER:$JENKINS_API_TOKEN -X GET 'http://cloudbees.example.com/job/MyJob/config.xml' -o config.xml

For Pipelines

In the case the Pipeline definition is set as Pipeline Script from SCM, attach also its Jenkinsfile .

For Job based on Templates

Provide also the config.xml of the Template.

Last successful and failed build folders

For comparing and contrasting, we require

  • the build directory of a Successful build
  • the build directory of a Failed build (The job build is not behaving as expected)

See How to get a Build directory ?.

Notes

1.- In the case the build folder cannot be attached, then copy the full console output of each respective build (Successful vs Failed) in separated file and name then accordingly.

2.- For the build you have issue with, it is very recommended you make use of the Timestamper Plugins so we can correlate console logs with others like the jenkins instances or remoting agent.

Have more questions?

0 Comments

Please sign in to leave a comment.