When attempting to upgrade JBoss 7.4 update 18 to apply bugs and vulnerability fixes the upgrade fails with:
./jboss-cli.sh
You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.
[disconnected /] patch apply /opt/patches/jboss-eap-7.4.18-patch.zip
{java.io.SyncFailedException: WFLYPAT0018: copied content does not mat
ch expected hash for item: ModuleItem{org.apache.logging.log4j.api:main}
}
Identity Manager running on JBOSS
Reviewing the opt/jboss/modules/system/layers/base/org/apache/logging/log4j/api/main folder from the error message we see a backup of the log4j folder which is interfering with the upgrade:
ls -ltr
total 4
-rw-r--r--. 1 jboss jboss 1561 Jun 23 2021 module.xml
drwxrwxr-x. 2 jboss jboss 30 Jul 19 19:32 log4j_backup
Remove the backed up log4j folder outside the Jboss/Modules folder and retry the Jboss Patch.
If you encounter a Conflicts detected failure which mentions using the override all switch:
You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.
[disconnected /] patch apply /opt/patches/jboss-eap-7.4.18-patch.zip
Conflicts detected: org.apache.logging.log4j.api:main
Use the --override-all, --override=[] or --preserve=[] arguments in order to res
olve the conflict.
Please see Redhat documentation on this: https://access.redhat.com/
./jboss-cli.sh
You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.
[disconnected /] patch apply /opt/patches/
{
"outcome" : "success",
"result" : {}
}