You probably will not encounter this issue, but I will post this anyway to get the error message and resolution indexed by Google.
While attempting to apply patch 19513382 (EM agent bundle patch 126.96.36.199.3) to my EM12cR4 agents, I ran into multiple problems. Initially it would not apply to any of my agents. Bug 20134182 and the resolution described in MOS note 1952355.1 resolved the first problem (OPatch reporting that identical patches 18721761 and 18502187 already exist), but that left me with one agent I could not upgrade. Attempts to run patch plan validation within EM12c produced the following error:
PatchList : 19513382 PatchLocList : /tmp/p19513382_600000000009641_2000_0/oraagent TargetName : [redacted]:[port] ---------------------------------------- [11_12_2014_10_00_40] Command Arguments: /oraagent/agent12c/core/188.8.131.52.0/OPatch/opatch checkComponents -phbasedir /tmp/p19513382_600000000009641_2000_0/oraagent/19513382 -oh /oraagent/agent12c/core/184.108.40.206.0 -invPtrloc /oraagent/agent12c/core/220.127.116.11.0/oraInst.loc OPatch cannot continue because it would not be able to load OUI platform dependent library from the directory "/oraagent/agent12c/core/18.104.22.168.0/oui/lib/linux64". The directory does not exist in the Oracle home. This could be due to the following reasons. (1) Incompatible usage of java with OUI (32/64 bit). (2) Wrong 32-bit Oracle Home installation in 64-bit environment (or) vice-versa. Please contact Oracle support for more details. OPatch failed with error code 1 PREREQ_CONTEXT_HOST_NAME:[redacted] REREQ_CONTEXT_HOME_LOCATION:/oraagent/agent12c/core/22.214.171.124.0 PREREQ_NAME: Checking if the patches are applicable. PREREQ_DESC: Checking if the patches are applicable on the Management Agent. PREREQ_TYPE:APPLICABILITY PREREQ_STATUS:FAILED PREREQ_MESG: None of these patches are applicable on the Management Agent. PREREQ_MESG_PATCH:19513382 PREREQ_REMEDY:MANUAL PREREQ_REMEDY_DETAILS: Remove patch(es) 19513382 from this patch plan.
I already know from the previously referenced MOS note that OPatch 126.96.36.199.3 contains bugs, so as a first debugging step I attempted to rollback the OPatch upgrade by restoring the backup copies of OPatch found in $AGENT_HOME/OPatch/backup/. I received the same error message with OPatch 188.8.131.52.4 and 184.108.40.206.0. I also received a similar error even if I simply tried to run “opatch lsinv” from the command line with the older versions. So OPatch did not cause this issue.
Since the error message mentions 32-bit and 64-bit incompatibility, I needed to consider the environment. This server runs Linux x86-64 (SLES 10 SP4), but must use a 32-bit EM agent based on the certification matrix and MOS note 1488161.1. I next checked to find my last successful patch run, which happened only a month ago, so a recent change has to have caused this problem. Going through my notes, the only recent change on this server involved upgrading the JDK used by the EM agent per MOS note 1944044.1.
Luckily I still had the old JDK available for comparison.
> java -version java version "1.6.0_43" Java(TM) SE Runtime Environment (build 1.6.0_43-b01) Java HotSpot(TM) Server VM (build 20.14-b01, mixed mode) > file `which java` /oraagent/agent12c/core/220.127.116.11.0/jdk/bin/java: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), not stripped
Looking at the new JDK:
> ./java -version java version "1.6.0_85" Java(TM) SE Runtime Environment (build 1.6.0_85-b13) Java HotSpot(TM) 64-Bit Server VM (build 20.85-b01, mixed mode) > file java java: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), for GNU/Linux 2.4.0, dynamically linked (uses shared libs), not stripped
There I have my problem. In upgrading the JDK, I had installed the 64-bit version of Java 1.6u85, not the 32-bit version, based on the fact that the server runs a 64-bit OS. I had not considered that a 64-bit JDK would not remain compatible with the 32-bit agent on this 64-bit system.
Surprisingly, everything about the agent seems to have worked fine, despite the 64-bit JDK. Nothing broke until I attempted to use OPatch.
To resolve the issue, I stopped the agent and moved the original 32 bit 1.6u43 JDK back to where it belongs, followed note 1952355.1 to work around the known bugs when using OPatch 18.104.22.168.3 to apply 19513382, then successfully applied the patch. After that I downloaded the correct 32-bit version of the 1.6u85 JDK, installed it per 1944044.1, and now OPatch works as expected.