Opatch Failed With Error Code 21 -
ls -la /u01/app/oraInventory/locks/* If lock files exist and no other OPatch process is running, remove them:
The error message usually appears as:
Open the most recent log file and search for the first occurrence of the word "ERROR" or "SEVERE". The real error often appears several lines before the final "error code 21". Step 2: Check OPatch Version Run: opatch failed with error code 21
opatch apply -force However, this can lead to unexpected behavior. Always consult the patch README or Oracle Support before forcing a patch. For deep troubleshooting, run: ls -la /u01/app/oraInventory/locks/* If lock files exist and
Upgraded OPatch to version 13.9.4.2.0. The patch applied successfully. Case Study 2: /tmp Full of Old JAR Extractions Scenario: A middleware admin repeatedly failed with error code 21 on a WebLogic patch. Logs showed "No space left on device" even though df -h /tmp showed 30% free. Always consult the patch README or Oracle Support