Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installdb.pp failing to unzip 18c source due to directory ownership/permission issue #257

Open
shammid opened this issue Apr 26, 2019 · 6 comments

Comments

@shammid
Copy link

shammid commented Apr 26, 2019

The issue doesn't exist if oracle home path is pre-created. Otherwise, the path is getting created, but with root ownership for parent directories.

oracle base: /u01/app already exists.
path expected: /u01/app/oracle/product/18.0.0/db_home1

Path is getting created, but, oracle, product, & 18.0.0 directories are owned by root. The last one db_home1 is correctly owned by oracle:oinstall. Due to parent directories being 740, the unzip into the newly created path is failing.

The path is being created by this code in installdb.pp:

if ( $version in ['18.0.0.0']) {
# add oracle home for the unzip
db_directory_structure{"oracle structure ${version}_${title}":
ensure => present,
oracle_base_dir => $oracle_base,
oracle_home_dir => $oracle_home,
ora_inventory_dir => $ora_inventory,
download_dir => $resp_file_dir,
os_user => $user,
os_group => $group_install,
}

Likely culprit is db_directory_structure.rb:
unless oracle_home.nil?
make_directory oracle_home
owned_by_oracle oracle_home, user, group
end
end

def make_directory(path)
Puppet.info "creating directory #{path}"
FileUtils.mkdir_p path
end

def owned_by_oracle(path, user, group)
Puppet.info "Setting oracle ownership for #{path} with 0775"
FileUtils.chmod 0775, path
FileUtils.chown user, group, path
end

I couldn't find details on FileUtils.chown, but it appears it is only changing ownership of the full path /u01/app/oracle/product/18.0.0./db_home1 and leaves the parent directories at their original root ownership.

This was not an issue prior to 18c since oracle_home creation wasn't part of db_directory_structure then.

@shammid shammid closed this as completed Apr 26, 2019
@shammid shammid reopened this Apr 29, 2019
@shammid
Copy link
Author

shammid commented Apr 29, 2019

This is indeed and issue.

@biemond
Copy link
Owner

biemond commented Apr 29, 2019

Hi, what is the issue here. I cannot and will not change the parent dirs because that will do more harm then it solves

@shammid
Copy link
Author

shammid commented Apr 29, 2019 via email

@biemond
Copy link
Owner

biemond commented Apr 29, 2019

you don't need to create it yourself. it just works in https://github.com/biemond/biemond-oradb-vagrant-18.3-CDB-puppet4_3 and with grid https://github.com/biemond/biemond-oradb-vagrant-18.3-ASM-puppet4_3

so what does not work for you and take a look at these vagrant boxes

thanks

@sureshr7
Copy link

sureshr7 commented Jan 15, 2020

On a similar issue, if grid home and oracle home shares the same base directory oracle home is not getting created.

Notice: /Stage[main]/Profile::Oracle::Server/Oradb::Installdb[dbsoftware]/Notify[oradb::installdb /u01/app/oracle/product/19.0.0/dbhome_1 does not exists]/message: defined 'message' as 'oradb::installdb /u01/app/oracle/product/19.0.0/dbhome_1 does not exists'
Error: 'unzip -o /u01/app/oracle/patches//oracle19c_july2019psu.zip -d /u01/app/oracle/product/19.0.0/dbhome_1' returned 2 instead of one of [0]

-bash-4.2$ ls -tlr
total 4
drwxrwxr-x 84 oracle oinstall 4096 Jan 14 18:04 grid
-bash-4.2$ pwd
/u01/app/oracle/product/19.0.0

@sureshr7
Copy link

Even after using different path, db software install failed and puppet server log shows db_directory_structure.rb is creating grid home(/u01/app/grid/product/19.0.0/grid) again instead of oracle home (/u01/app/oracle/product/19.0.0/dbhome_1)

Info: configure oracle folders for grid structure 19.0.0.0
Info: create the following directories: /u01/app/grid, /u01/app/oraInventory, /u01/app/oracle/patches/
Info: creating directory /u01/app/grid
Info: creating directory /u01/app/oracle/patches/
Info: creating directory /u01/app/oraInventory
Info: Setting oracle ownership for /u01/app/grid with 0775
Info: Setting public permissions 0777 for /u01/app/oracle/patches/
Info: Setting oracle ownership for /u01/app/oraInventory with 0775
Info: creating directory /u01/app/grid/product/19.0.0/grid
Info: Setting oracle ownership for /u01/app/grid/product/19.0.0/grid with 0775

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants