logo
When i updated OMS, i tried to upgrade all agents.
One of them during upgrade process failed with “Preparing for Management Agent Upgrade” step.
But what is a reason of this behaviour?

001 – Agent upgrade failed

001. There is an example.
Click on “Prepaing for Management Agent Upgrade” to display logs.


002 – log details

002. More details:


003. So let’s check those logs?

[oracle@SERVERNAME bin](SERVERNAME)$ cd /u01/app/oracle/product/agent12c/core/12.1.0.3.0/cfgtoollogs/agentDeploy/
[oracle@SERVERNAME agentDeploy](SERVERNAME)$ ls -ltr
(...)
drwxr-xr-x 2 oracle oinstall 4096 Apr 23 11:55 logs
-rw------- 1 oracle oinstall 120 Apr 23 11:55 prereq2014-04-23_11-55-11AM.err
drwxr-xr-x 2 oracle oinstall 4096 Apr 23 11:55 results
-rw------- 1 oracle oinstall 2062 Apr 23 11:55 prereq2014-04-23_11-55-11AM.out
-rw-r----- 1 oracle oinstall 3783 Apr 23 11:55 prereq2014-04-23_11-55-11AM.log
-rw-r--r-- 1 oracle oinstall 7784 Apr 23 11:55 agentDeploy_2014-04-23_11-55-11-AM.log
-rw-r--r-- 1 oracle oinstall 19777 Apr 23 11:55 agentDeploy_2014-04-23_11-55-23-AM.log
[oracle@SERVERNAME agentDeploy](SERVERNAME)$ more agentDeploy_2014-04-23_11-55-23-AM.log
(...)
INFO: Inside for loop...1 time
INFO: Inside for loop...2 time
INFO: Copying from: /u01/app/oraInventory to /u01/app/oracle/product/agent12c/backup_2014-04-23_11-55-23-AM/oraInventory
INFO: Just for debugging ...
SEVERE: backup exception message:/u01/app/oraInventory/logs/OPatch2012-10-16_12-50-18-PM.log (Permission denied)
INFO: File is deleted : /u01/app/oracle/product/agent12c/sbin_new/nmo.0
INFO: File is deleted : /u01/app/oracle/product/agent12c/sbin_new/nmgsshe
(...)

Let’s check those directories:

[oracle@SERVERNAME agentDeploy](SERVERNAME)$ ll /u01/app/oraInventory/logs/
(...)
-rw-r----- 1 oracle oinstall 7527 Sep 25 2012 OPatch2012-09-25_01-06-09-PM.log
-rw-r----- 1 oracle oinstall 7708 Sep 25 2012 OPatch2012-09-25_01-07-56-PM.log
-rw-r----- 1 grid oinstall 4908 Sep 25 2012 OPatch2012-09-25_12-18-00-PM.log
-rw-r----- 1 grid oinstall 4934 Sep 25 2012 OPatch2012-09-25_12-19-06-PM.log
-rw-r----- 1 grid oinstall 4654 Sep 25 2012 OPatch2012-09-25_12-19-28-PM.log
-rw-r----- 1 grid oinstall 4680 Sep 25 2012 OPatch2012-09-25_12-19-32-PM.log
-rw------- 1 oraagent oinstall 4500 Oct 16 2012 OPatch2012-10-16_12-50-18-PM.log
-rw------- 1 oraagent oinstall 4525 Oct 16 2012 OPatch2012-10-16_12-50-22-PM.log
-rw------- 1 oraagent oinstall 4550 Oct 16 2012 OPatch2012-10-16_12-50-28-PM.log
-rw------- 1 oraagent oinstall 4575 Oct 16 2012 OPatch2012-10-16_12-50-32-PM.log
-rw------- 1 oraagent oinstall 4600 Oct 16 2012 OPatch2012-10-16_12-50-42-PM.log
-rw-r----- 1 oracle oinstall 8035 Oct 23 2012 OPatch2012-10-23_09-32-29-AM.log
-rw-r----- 1 oracle oinstall 8061 Nov 16 2012 OPatch2012-11-16_09-33-15-AM.log
-rw-r----- 1 oracle oinstall 8225 Nov 19 2012 OPatch2012-11-19_03-38-20-PM.log
-rw-r----- 1 oracle oinstall 15569 Nov 19 2012 OPatch2012-11-19_03-38-45-PM.log
-rw-r----- 1 oracle oinstall 704 Nov 19 2012 OPatch2012-11-19_03-44-08-PM.log

As we see, in this directory are logs of three different users (oracle. grid, oraagent) belongs to same group (oinstall).
But where problem is located?
I think, reason is an oraagent files (our files!) with only “rw” permision on user section.
This not allow other group users to access to those files.
This is an oracle bug – same user used in install process check permisions in directory for existing files (keep in mind, that any of those files will not be modified! – it’s only check for ownership!). And if ANY file is uredable by group, installer thrown an error and end istallation. It’s idiotic – those files are not modified, directory is writable.


Prepare to change permision by one command – first check if correct files are selected:

[oracle@SERVERNAME logs](SERVERNAME)$ find . -user oraagent -type f -exec ls -la {} \;
-rw-rw---- 1 oraagent oinstall 6978 Oct 16 2012 ./prereq2012-10-16_12-49-13PM.log
-rw------- 1 oraagent oinstall 4500 Oct 16 2012 ./OPatch2012-10-16_12-50-18-PM.log
-rw------- 1 oraagent oinstall 4525 Oct 16 2012 ./OPatch2012-10-16_12-50-22-PM.log
-rw-rw---- 1 oraagent oinstall 28008 Oct 16 2012 ./results/em_prereqs_results.xml
-rw------- 1 oraagent oinstall 4600 Oct 16 2012 ./OPatch2012-10-16_12-50-42-PM.log
-rw-rw---- 1 oraagent oinstall 2655248 Oct 16 2012 ./installActions2012-10-16_12-49-13PM.log
-rw------- 1 oraagent oinstall 4550 Oct 16 2012 ./OPatch2012-10-16_12-50-28-PM.log
-rw-rw---- 1 oraagent oinstall 26973 Oct 16 2012 ./oraInstall2012-10-16_12-49-13PM.out
-rw------- 1 oraagent oinstall 4575 Oct 16 2012 ./OPatch2012-10-16_12-50-32-PM.log
-rw-rw---- 1 oraagent oinstall 120 Oct 16 2012 ./oraInstall2012-10-16_12-49-13PM.err

Yes, so we can do it now:

[root@SERVERNAME logs]# find . -user oraagent -type f -exec chmod g+r {} \;

Display them again to check:

[oracle@SERVERNAME logs](SERVERNAME)$ find . -user oraagent -type f -exec ls -la {} \;
-rw-rw---- 1 oraagent oinstall 6978 Oct 16 2012 ./prereq2012-10-16_12-49-13PM.log
-rw-r----- 1 oraagent oinstall 4500 Oct 16 2012 ./OPatch2012-10-16_12-50-18-PM.log
-rw-r----- 1 oraagent oinstall 4525 Oct 16 2012 ./OPatch2012-10-16_12-50-22-PM.log
-rw-rw---- 1 oraagent oinstall 28008 Oct 16 2012 ./results/em_prereqs_results.xml
-rw-r----- 1 oraagent oinstall 4600 Oct 16 2012 ./OPatch2012-10-16_12-50-42-PM.log
-rw-rw---- 1 oraagent oinstall 2655248 Oct 16 2012 ./installActions2012-10-16_12-49-13PM.log
-rw-r----- 1 oraagent oinstall 4550 Oct 16 2012 ./OPatch2012-10-16_12-50-28-PM.log
-rw-rw---- 1 oraagent oinstall 26973 Oct 16 2012 ./oraInstall2012-10-16_12-49-13PM.out
-rw-r----- 1 oraagent oinstall 4575 Oct 16 2012 ./OPatch2012-10-16_12-50-32-PM.log
-rw-rw---- 1 oraagent oinstall 120 Oct 16 2012 ./oraInstall2012-10-16_12-49-13PM.err

Yes, those directory are now clean (no files without “r” bits on group)
Let’s try now to update agent.


This time it pass this step

This time agent upgrade is passed sucessfully.