Loading

How to Find Specific Log4j Version JAR Files and the Corresponding Pods In RTF Appliance and PCE

Date de publication: Jul 25, 2025
Étapes

CONTENTS

You are running a PCE or RTF Appliance cluster. You need a way to find all specific versions of log4j JARs and correspond them to the running pod name.

STEPS TO FOLLOW

Run the following command inside Gravity to find all version "2.13" JAR files. There are 2 directories involved. Also, please make sure to run this on every node:

Note: The version number should be changed in the below command as per the requirement. Ex: 2.5 or 2.8



1) /var/lib/gravity/planet/docker/overlay2 directory: 

( If Inside gravity try the path with /etc/docker/overlay2 )

find /var/lib/gravity/planet/docker/overlay2/ -type f -iname "*log4j-core-2.13*.jar" | sort | uniq > /tmp/log4j-jar-list.txt; for i in $(grep -Eo "[[:alnum:]]{63}" /tmp/log4j-jar-list.txt | uniq); do docker ps -qa | xargs -I{} bash -c "docker inspect {} | grep -q $i && echo {}"; done | xargs -I{} bash -c "docker inspect -f $'{{.Name}}\t{{.GraphDriver.Data.UpperDir}}' {}"
       
You should get output like this:
 
/k8s_application_ui-facade-service-123456-568567567-67a7-11ec-8e13-12a653e1815b_0   /ext/docker/overlay2/2342342343243242342342342342323443/diff

/k8s_application_mcm-service-2334234234-xjhlh_arm_30a1b1a8-67a7-11ec-23423423-2342342343232 /ext/docker/overlay2/3b1c343b4c9493d431e2f3c6428890dcc1b6d47c400d1e294e3793374a29a665/diff

2) /var/lib/gravity/local/ directory:
 
find /var/lib/gravity/local/ -type f -iname "log4j-core-2.13*.jar" | sort | uniq > /tmp/log4j-jar-list.txt; for i in $(grep -Eo "[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{8}" /tmp/log4j-jar-list.txt | uniq); do docker ps -qa | xargs -I{} bash -c "docker inspect {} | grep -q $i && echo {}"; done | xargs -I{} bash -c "docker inspect -f $'{{.Name}}\t{{.GraphDriver.Data.UpperDir}}' {}" | grep k8s_app

You should get similar output (but different apps) for this directory as step 1. 

Mitigation Steps

If apps above are still running:

1) Please have the developer open their app's project in Studio.
2) Then, open a terminal to the app's workspace directory.
3) Follow the commands in this article to identify which component in that app is referencing the old log4j JAR: How to display the project dependencies and libraries of a Mule application with Maven
4) Mitigate and redeploy app.

If apps are not running:
1) Please follow directions from this article: Nodes running out of disk space in APCE because of /var/lib/gravity directory

Numéro d’article de la base de connaissances

001115195

 
Chargement
Salesforce Help | Article