Islandora-Collaboration-Group / ISLE

Islandora Enterprise (ISLE) is a community project that addresses two of the most significant pain-points in Islandora: installation and maintenance.
https://Islandora-Collaboration-Group.github.io/ISLE/
GNU General Public License v3.0
32 stars 34 forks source link

Drush problems in ./install-site.sh #32

Closed McFateM closed 6 years ago

McFateM commented 6 years ago

I got my containers running on my MacBook and attempting the final "step", the ./install_site.sh portion of...

docker exec -it isle-web bash
cd /tmp
chmod 777 *.sh
./make_site.sh
./install_site.sh

...but I run into a bunch of these:

Command pm-enable needs a higher bootstrap level to run - you will need to invoke drush from a more functional Drupal environment to run this command.                                  [error]
The drush command 'en islandora_basic_collection' could not be executed.

This appears to have precipitated a number of other errors down the line. I also tried 'cd /var/www/html/sites/default' and running /tmp/install_site.sh but with the same results.

Perhaps we need to define a Drush alias, like @default, and invoke the drush commands using it?

McFateM commented 6 years ago

Just adding a bit more detail... I have a CentOS 7 machine at home running Docker now and tried this build sequence there today... Same result as noted above. I get lots of these...

Drush was attempting to connect to: 
 Drupal version         :  7.56                                        
 Site URI               :  http://default                              
 PHP executable         :  /usr/bin/php                                
 PHP configuration      :  /etc/php5/cli/php.ini                       
 PHP OS                 :  Linux                                       
 Drush script           :  /opt/drush-7.x/vendor/drush/drush/drush.php 
 Drush version          :  7.4.0                                       
 Drush temp directory   :  /tmp                                        
 Drush configuration    :                                              
 Drush alias files      :                                              
 Drupal root            :  /var/www/html                               
 Site path              :  sites/default

Going to try my hand at making some local modifications to work around this. I'll report back whatever the outcome.

McFateM commented 6 years ago

Looks like the issue actually occurs earlier in the process...

root@6a66cf21f72b:/tmp# ./install_site.sh
Installing all Islandora modules
Installing Drupal Site
exception 'Drush\Sql\SqlException' with message 'Unable to find a matching SQL Class. Drush cannot find your database connection details.' in                   [error]
/opt/drush-7.x/vendor/drush/drush/commands/sql/sql.drush.inc:597
Stack trace:
#0 /opt/drush-7.x/vendor/drush/drush/commands/core/site_install.drush.inc(109): drush_sql_get_class()
McFateM commented 6 years ago

OK, so maybe the problem here is not what I thought? I see that the $databases array in my settings.php file is empty...

$databases = array();

McFateM commented 6 years ago

So I killed my terminal session and found that customize/linux_settings.php did indeed have an empty $databases = array(); statement. I edited the file and copied the $databases section from macosx_settings.php and then picked up the process from ,/install_site.sh... and it appears to be working.

McFateM commented 6 years ago

Confirmed. With the addition of the $databases definition lifted from macosx_settings.php transplanted into linux_settings.php the build appears to work properly. I'm logged in to an Islandora instance on my CentOS 7 machine here at home.

g7morris commented 6 years ago

@McFateM Thanks for this update and feedback. Per @br2490 's recent email, you're confirming that the settings.php file used during the build process doesn't work as expected. I'll be able to review tomorrow (Tuesday, Nov 21) and patch.

McFateM commented 6 years ago

Looks like linux_settings.php have already been updated? I pulled a new copy of ISLE this morning for installation on my DGDocker1 platform and that new copy looks right.

g7morris commented 6 years ago

Hmmm... I haven't changed anything since last Friday... Good that it is working though. Thanks for the update. Are we closing this ticket? Or should @br2490 retest?

McFateM commented 6 years ago

Yes, I think this can be closed. I guess last week I pulled code sometime BEFORE the Linux settings change was made? In any case I think this issue is resolved now. Now having very odd issues documented in #33 so I'm focusing there right now.

McFateM commented 6 years ago

Oops... need to re-open this issue. While the $databases statement appears to be correct in customize/web/site/linux_settings.php, in my case those statements are NOT finding their way into /var/www/html/sites/default/settings.php. And I find this to be the case in both of my Linux (on my DGDocker1 VM) and Mac (on my MacBook) copies.

I doubled checked the 'web' section of docker-compose.yml and verified in the case of Linux...

    volumes:
      - ./customize/web/apache/site.conf:/etc/apache2/sites-available/site.conf
      - ./customize/web/site/linux_settings.php:/var/www/html/sites/default/settings.php
      #- ./customize/web/site/macosx_settings.php:/var/www/html/sites/default/settings.php
      - ./customize/web/site:/home/islandora/site

I checked my local copy of linux_settings.php and the $database definition looks correct there, but again, that definition is NOT in my /var/www/html/sites/default/settings.php file. However, if I add the definition to the file and run './install_site.sh' it appears to be working!

McFateM commented 6 years ago

Oops...forgot to re-open above.

g7morris commented 6 years ago

@McFateM Thanks for the update. I'll be reviewing the web build process today on a Centos 7 vagrant vm. I'll see if I can replicate and then patch this.

g7morris commented 6 years ago

Okay @McFateM Thanks for finding this issue. I've patched and resolved it via this commit I had an erroneous blank settings.php copy overwriting the mounted one. D'ouh. Thus no drush connections etc. I've since tested on a CentOS 7 vm and working correctly now. Apologies for your sub-optimal experience but glad you caught it! Closing ticket.