acquia / blt

Acquia's toolset for automating Drupal 8 and 9 development, testing, and deployment.
https://docs.acquia.com/blt/
GNU General Public License v2.0
442 stars 394 forks source link

PHP Memory Error in blt setup #1758

Closed tmbritton closed 7 years ago

tmbritton commented 7 years ago

My system information:

Output of blt doctor:

+----------------------+----------------------------------------------------------------------------------+
| Property             | Value                                                                            |
+----------------------+----------------------------------------------------------------------------------+
| %paths               |                                                                                  |
|  - %root             | /var/www/drupal.fancytom.com/docroot                                             |
|  - %site             | sites/default                                                                    |
|  - %modules          | modules                                                                          |
|  - %themes           | themes                                                                           |
|  - %config-sync      | /var/www/drupal.fancytom.com/config/default                                      |
|  - %files            | sites/default/files                                                              |
|  - %private          | /var/www/drupal.fancytom.com/files-private                                       |
|  - %temp             | /tmp                                                                             |
| admin-theme          | seven                                                                            |
| blt-version          | 8.8.6                                                                            |
| bootstrap            | Successful                                                                       |
| config-sync          | /var/www/drupal.fancytom.com/config/default                                      |
| db-driver            | mysql                                                                            |
| db-hostname          | localhost                                                                        |
| db-name              | drupal                                                                           |
| db-password          | drupal                                                                           |
| db-port              | 3306                                                                             |
| db-status            | Connected                                                                        |
| db-username          | drupal                                                                           |
| drupal-settings-file | sites/default/settings.php                                                       |
| drupal-version       | 8.3.4                                                                            |
| drush-alias-files    | /var/www/drupal.fancytom.com/docroot/../drush/site-aliases/aliases.drushrc.php   |
|                      | /var/www/drupal.fancytom.com/docroot/../drush/site-aliases/example.acsf.aliases. |
|                      | drushrc.php                                                                      |
|                      | /var/www/drupal.fancytom.com/docroot/../drush/site-aliases/example.local.aliases |
|                      | .drushrc.php                                                                     |
| drush-conf           | /var/www/drupal.fancytom.com/drush/drushrc.php                                   |
| drush-script         | /var/www/drupal.fancytom.com/vendor/drush/drush/drush.php                        |
| drush-temp           | /tmp                                                                             |
| drush-version        | 8.1.12                                                                           |
| files                | sites/default/files                                                              |
| install-profile      | lightning                                                                        |
| local-drushrc        | /var/www/drupal.fancytom.com/docroot/sites/default/local.drushrc.php             |
| local-settings       | /var/www/drupal.fancytom.com/docroot/sites/default/settings/local.settings.php   |
| modules              | modules                                                                          |
| php-bin              | /usr/bin/php                                                                     |
| php-conf             | /etc/php/5.6/cli/php.ini                                                         |
| php-os               | Linux                                                                            |
| private              | /var/www/drupal.fancytom.com/files-private                                       |
| root                 | /var/www/drupal.fancytom.com/docroot                                             |
| site                 | sites/default                                                                    |
| temp                 | /tmp                                                                             |
| theme                | stark                                                                            |
| themes               | themes                                                                           |
| uri                  | default                                                                          |
| user                 |                                                                                  |
+----------------------+----------------------------------------------------------------------------------+
+--------------------------+---------------------------------------------------------------------------------+
| Check                    | Outcome                                                                         |
+--------------------------+---------------------------------------------------------------------------------+
| checkDocrootExists       | Found docroot.                                                                  |
| checkCoreExists          | Drupal core exists                                                              |
| checkSettingsFile        | BLT settings are included in settings file.                                     |
| checkLocalSettingsFile   | Found your local settings file.                                                 |
| checkLocalDrushFile      | Found your local drush settings file.                                           |
| checkUri                 | Site URI is not set                                                             |
|                          |                                                                                 |
|                          | Is $options['uri'] set correctly in                                             |
|                          | /var/www/drupal.fancytom.com/docroot/sites/default/local.drushrc.php?           |
|                          |                                                                                 |
| checkFileSystem:%files   | Public files directory is writable.                                             |
| checkFileSystem:%private | Private files directory is writable.                                            |
| checkFileSystem:%temp    | Temporary files directory is writable.                                          |
| checkDbConnection        | Connected to database.                                                          |
| checkDrupalBootstrapped  | Bootstrapped Drupal via drush.                                                  |
| checkDrupalInstalled     | Drupal is installed.                                                            |
| checkCaching:page        | Drupal cache is disabled.                                                       |
| checkCaching:css         | CSS preprocessing is disabled.                                                  |
| checkCaching:js          | JS preprocessing is disabled.                                                   |
| checkNvmExists           | NVM does not exist.                                                             |
|                          |                                                                                 |
|                          | It is recommended that you use NVM to manage multiple versions of NodeJS on one |
|                          | machine.                                                                        |
|                          | Instructions for installing NVM can be found at:                                |
|                          |   https://github.com/creationix/nvm#installation                                |
| checkComposer:require    | acquia/blt is in composer.json's require object.                                |
| checkComposer:plugins    | hirak/prestissimo plugin for composer is installed.                             |
| checkBehat:exists        | Behat local settings file exists.                                               |
| checkBehat:uri           | base_url in tests/behat/local.yml does not match the site URI.                  |
|                          |   Behat base_url is set to "http://local.drupal.fancytom.com.com".              |
|                          |   Drush site URI is set to default.                                             |
| checkProjectYml:keys     | project.yml has no deprecated keys.                                             |
| checkPhpDateTimezone     | PHP setting for date.timezone is correctly set                                  |
+--------------------------+---------------------------------------------------------------------------------+

When I run this command:

blt setup

I get the following output:

blt > setup:git-hooks:
   [delete] Deleting: /Users/tom.britton/Sites/fancytom.com_drupal/.git/hooks/pre-commit
   [delete] Deleting: /Users/tom.britton/Sites/fancytom.com_drupal/.git/hooks/commit-msg
     [echo] Symlinking /Users/tom.britton/Sites/fancytom.com_drupal/.git/hooks/pre-commit to /Users/tom.britton/Sites/fancytom.com_drupal/vendor/acquia/blt/scripts/git-hooks/pre-commit
     [exec] pre-commit -> /Users/tom.britton/Sites/fancytom.com_drupal/vendor/acquia/blt/scripts/git-hooks/pre-commit
     [exec] commit-msg -> /Users/tom.britton/Sites/fancytom.com_drupal/vendor/acquia/blt/scripts/git-hooks/commit-msg
blt > setup:composer:install:
Gathering patches for root package.
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
blt > setup:drupal:settings:
blt > setup:drupal:settings:site:
     [echo] Making /Users/tom.britton/Sites/fancytom.com_drupal/docroot/sites/default writable
    [chmod] Changed file mode on '/Users/tom.britton/Sites/fancytom.com_drupal/docroot/sites/default' to 755
     [echo] Making /Users/tom.britton/Sites/fancytom.com_drupal/docroot/sites/default/settings.php writable
    [chmod] Changed file mode on '/Users/tom.britton/Sites/fancytom.com_drupal/docroot/sites/default/settings.php' to 644
     [echo] Ensuring that blt.settings.php is required by settings.php
     [exec] require DRUPAL_ROOT . "/../vendor/acquia/blt/settings/blt.settings.php";
     [echo] Generating local settings files
blt > setup:behat:
     [copy] example.local.yml omitted, is up to date
blt > frontend:setup:
blt > target-hook:invoke:
     [echo] Executing command in /Users/tom.britton/Sites/fancytom.com_drupal/docroot:
     [exec] Executing command: echo 'No frontend-setup configured.'
No frontend-setup configured.
blt > frontend:build:
blt > target-hook:invoke:
     [echo] Executing command in /Users/tom.britton/Sites/fancytom.com_drupal/docroot:
     [exec] Executing command: echo 'No frontend-build configured.'
No frontend-build configured.
blt > frontend:
blt > setup:build:
blt > target-hook:invoke:
     [echo] Executing command in /Users/tom.britton/Sites/fancytom.com_drupal/docroot:
     [exec] Executing command: echo 'No post-setup build configured.'
No post-setup build configured.
blt > setup:drush:settings:
blt > setup:drush:settings:site:
    [chmod] Changed file mode on '/Users/tom.britton/Sites/fancytom.com_drupal/docroot/sites/default' to 755
[reflexive] Applying reflexive processing to 1 files.
blt > setup:hash-salt:
     [echo] Checking for hash salt in /Users/tom.britton/Sites/fancytom.com_drupal/salt.txt
     [echo] /Users/tom.britton/Sites/fancytom.com_drupal/salt.txt already exists.
blt > drupal:install:
     [echo] Installing Drupal...
Warning: the ECDSA host key for 'local.drupal.fancytom.com.com' differs from the key for the IP address '192.168.25.8'
Offending key for IP in /Users/tom.britton/.ssh/known_hosts:10
Matching host key in /Users/tom.britton/.ssh/known_hosts:14
Are you sure you want to continue connecting (yes/no)? yes
Configuration import directory ../config/default does not contain any configuration; will skip import.                                        [warning]
You are about to DROP all tables in your 'drupal' database. Do you want to continue? (y/n): y
Starting Drupal installation. This takes a while. Consider using the --notify global option.                                                       [ok]
PHP Fatal error:  Allowed memory size of 201326592 bytes exhausted (tried to allocate 439115 bytes) in /var/www/drupal.fancytom.com/docroot/core/lib/Drupal/Core/Database/Statement.php on line 59

Fatal error: Allowed memory size of 201326592 bytes exhausted (tried to allocate 439115 bytes) in /var/www/drupal.fancytom.com/docroot/core/lib/Drupal/Core/Database/Statement.php on line 59
Drush command terminated abnormally due to an unrecoverable error.                                                                              [error]
Error: Allowed memory size of 201326592 bytes exhausted (tried to allocate 439115 bytes) in
/var/www/drupal.fancytom.com/docroot/core/lib/Drupal/Core/Database/Statement.php, line 59

BUILD FAILED/Users/tom.britton/Sites/fancytom.com_drupal/./vendor/acquia/blt/phing/tasks/drupal.xml:15:10: /Users/tom.britton/Sites/fancytom.com_drupal/./vendor/acquia/blt/phing/tasks/drupal.xml:32:44: Drush exited with code 255
; 2 minutes  26.91 seconds

And I expected this to happen: I expected the setup process to complete.

grasmash commented 7 years ago

You have 192MB allocated for PHP memory, which is insufficient. See System Requirements docs: http://blt.readthedocs.io/en/8.x/INSTALL/

2G is suggested, though it is likely sufficient to have 512MB.

tmbritton commented 7 years ago

It doesn't seem to be erroring due to the PHP memory limit on the OSX side of things. I raised the memory limit to 2G and I'm getting the same error:

In OSX: $ php -ini | grep "memory_limit" memory_limit => 2G => 2G