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

Project creation: RoboFile ignores php memory limit #3910

Closed viktor-silakov closed 4 years ago

viktor-silakov commented 4 years ago

I want to... Create a new project via BLT using a command: composer create-project --no-interaction --ignore-platform-reqs acquia/blt-project test-blt and also tried to use: COMPOSER_MEMORY_LIMIT=-1 composer create-project --no-interaction --ignore-platform-reqs acquia/blt-project test-blt the same result

It's not working because... This throws an error:

HP Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 32768 bytes) in /Users/viktar.silakou/test-blt/vendor/acquia/blt/RoboFile.php on line 394

but in php.ini I have 4 GB memory limit: php -r "echo ini_get('memory_limit').PHP_EOL;" 4GB

Detailed error output `COMPOSER_MEMORY_LIMIT=-1 composer create-project --no-interaction acquia/blt-project test-blt 1/2: http://repo.packagist.org/p/provider-latest$7859a8e4ddbec6265164b9f131f6bb96781608b98b5992e78092b98f4eb6d871.json 2/2: http://repo.packagist.org/p/provider-2019-07$a8147c40473124a8791b8cd3586c370a00593de0d4b9e2b75248c000ead64a87.json Finished: success: 2, skipped: 0, failure: 0, total: 2 1/2: http://repo.packagist.org/p/provider-latest$7859a8e4ddbec6265164b9f131f6bb96781608b98b5992e78092b98f4eb6d871.json 2/2: http://repo.packagist.org/p/provider-2019-07$a8147c40473124a8791b8cd3586c370a00593de0d4b9e2b75248c000ead64a87.json Finished: success: 2, skipped: 0, failure: 0, total: 2 Installing acquia/blt-project (10.5.0)

Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 32768 bytes) in /Users/viktar.silakou/test-blt/vendor/acquia/blt/RoboFile.php on line 394 BLT installation failed! Please execute /Users/viktar.silakou/test-blt/vendor/acquia/blt/bin/blt internal:create-project --ansi --verbose to debug the issue.

[Exception] Installation aborted due to error` BLT doctor output

BLT doctor fails with the same error

System information

danepowell commented 4 years ago

BLT doesn't do anything to change the PHP memory limit. It certainly wouldn't make the memory limit lower than what's set by default. Something in your PHP configuration must be making it so low (only 2M?) Are you sure you don't have multiple PHP versions installed with different memory limits, or perhaps an override in a setting file for your Drupal site, or in a php.ini file specific to a particular CLI?

viktor-silakov commented 4 years ago

hi @danepowell, I found other PHP versions on my laptop this is standard mac binary I set the memory limit for it to but this is not helped. I paste a bit code in vendor/composer/autoload_real.php -in this file, the requiring of RoboFile.php is occurring, this code: exit(ini_get('memory_limit')); and this tells me that have limit: 4GB

viktor-silakov commented 4 years ago

or perhaps an override in a setting file for your Drupal site

What did you mean? I create a new project here.

viktor-silakov commented 4 years ago

Also, I have tried running such a way: php -d memory_limit=-1 composer.phar create-project, unfortunately, the same result.

viktor-silakov commented 4 years ago

Сurrent information about the problem at the moment:

  1. I have two versions of PHP on my laptop, one of them I can't remove because it is system files: the first one: image the second one: image
  2. I start to create the BLT project via command: composer create-project --no-interaction --ignore-platform-reqs acquia/blt-project test-blt7 and get an error: PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar:///usr/local/Cellar/composer/1.9.1/bin/composer/src/Composer/DependencyResolver/Solver.php on line 223 because 1.5GB is internal value for composer

I decide to disable memory limit for composer and run the command: COMPOSER_MEMORY_LIMIT=-1 composer create-project --no-interaction --ignore-platform-reqs acquia/blt-project test-blt8 the previous stage pass OK but then I get an error: Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 32768 bytes) in /Users/viktar.silakou/test-blt8/vendor/acquia/blt/RoboFile.php on line 394 looks like RoboFile.php don't take memory limits from composer. %(

viktor-silakov commented 4 years ago

Finally, I found out the reason. There is a mistake in my PHP.INI file, the thing is PHP doesn't understand 'GB' notation, I changed memory_limit = 4GB to memory_limit = 4G and all works fine.