universityofadelaide / s2i-shepherd-drupal

An S2I enabled image for hosting Drupal applications in OpenShift

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Drush failed to install site due to permission issue

johnreytanquinco opened this issue · comments

We have been using the develop branch files as reference to spin up a site into OpenShift. Just did some modification like the path, names, etc.

We were able to push the application image into the registry and use it to create a project. The site runs fine on its traditional set up or installation from web browser, but we want to run drush command to automatically connect the site into its database and properly install.

Now when we include drush -y site-install --db-url..., we are getting the error message below:

Executing: mysql --defaults-extra-file=/tmp/drush_07DZCl --database=information_schema --host=-db --silent  < /tmp/drush_CoCH2k > /dev/null      
You are about to create a /var/www/html/sites/default/settings.php file and CREATE the '' database. Do you want to continue? (y/n): y            
Sites directory /var/www/html/sites/default already exists - proceeding.                                                                 [notice]
copy(/var/www/html/sites/default/settings.php): failed to open stream: Permission denied drush.inc:726                                [warning]  
Failed to copy sites/default/default.settings.php to /var/www/html/sites/default/settings.php                                         [error]    
Command dispatch complete 

It seems like a permission issue that drush is not allowed to write in drupal folder.

We noticed that after running drush there are cache created from /tmp folder. So we try to add/change ownership and access permission to `/tmp' directory

&&  chown -R 33:0   /tmp
&&  chmod -R g+rwX  /tmp

Rebuild the image and rerun again.
But the result is the same.

I doubt you are still waiting for a response here, but if you are, i'd suggest switching to the new 18.04 branch and trying that - https://github.com/universityofadelaide/s2i-shepherd-drupal/tree/feature/18.04
Closing this issue as its out of date now.