Required Data: Hang Issue On Windows

Article ID:115000721711
3 minute readKnowledge base

Issue

A specific job or your Jenkins environment hangs or responds slowly.

Required Data: Hang Issue On Windows

This article describes how to collect the minimum required information for performance issues on a CJP environment so that it can be efficently troubleshooted.

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

  • CloudBees Jenkins Platform (CJP)

  • Operations Center (OC)

  • Client controller (CM)

Required Data check list

[ ] Support bundle [ ] Output of the script getThreadDumps.bat - jstack.PID.zip file [ ] GC log file for review

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.

Follow the knowledge base article below in case you don’t know how to generate a support bundle.

Please, enable at minimum the following checks: System properties, controller Log Recorders, Garbage Collection Logs, Slow Request Records, Out Of Memory Errors, controller Heap Histogram, Deadlock Records, Thread dumps of running Pipeline builds and Thread dumps.

  • [What is a support-bundle and how to create one][]

Output of the script getThreadDumps.bat

Download the getThreadDumps.bat.

Place the getThreadDumps.bat file in a local directory of your choosing.

The screen shot below uses C:\Users\Administrator\Downloads\getThreadDumpsFolder as an example, it is not required to save the getThreadDumps.bat script there.

getThreadDumps.png

While the issue is occurring do the following:

  • Open a command window and navigate to the directory where getThreadDumps.bat was saved to.

  • Start the getThreadDumps.bat script by running: getThreadDumps.bat PID .

Please note the following requirements for the getThreadDumps.bat script to work as expected:

*All scripts MUST be run as a user with Administrator privileges, i.e. from a command window that was opened via Run As Administrator.

  • jstack is only included in the command is only available in the Java JDK not the Java JRE.

  • The script has to be run as the same user that owns the Jenkins process. This is due to the requirement for jstack that requires it to be run as the same user that owns the process.

  • If Jenkins is running as the SYSTEM user, which is the default user if the product was installed using the Windows Installer Package, PLEASE NOTE that you will need to use the psexec command as shown in the example below. If the pstools directory is not on the path then you will need to use the fully qualified path to the psexec command. The fully qualified path to the getThreadDumps.bat command must be used. The jstack.PID.zip file will be located in C:\Windows\System32 .

      psexec -s C:\Users\Administrator\Downloads\getThreadDumpsFolder\getThreadDumps.bat 2364
  • Please see the Required Data: High CPU On Windows KB Article for instructions to download and set up PSTools, which contains the psexec command.

  • PID is the process id of the Jenkins process. The PID can be determined using the Task Manager as shown in the screen shot below. Note that you have to add the PID column by selecting View->Select Columns->clicking PID(Process Identifer)-> clicking OK

windowsTaskManagerScreenShot.png
  • The JAVA_HOME environment variable should be set for these scripts to work as expected, otherwise they will need to be modified to use the fully qualified path to the jstack command and the jar command.

Once the getThreadDumps.bat script completes please upload the jstack.PID.zip, Support Bundle, and gc log files for review.