Saturday 23 April 2022

opatchauto failed with error /u01/app/oraInventory/ContentsXML/oui-patch.xml (Permission denied)

Hi,


While applying Jan 2022 RU patches on Oracle GI & DB 19.13.0.0 database, "opatchauto" got failed with below errors. Pasting here entire log for study and reference purpose.




[root@node2 ~]# opatchauto apply /backupstore/Jan2022_CPU_Patches/33567274/33509923


OPatchauto session is initiated at Fri Apr 22 18:01:58 2022


System initialization log file is /u01/app/19.0.0/grid/cfgtoollogs/opatchautodb/systemconfig2022-04-22_06-02-02PM.log.


Session log file is /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/opatchauto2022-04-22_06-02-25PM.log

The id for this session is ND4W


Executing OPatch prereq operations to verify patch applicability on home /u01/app/19.0.0/grid


Executing OPatch prereq operations to verify patch applicability on home /u01/app/oracle/product/19.0.0/dbhome_1

Patch applicability verified successfully on home /u01/app/oracle/product/19.0.0/dbhome_1


Patch applicability verified successfully on home /u01/app/19.0.0/grid



Executing patch validation checks on home /u01/app/19.0.0/grid

Patch validation checks successfully completed on home /u01/app/19.0.0/grid



Executing patch validation checks on home /u01/app/oracle/product/19.0.0/dbhome_1

Patch validation checks successfully completed on home /u01/app/oracle/product/19.0.0/dbhome_1



Verifying SQL patch applicability on home /u01/app/oracle/product/19.0.0/dbhome_1

SQL patch applicability verified successfully on home /u01/app/oracle/product/19.0.0/dbhome_1



Preparing to bring down database service on home /u01/app/oracle/product/19.0.0/dbhome_1

Successfully prepared home /u01/app/oracle/product/19.0.0/dbhome_1 to bring down database service



Performing prepatch operations on CRS - bringing down CRS service on home /u01/app/19.0.0/grid

Prepatch operation log file location: /u01/app/grid/crsdata/node2/crsconfig/crs_prepatch_apply_inplace_node2_2022-04-22_06-04-09PM.log

CRS service brought down successfully on home /u01/app/19.0.0/grid



Performing prepatch operation on home /u01/app/oracle/product/19.0.0/dbhome_1

Perpatch operation completed successfully on home /u01/app/oracle/product/19.0.0/dbhome_1



Start applying binary patch on home /u01/app/oracle/product/19.0.0/dbhome_1

Binary patch applied successfully on home /u01/app/oracle/product/19.0.0/dbhome_1



Performing postpatch operation on home /u01/app/oracle/product/19.0.0/dbhome_1

Postpatch operation completed successfully on home /u01/app/oracle/product/19.0.0/dbhome_1



Start applying binary patch on home /u01/app/19.0.0/grid

Failed while applying binary patches on home /u01/app/19.0.0/grid


Execution of [OPatchAutoBinaryAction] patch action failed, check log for more details. Failures:

Patch Target : node2->/u01/app/19.0.0/grid Type[crs]

Details: [

---------------------------Patching Failed---------------------------------

Command execution failed during patching in home: /u01/app/19.0.0/grid, host: node2.

Command failed:  /u01/app/19.0.0/grid/OPatch/opatchauto  apply /backupstore/Jan2022_CPU_Patches/33567274/33509923 -oh /u01/app/19.0.0/grid -target_type cluster -binary -invPtrLoc /u01/app/19.0.0/grid/oraInst.loc -jre /u01/app/19.0.0/grid/OPatch/jre -persistresult /u01/app/19.0.0/grid/opatchautocfg/db/sessioninfo/sessionresult_node2_crs_1.ser -analyzedresult /u01/app/19.0.0/grid/opatchautocfg/db/sessioninfo/sessionresult_analyze_node2_crs_1.ser

Command failure output:

==Following patches FAILED in apply:


Patch: /backupstore/Jan2022_CPU_Patches/33567274/33509923/33515361

Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2022-04-22_18-14-08PM_1.log

Reason: Failed during Patching: oracle.opatch.opatchsdk.OPatchException: ApplySession failed in system modification phase... 'ApplySession::apply failed: java.io.IOException: oracle.sysman.oui.patch.PatchException: java.io.FileNotFoundException: /u01/app/oraInventory/ContentsXML/oui-patch.xml (Permission denied)'


After fixing the cause of failure Run opatchauto resume


]

OPATCHAUTO-68061: The orchestration engine failed.

OPATCHAUTO-68061: The orchestration engine failed with return code 1

OPATCHAUTO-68061: Check the log for more details.

OPatchAuto failed.


OPatchauto session completed at Fri Apr 22 18:18:58 2022

Time taken to complete the session 17 minutes, 1 second


 opatchauto failed with error code 42

 

 

[root@node2 ~]# ll /u01/app/oraInventory/ContentsXML/oui-patch.xml

-rw-r--r-- 1 oracle oinstall 174 Apr 22 18:13 /u01/app/oraInventory/ContentsXML/oui-patch.xml

[root@node2 ~]#

[root@node2 ~]#



Solution :  According to MOS Doc ID 2582139.1, During 19.x Grid Infrastructure (GI) installation, the file 'oui-patch.xml' will be created under the central inventory directory on the OUI node (node where gridSetup.sh was invoked) but NOT on the remote nodes.


Hence need to copy oui-patch.xml file from Node1 to Node2 [remote nodes] and resume the patching.


[root@node1 ~]# scp /u01/app/oraInventory/ContentsXML/oui-patch.xml grid@node2: /u01/app/oraInventory/ContentsXML


[root@node2 ~]# ll /u01/app/oraInventory/ContentsXML/oui-patch.xml

-rw-rw---- 1 grid oinstall 174 Apr 22 18:13 /u01/app/oraInventory/ContentsXML/oui-patch.xml


[root@node2 ~]# opatchauto resume


........



OPatchAuto successful.



Cheers !

Not able to retrieve system instance details :: PRCA-1084 : Failed to retrieve ASM Mode PRKH-1059 : Failed to get ASM mode PRKH-1056 : Unexpected CSS error(error code[0]) PRKH-1002 : Internal HASContext Error: JNI Native Call Failure

 Hi,


While applying Jan 2022 RU patches on Oracle GI & DB 19.13.0.0 database, "opatchauto" got failed with below errors. Pasting here entire log for study and reference purpose.


Not able to retrieve system instance details :: PRCA-1084 : Failed to retrieve ASM Mode

PRKH-1059 : Failed to get ASM mode

PRKH-1056 : Unexpected CSS error(error code[0])

PRKH-1002 : Internal HASContext Error: JNI Native Call Failure


Related MOS doc for reference. Doc ID 1992303.1


Error :
[root@node1 33509923]# opatchauto apply /backupstore/Jan2022_CPU_Patches/33567274/33509923


2022-04-22 15:48:12,542 FINE [1] com.oracle.glcm.patch.auto.db.product.driver.crs.CrsProductDriver - oracle.installer.library_loc set to /backupstore/Jan2022_CPU_Patches/33567274/33509923/33529556/files/lib
2022-04-22 15:48:12,818 SEVERE [1] com.oracle.glcm.patch.auto.db.integration.model.productsupport.topology.TopologyCreator - Stacktrace :: oracle.dbsysmodel.driver.sdk.productdriver.ProductDriverException: PRCA-1084 : Failed to retrieve ASM Mode
PRKH-1059 : Failed to get ASM mode
PRKH-1056 : Unexpected CSS error(error code[0])
PRKH-1002 : Internal HASContext Error: JNI Native Call Failure
com.oracle.glcm.patch.auto.db.product.driver.crs.CrsProductDriver.makeASM(CrsProductDriver.java:702)
com.oracle.glcm.patch.auto.db.product.driver.crs.CrsProductDriver.buildCRSSystemInstance(CrsProductDriver.java:511)
com.oracle.glcm.patch.auto.db.product.driver.crs.CrsProductDriver.buildSystemInstance(CrsProductDriver.java:562)
com.oracle.glcm.patch.auto.db.integration.model.productsupport.topology.TopologyCreator.createSystemInstance(TopologyCreator.java:261)
com.oracle.glcm.patch.auto.db.integration.model.productsupport.topology.TopologyCreator.process(TopologyCreator.java:177)
com.oracle.glcm.patch.auto.db.integration.model.productsupport.topology.TopologyCreator.main(TopologyCreator.java:121)


   
Solution :

By root user check the environment variable set :

[root@node1 trace]# env
GRID_HOME=/u01/app/19.0.0/grid
ORA_CRS_HOME=/u01/app/19.0.0/grid/bin
PATH=/u01/app/19.0.0/grid/bin:/u01/app/19.0.0/grid/OPatch:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
OLDPWD=/root
[root@node1 trace]#

So here you can observer grid home path pointed to home location & bin location too.

Hence, unset "ORA_CRS_HOME" variable and try again.


[root@node1 33509923]# opatchauto apply /backupstore/Jan2022_CPU_Patches/33567274/33509923
........

Trying to apply SQL patch on home /u01/app/oracle/product/19.0.0/dbhome_1
SQL patch applied successfully on home /u01/app/oracle/product/19.0.0/dbhome_1

OPatchAuto successful.




Cheers ! 

opatchauto failed with error code 42 : Cannot copy file from ocrcheck.bin

Hi,


While applying Jan 2022 RU patches on Oracle restart 19.13.0.0 database, "opatchauto" got failed with below errors. Pasting here entire log for study and reference purpose.


Patch 33529556:

Copy Action: Source File "/u01/Software/Jan_2022CPU_patches/33567274/33509923/33529556/files/bin/ocrcheck.bin" does not exists or is not readable

'oracle.has.crs, 19.0.0.0.0': Cannot copy file from 'ocrcheck.bin' to '/u01/app/19.0.0/grid/bin/ocrcheck.bin'

Copy Action: Source File "/u01/Software/Jan_2022CPU_patches/33567274/33509923/33529556/files/bin/ocrconf ... 



Error :

[root@NODE1 ~]# opatchauto apply /u01/Software/Jan_2022CPU_patches/33567274/33509923

OPatchauto session is initiated at Fri Apr 22 11:08:58 2022

System initialization log file is /u01/app/19.0.0/grid/cfgtoollogs/opatchautodb/systemconfig2022-04-22_11-09-02AM.log.

Session log file is /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/opatchauto2022-04-22_11-09-07AM.log
The id for this session is 4JXB


Executing OPatch prereq operations to verify patch applicability on home /u01/app/oracle/product/19.0.0/dbhome_1
Patch applicability verified successfully on home /u01/app/oracle/product/19.0.0/dbhome_1


Executing patch validation checks on home /u01/app/oracle/product/19.0.0/dbhome_1
Patch validation checks successfully completed on home /u01/app/oracle/product/19.0.0/dbhome_1


Verifying SQL patch applicability on home /u01/app/oracle/product/19.0.0/dbhome_1
SQL patch applicability verified successfully on home /u01/app/oracle/product/19.0.0/dbhome_1


Executing OPatch prereq operations to verify patch applicability on home /u01/app/19.0.0/grid
Patch applicability verified successfully on home /u01/app/19.0.0/grid


Executing patch validation checks on home /u01/app/19.0.0/grid
Patch validation checks successfully completed on home /u01/app/19.0.0/grid


Preparing to bring down database service on home /u01/app/oracle/product/19.0.0/dbhome_1
Successfully prepared home /u01/app/oracle/product/19.0.0/dbhome_1 to bring down database service


Bringing down database service on home /u01/app/oracle/product/19.0.0/dbhome_1
Following database has been stopped and will be restarted later during the session: testdb
Database service successfully brought down on home /u01/app/oracle/product/19.0.0/dbhome_1


Performing prepatch operations on CRS - bringing down CRS service on home /u01/app/19.0.0/grid
Prepatch operation log file location: /u01/app/grid/crsdata/node1/crsconfig/hapatch_2022-04-22_11-13-56AM.log
CRS service brought down successfully on home /u01/app/19.0.0/grid


Start applying binary patch on home /u01/app/oracle/product/19.0.0/dbhome_1
Binary patch applied successfully on home /u01/app/oracle/product/19.0.0/dbhome_1


Start applying binary patch on home /u01/app/19.0.0/grid
Failed while applying binary patches on home /u01/app/19.0.0/grid



Failed while applying binary patches on home /u01/app/19.0.0/grid

Execution of [OPatchAutoBinaryAction] patch action failed, check log for more details. Failures:
Patch Target : node1->/u01/app/19.0.0/grid Type[siha]
Details: [
---------------------------Patching Failed---------------------------------
Command execution failed during patching in home: /u01/app/19.0.0/grid, host: node1.
Command failed:  /u01/app/19.0.0/grid/OPatch/opatchauto  apply /u01/Software/Jan_2022CPU_patches/33567274/33509923 -oh /u01/app/19.0.0/grid -target_type has -binary -invPtrLoc /u01/app/19.0.0/grid/oraInst.loc -jre /u01/app/19.0.0/grid/OPatch/jre -persistresult /u01/app/19.0.0/grid/opatchautocfg/db/sessioninfo/sessionresult_node1_siha_1.ser -analyzedresult /u01/app/19.0.0/grid/opatchautocfg/db/sessioninfo/sessionresult_analyze_node1_siha_1.ser
Command failure output: 
==Following patches FAILED in apply:

Patch: /u01/Software/Jan_2022CPU_patches/33567274/33509923/33529556
Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2022-04-22_11-26-49AM_1.log
Reason: Failed during Analysis: CheckPatchApplicable Failed, [ Prerequisite Status: FAILED, Prerequisite output: 
The details are:

Patch 33529556:
Copy Action: Source File "/u01/Software/Jan_2022CPU_patches/33567274/33509923/33529556/files/bin/ocrcheck.bin" does not exists or is not readable
'oracle.has.crs, 19.0.0.0.0': Cannot copy file from 'ocrcheck.bin' to '/u01/app/19.0.0/grid/bin/ocrcheck.bin'
Copy Action: Source File "/u01/Software/Jan_2022CPU_patches/33567274/33509923/33529556/files/bin/ocrconf ... 

After fixing the cause of failure Run opatchauto resume

]
OPATCHAUTO-68061: The orchestration engine failed.
OPATCHAUTO-68061: The orchestration engine failed with return code 1
OPATCHAUTO-68061: Check the log for more details.
OPatchAuto failed.

OPatchauto session completed at Fri Apr 22 11:32:06 2022
Time taken to complete the session 23 minutes, 9 seconds

 opatchauto failed with error code 42



Solution :   Here need to change the owner of the patches from root to "GRID:OINSTALL"

[root@NODE1 ]# chown -R grid:oinstall /u01/Software/Jan_2022CPU_patches

[root@NODE1 ]# ls -ltr
total 4161128
drwxrwxrwx 4 grid oinstall         80 Jan 17 16:24 33567274
-rw-rw-r-- 1 grid oinstall    1483571 Jan 18 12:29 PatchSearch.xml
drwxr-xr-x 4 grid oinstall         75 Jan 19 20:00 33567270
-rw-r--r-- 1 grid oinstall 1498895522 Apr 21 13:12 p33567270_190000_Linux-x86-64.zip
-rw-r--r-- 1 grid oinstall 2760607369 Apr 21 14:10 p33567274_190000_Linux-x86-64.zip


[root@NODE1 33509923]# opatchauto resume

OPatchauto session is initiated at Fri Apr 22 12:32:20 2022
Session log file is /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/opatchauto2022-04-22_12-32-20PM.log
Resuming existing session with id 4JXB

Start applying binary patch on home /u01/app/19.0.0/grid
Binary patch applied successfully on home /u01/app/19.0.0/grid


Performing postpatch operations on CRS - starting CRS service on home /u01/app/19.0.0/grid
Postpatch operation log file location: /u01/app/grid/crsdata/node1/crsconfig/hapatch_2022-04-22_12-37-35AM.log
CRS service started successfully on home /u01/app/19.0.0/grid


Preparing home /u01/app/oracle/product/19.0.0/dbhome_1 after database service restarted
No step execution required.........
 

Trying to apply SQL patch on home /u01/app/oracle/product/19.0.0/dbhome_1
SQL patch applied successfully on home /u01/app/oracle/product/19.0.0/dbhome_1

OPatchAuto successful.



Cheers !