How to Install AHF when you encounter AHF-00014 ?

If you ever run into a situation where you are trying to [re-]install AHF aka Autonomous Health Framework (formerly known as TFA) in a non-default location. If the installation owner is the root, then there is a chance that you run into AHF-00014.

[ERROR] : AHF-00014: AHF Location ... oracle.ahf is not owned by root in directory hierarchy

This error indicates that if you intend to do a root-based installation, then the root should be the owner of all the directories in the installation path. Let’s look and see if there’s any other way to fix this.

BLUF (Bottom Line Up First )

The BLUF here is that you can use the variable AHF_OVERRIDE_INSTALL_CHECKS to ignore this prerequisite.

AHF Installation

The installation software can be obtained from following Metalink Note- Doc ID 2550798.1 . So let’s take a look at an attempt to install AHF in a directory called ahf with the directory tree structured as follows

/u01/oracle/ahf

Debugging AHF

So here, we run the ahf installation in debug mode (level 6) to get a peek under the hood. The ahf installer offers six debug levels to control the information details that can be viewed by specifying the debug levels. Strangely the default debug level is level 4, which provides Informational Messages, i.e. ÏNFO only. So if you do not specify the level parameter, all you will see are INFO Messages. Level 5 provides Debug information and level 6 traces.

[root@node-target tmp]# ./ahf_setup -debug -level 6

AHF Installer for Platform Linux Architecture x86_64

AHF Installation Log : /tmp/ahf_install_213000_6244_2021_10_21-07_07_55.log
2021-10-21 07:07:55.262 EDT [ INFO] : AHF Debug : -debug
2021-10-21 07:07:55.265 EDT [ INFO] : AHF Debug Level : 6
2021-10-21 07:07:55.267 EDT [DEBUG] : AHF Arguments : -debug -level 6
2021-10-21 07:07:55.270 EDT [TRACE] : Current Directory : /tmp
2021-10-21 07:07:55.275 EDT [ INFO] : Hostname : node-target
2021-10-21 07:07:55.280 EDT [DEBUG] : User ID : 0
2021-10-21 07:07:55.285 EDT [DEBUG] : User Name : root

Starting Autonomous Health Framework (AHF) Installation
2021-10-21 07:07:55.292 EDT [ INFO] : AHF Installer : /tmp/ahf_setup
2021-10-21 07:07:55.297 EDT [DEBUG] : Moving to Home Directory
2021-10-21 07:07:55.300 EDT [DEBUG] : AHF Build ID : 21300020211014062436
2021-10-21 07:07:55.302 EDT [DEBUG] : BUILD_VER_DOT : 21.3.0

AHF Version: 21.3.0 Build Date: 202110140624
2021-10-21 07:07:55.310 EDT [ INFO] : OLR Location : /etc/oracle/olr.loc
2021-10-21 07:07:55.314 EDT [ INFO] : CRS HOME using OLR Location : /u01/app/12.1.0/grid
2021-10-21 07:07:55.317 EDT [DEBUG] : AHF_CRS_HOME in validateCRSHome : /u01/app/12.1.0/grid
2021-10-21 07:07:55.319 EDT [DEBUG] : Getting GI BASE from /u01/app/12.1.0/grid/crs/install/crsconfig_params
2021-10-21 07:07:55.325 EDT [DEBUG] : GI BASE using crsconfig_params : /u01/app/oracle
2021-10-21 07:07:55.327 EDT [DEBUG] : GI Base in getGIBase : /u01/app/oracle
2021-10-21 07:07:55.330 EDT [DEBUG] : AHF_CRS_HOME : /u01/app/12.1.0/grid
2021-10-21 07:07:55.333 EDT [DEBUG] : AHF_GI_BASE : /u01/app/oracle
2021-10-21 07:07:55.335 EDT [DEBUG] : Checking cellip.ora : /etc/oracle/cell/network-config/cellip.ora
2021-10-21 07:07:55.338 EDT [DEBUG] : Checking cellinit.ora : /etc/oracle/cell/network-config/cellinit.ora
2021-10-21 07:07:55.341 EDT [DEBUG] : Checking ecratab : /etc/ecratab
2021-10-21 07:07:55.343 EDT [DEBUG] : Checking Nimbula : /etc/nimbula_version
2021-10-21 07:07:55.346 EDT [DEBUG] : IS Exadata : 0
2021-10-21 07:07:55.349 EDT [DEBUG] : System Perl : /bin/perl
2021-10-21 07:07:55.352 EDT [DEBUG] : Checking Perl Version : /bin/perl
2021-10-21 07:07:55.358 EDT [DEBUG] : Perl Version : 5.016003
2021-10-21 07:07:55.361 EDT [DEBUG] : PERL_ERROR in checkPerlVersion :
2021-10-21 07:07:55.363 EDT [DEBUG] : Checking Perl Owner : /bin/perl
2021-10-21 07:07:55.368 EDT [DEBUG] : Perl Owner : root
2021-10-21 07:07:55.371 EDT [DEBUG] : PERL_ERROR in checkPerlOwner :
2021-10-21 07:07:55.373 EDT [DEBUG] : Perl in checkPerlModules : /bin/perl
2021-10-21 07:07:55.389 EDT [DEBUG] : Perl Module : Data::Dumper, Version : 2.145, Exit Status : 0
2021-10-21 07:07:55.398 EDT [DEBUG] : Perl Module : File::Basename, Version : 2.84, Exit Status : 0
2021-10-21 07:07:55.411 EDT [DEBUG] : Perl Module : File::Copy, Version : 2.23, Exit Status : 0
2021-10-21 07:07:55.429 EDT [DEBUG] : Perl Module : File::Find, Version : 1.20, Exit Status : 0
2021-10-21 07:07:55.445 EDT [DEBUG] : Perl Module : File::Path, Version : 2.09, Exit Status : 0
2021-10-21 07:07:55.454 EDT [DEBUG] : Perl Module : File::Spec::Functions, Version : 3.40, Exit Status : 0
2021-10-21 07:07:55.463 EDT [DEBUG] : Perl Module : File::Spec, Version : 3.40, Exit Status : 0
2021-10-21 07:07:55.494 EDT [DEBUG] : Perl Module : File::Temp, Version : 0.2301, Exit Status : 0
2021-10-21 07:07:55.510 EDT [DEBUG] : Perl Module : FindBin, Version : 1.51, Exit Status : 0
2021-10-21 07:07:55.527 EDT [DEBUG] : Perl Module : Getopt::Long, Version : 2.4, Exit Status : 0
2021-10-21 07:07:55.534 EDT [DEBUG] : Perl Module : Getopt::Std, Version : 1.07, Exit Status : 0
2021-10-21 07:07:55.548 EDT [DEBUG] : Perl Module : IO::File, Version : 1.16, Exit Status : 0
2021-10-21 07:07:55.560 EDT [DEBUG] : Perl Module : IO::Handle, Version : 1.33, Exit Status : 0
2021-10-21 07:07:55.573 EDT [DEBUG] : Perl Module : IPC::Open2, Version : 1.04, Exit Status : 0
2021-10-21 07:07:55.588 EDT [DEBUG] : Perl Module : IPC::Open2, Version : 1.04, Exit Status : 0
2021-10-21 07:07:55.601 EDT [DEBUG] : Perl Module : IPC::Open3, Version : 1.12, Exit Status : 0
2021-10-21 07:07:55.608 EDT [DEBUG] : Perl Module : List::Util, Version : 1.27, Exit Status : 0
2021-10-21 07:07:55.635 EDT [DEBUG] : Perl Module : Math::BigInt, Version : 1.998, Exit Status : 0
2021-10-21 07:07:55.651 EDT [DEBUG] : Perl Module : Net::Domain, Version : 2.20, Exit Status : 0
2021-10-21 07:07:55.694 EDT [DEBUG] : Perl Module : Net::Ping, Version : 2.38, Exit Status : 0
2021-10-21 07:07:55.707 EDT [DEBUG] : Perl Module : Storable, Version : 2.45, Exit Status : 0
2021-10-21 07:07:55.718 EDT [DEBUG] : Perl Module : Term::ANSIColor, Version : 3.01, Exit Status : 0
2021-10-21 07:07:55.726 EDT [DEBUG] : Perl Module : Text::ParseWords, Version : 3.29, Exit Status : 0
2021-10-21 07:07:55.737 EDT [DEBUG] : Perl Module : Text::Wrap, Version : 2009.0305, Exit Status : 0
2021-10-21 07:07:55.749 EDT [DEBUG] : Perl Module : Time::Local, Version : 1.2300, Exit Status : 0
2021-10-21 07:07:55.751 EDT [DEBUG] : PERL_ERROR in checkPerlModules :
2021-10-21 07:07:55.754 EDT [DEBUG] : PERL after all validations : /bin/perl
2021-10-21 07:07:55.757 EDT [DEBUG] : AHF Extract :
2021-10-21 07:07:55.763 EDT [ INFO] : AHF Environment Type : TYPICAL
2021-10-21 07:07:55.766 EDT [ INFO] : AHF_LOC : /etc/oracle.ahf.loc
2021-10-21 07:07:55.768 EDT [ INFO] : CRS HOME from Args :
2021-10-21 07:07:55.771 EDT [ INFO] : OCR Location : /etc/oracle/ocr.loc
2021-10-21 07:07:55.775 EDT [DEBUG] : Is SIHA : 1
2021-10-21 07:07:55.777 EDT [ INFO] : SI ORACLE HOME :
2021-10-21 07:07:55.780 EDT [DEBUG] : AHF Install Type : STANDALONE
2021-10-21 07:07:55.783 EDT [DEBUG] : AHF Local Install : -local
2021-10-21 07:07:55.785 EDT [DEBUG] : TMP AHF HOME :
2021-10-21 07:07:55.788 EDT [DEBUG] : Is UPGRADE Required : 0
2021-10-21 07:07:55.791 EDT [DEBUG] : File init.tfa not found : /etc/init.d/init.tfa

Default AHF Location : /opt/oracle.ahf

Do you want to install AHF at [/opt/oracle.ahf] ? [Y]|N : N

Please Enter new AHF Location :  /u01/oracle/ahf

AHF Location : /u01/oracle/ahf/oracle.ahf

[ERROR] : AHF-00014: AHF Location /u01/oracle/ahf/oracle.ahf is not owned by root in directory hierarchy
2021-10-21 07:07:58.846 EDT [DEBUG] : Removing AHF old DATA Directory [/tmp/.ahf.6244/ahf_data]
2021-10-21 07:07:58.850 EDT [DEBUG] : AHF Install is exiting with status [14]
2021-10-21 07:07:58.852 EDT [DEBUG] : Removing AHF Lock : /tmp/.oracle.ahf.lck

As we can see, even though the root owns the installation directory “ahf”, the process fails since the parent directory “oracle” is owned by oracle.

 u01              --> Owner root
 |_
   oracle         --> Owner oracle
   |_
     ahf          --> Owner root

The obvious way to get past this error would be to change the ownership of the directory “oracle” to root. However, sometimes this is not an option. e.g. our client wanted the ahf files to reside on a separate partition dedicated to Diagnostic files without changing the Automatic Diagnostic Repository (/u01/oracle) ownership.
Also, since the debug mode did not give us any relevant information, the next thing done was to review the ahf_setup installer file. This file provided some vital pieces of important information.

AHF_OVERRIDE_INSTALL_CHECKS

First, you can use the environment variable AHF_OVERRIDE_INSTALL_CHECKS to ignore this requirement and continue with the setup. As you can see, when we use this variable, the installer does not exit its execution; instead, it suppresses the error messages and proceeds.

[root@node-target u01]# export AHF_OVERRIDE_INSTALL_CHECKS=1

[root@node-target u01]# cd /tmp
[root@node-target tmp]# ./ahf_setup

AHF Installer for Platform Linux Architecture x86_64

AHF Installation Log : /tmp/ahf_install_211300_20321_2021_06_16-03_21_40.log

Starting Autonomous Health Framework (AHF) Installation

AHF Version: 21.1.3 Build Date: 202106071249

Default AHF Location : /opt/oracle.ahf

Do you want to install AHF at [/opt/oracle.ahf] ? [Y]|N : N

Please Enter new AHF Location : /u01/oracle/ahf

AHF Location : /u01/oracle/ahf/oracle.ahf

Suppressing 'AHF-00014: AHF Location /u01/oracle/ahf/oracle.ahf is not owned by root in directory hierarchy' as AHF_OVERRIDE_INSTALL_CHECKS=1

AHF Data Directory stores diagnostic collections and metadata.
AHF Data Directory requires at least 5GB (Recommended 10GB) of free space.

Choose Data Directory from below options :

1. /u01/oracle/ahf/oracle.ahf [Free Space : 66121 MB]
2. Enter a different Location

Choose Option [1 - 2] : 1

AHF Data Directory : /u01/oracle/ahf/oracle.ahf/data

Suppressing AHF-00014: AHF Data Location /u01/oracle/ahf/oracle.ahf/data is not owned by root in directory hierarchy as AHF_OVERRIDE_INSTALL_CHECKS=1

Do you want to add AHF Notification Email IDs ? [Y]|N : Y

Enter Email IDs separated by space : kala@pythian.com

Extracting AHF to /u01/oracle/ahf/oracle.ahf

Configuring TFA Services

Discovering Nodes and Oracle Resources

Successfully generated certificates.

Starting TFA Services
Created symlink from /etc/systemd/system/multi-user.target.wants/oracle-tfa.service to /etc/systemd/system/oracle-tfa.service.
Created symlink from /etc/systemd/system/graphical.target.wants/oracle-tfa.service to /etc/systemd/system/oracle-tfa.service.

.-----------------------------------------------------------------------------------.
| Host          | Status of TFA | PID   | Port  | Version    | Build ID             |
+---------------+---------------+-------+-------+------------+----------------------+
| node-target   | RUNNING       | 21833 | 27483 | 21.1.3.0.0 | 21130020210607124914 |
'---------------+---------------+-------+-------+------------+----------------------'

Running TFA Inventory...

Adding default users to TFA Access list...

.----------------------------------------------------------------------.
|                  Summary of AHF Configuration                        |
+-----------------+----------------------------------------------------+
| Parameter       | Value                                              |
+-----------------+----------------------------------------------------+
| AHF Location    | /u01/oracle/ahf/oracle.ahf                         |
| TFA Location    | /u01/oracle/ahf/oracle.ahf/tfa                     |
| Orachk Location | /u01/oracle/ahf/oracle.ahf/orachk                  |
| Data Directory  | /u01/oracle/ahf/oracle.ahf/data                    |
| Repository      | /u01/oracle/ahf/oracle.ahf/data/repository         |
| Diag Directory  | /u01/oracle/ahf/oracle.ahf/data/node-target/diag   |
'-----------------+----------------------------------------------------'


Starting orachk scheduler from AHF ...

AHF binaries are available in /u01/ahf/oracle.ahf/bin

AHF is successfully installed

Moving /tmp/ahf_install_211300_20321_2021_06_16-03_21_40.log to /u01/ahf/oracle.ahf/data/node-target/diag/ahf/

Does it really check the permissions of all the directories ?

Second, the function checkDirPerm executes a while loop to check the ownership of all the directories in the directory tree.
Suppose it finds any directory not owned by root; in that case, it immediately exits with a failure.
The AHF_OVERRIDE_INSTALL_CHECKS variable overrides this behaviour

You can review the usage of the variable and function using the following

grep AHF_OVERRIDE_INSTALL_CHECKS  ahf_setup
grep checkDirPerm  ahf_setup

So to conclude, after using this setup for over a couple of months, it does look like we can safely ignore the error without causing any unintended effects to the functioning of AHF as long as root can write to the directory. Do let me know incase you discover any issues due to this permission over-ride.