markshust / docker-magento2-php

This image is built from the official php repository and contains PHP configurations for Magento 2.
MIT License
52 stars 61 forks source link

Maybe add en exception for tracking, if 'docker-compose run --rm setup' was not executed, while fresh 'up' executed. #29

Closed Anton-Latukha closed 8 years ago

Anton-Latukha commented 8 years ago

This all while building from current docker-compose. My bad, This all is because I looked-over docker-compose run --rm setup.

Maybe add an exception for stupid people, like me?

Syndrome: In setup-config:

if [ -d $WWW_DIR/bin ] && [ ! -f $WWW_DIR/bin/magento-php ]; then
  mv $WWW_DIR/bin/magento $WWW_DIR/bin/magento-php
  cp /usr/local/bin/magento $WWW_DIR/bin/
fi

[ ! -f $WWW_DIR/bin/magento-php ] is true.

But then, while doing mv $WWW_DIR/bin/magento $WWW_DIR/bin/magento-php

seems there is no $WWW_DIR/bin/magento, so then no $WWW_DIR/bin/magento-php file.

And then: cp /usr/local/bin/magento $WWW_DIR/bin/ is a successful command

So now /srv/www/bin/magento exists and it runs:

/usr/local/bin/php /srv/www/bin/magento-php $*

But there is no magento-php.

So result of all that is:

And then Cron perpetually runs: /usr/local/bin/php $WWW_DIR/bin/magento-php cron:run AND /usr/local/bin/php $WWW_DIR/bin/magento-php setup:cron:run

So PHP perpetually reports:

Could not open input file: /srv/www/bin/magento-php

Also this happens: https://github.com/mageinferno/docker-magento2-php/issues/28

Anton-Latukha commented 8 years ago

After perpetual errors:

phpfpm_1   | Could not open input file: /srv/www/update/cron.php
phpfpm_1   | Could not open input file: /srv/www/bin/magento-php
...
phpfpm_1   | Warning: require_once(/srv/www/update/vendor/autoload.php): failed to open stream: No such file or directory in /srv/www/update/app/bootstrap.php on line 13
phpfpm_1   | 
phpfpm_1   | Fatal error: require_once(): Failed opening required '/srv/www/update/vendor/autoload.php' (include_path='.:/usr/local/lib/php') in /srv/www/update/app/bootstrap.php on line 13
phpfpm_1   | Could not open input file: /srv/www/bin/magento-php
phpfpm_1   | Could not open input file: /srv/www/bin/magento-php
phpfpm_1   | 
phpfpm_1   | Fatal error: Uncaught Error: Class 'Monolog\Logger' not found in /srv/www/update/app/code/Magento/Update/UpdateLoggerFactory.php:45
phpfpm_1   | Stack trace:
phpfpm_1   | #0 /srv/www/update/app/code/Magento/Update/Status.php(77): Magento\Update\UpdateLoggerFactory->create()
phpfpm_1   | #1 /srv/www/update/cron.php(15): Magento\Update\Status->__construct()
phpfpm_1   | #2 {main}
phpfpm_1   |   thrown in /srv/www/update/app/code/Magento/Update/UpdateLoggerFactory.php on line 45
Anton-Latukha commented 8 years ago

This all while building from current docker-compose.

Anton-Latukha commented 8 years ago

My bad, This all is because I looked-over docker-compose run --rm setup.

Anton-Latukha commented 8 years ago

Maybe add an exception for stupid people, like me?

markshust commented 8 years ago

Nope