Troubleshooting
Problem
This is a problem determination document to help troubleshoot Liberty on Docker.
Tab navigation
Environment
Resolving The Problem
Table of contents:
- Gather a thread dump of IBM Java or IBM Semeru Runtimes
- Gather a thread dump of HotSpot Java
- Gather an operating system core dump of IBM Java or IBM Semeru Runtimes
Gather a thread dump of IBM Java or IBM Semeru Runtimes
Perform the following steps to gather a thread dump:
- Find the relevant containers:
docker ps
- For each relevant container, replace $CONTAINER based on the output above to remote into it:
docker exec -it $CONTAINER -- /bin/sh
- Find the process ID of the Liberty server by listing all running processes and find the one that is Java and discover the PID after /proc/:
ls -l /proc/[0-9]*/exe
- In the following example, the Java process is PID 1:
$ ls -l /proc/[0-9]*/exe lrwxrwxrwx. 1 1000850000 root 0 May 15 15:48 /proc/1/exe -> /opt/ibm/java/jre/bin/java lrwxrwxrwx. 1 1000850000 root 0 May 15 18:40 /proc/417/exe -> /usr/bin/bash
- In the following example, the Java process is PID 1:
- Request a thread dump, replacing $PID based on the process ID found in the previous step:
kill -3 $PID
- Find the current working directory of the Java process, replacing $PID with the process ID:
ls -l /proc/$PID/cwd
- In the following example, the current working directory of the Java process is /opt/ibm/wlp/output/defaultServer:
$ ls -l /proc/1/cwd lrwxrwxrwx. 1 1000840000 root 0 May 21 18:22 /proc/1/cwd -> /opt/ibm/wlp/output/defaultServer
- In the following example, the current working directory of the Java process is /opt/ibm/wlp/output/defaultServer:
- List javacore*.txt files, replacing $JAVACWD with the directory found in the previous step:
ls -l $JAVACWD/javacore*txt
- If no javacore*.txt files are found, then the default javacore directory has been overridden with -Xdump JVM options or the IBM_JAVACOREDIR environment variable is used.
- Exit the remote shell:
exit
- Download the file, replacing $CONTAINER with the container name and $PATH with the full path to the javacore*.txt file:
docker cp $CONTAINER:$PATH javacore.txt
Gather a thread dump of HotSpot Java
Perform the following steps to gather a thread dump:
- Find the relevant containers:
docker ps
- For each relevant container, replace $CONTAINER based on the output above to remote into it:
docker exec -it $CONTAINER -- /bin/sh
- Find the process ID of the Liberty server by listing all running processes and find the one that is Java and discover the PID after /proc/:
ls -l /proc/[0-9]*/exe
- In the following example, the Java process is PID 1:
$ ls -l /proc/[0-9]*/exe lrwxrwxrwx. 1 1000850000 root 0 May 15 15:48 /proc/1/exe -> /opt/ibm/java/jre/bin/java lrwxrwxrwx. 1 1000850000 root 0 May 15 18:40 /proc/417/exe -> /usr/bin/bash
- In the following example, the Java process is PID 1:
- Request a thread dump, replacing $PID based on the process ID found in the previous step:
kill -3 $PID
- Exit the remote shell:
exit
- The thread dump will go to stderr, so replace $CONTAINER with the container name:
docker logs $CONTAINER
Gather an operating system core dump of IBM Java or IBM Semeru Runtimes
Perform the following steps to gather an operating system core dump of a process:
- Find the relevant containers:
docker ps
- For each relevant container, replace $CONTAINER based on the output above to remote into it:
docker exec -it $CONTAINER -- /bin/sh
- Find the process ID of the Liberty server by listing all running processes and find the one that is Java and discover the PID after /proc/:
ls -l /proc/[0-9]*/exe
- In the following example, the Java process is PID 1:
$ ls -l /proc/[0-9]*/exe lrwxrwxrwx. 1 1000850000 root 0 May 15 15:48 /proc/1/exe -> /opt/ibm/java/jre/bin/java lrwxrwxrwx. 1 1000850000 root 0 May 15 18:40 /proc/417/exe -> /usr/bin/bash
- In the following example, the Java process is PID 1:
- Request an operating system core dump, replacing $JAVA_HOME with the path to the Java bin directory and $PID based on the process ID found in the previous step:
$JAVA_HOME/bin/jcmd $PID Dump.system
- Display the core dump processing pattern:
cat /proc/sys/kernel/core_pattern
- Exit the remote shell:
exit
- Depending on the output of the step to display the core_pattern, follow the instructions to download the core dump, usually from the worker node.
Copied!
Document Location
Worldwide
[{"Type":"MASTER","Line of Business":{"code":"LOB67","label":"IT Automation \u0026 App Modernization"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"ARM Category":[{"code":"a8mKe000000GmbMIAS","label":"IBM WebSphere Liberty-All Platforms-\u003EContainers"}],"ARM Case Number":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions"}]
Was this topic helpful?
Document Information
Modified date:
22 May 2024
UID
ibm17152494