Closed
Description
Preconditions (*)
- Have an env.php file
- Magento 2.2.7, Magento 2.2.8, Magento 2.3.1 with any custom command that uses ProductRepositoryInterface
- With the fixes from Fix #21692 #21752 - logic in constructor of address validator and Locale Resolver check #21693 this does not occur on 2.3.1
- This issue still occurs on 2.2.7 with fixes from [Backport] Fix #21692 #21752 - logic in constructor of address validator and Locale Resolver check #21719 applied
Steps to reproduce (*)
- Install a custom CLI command that injects
Magento\Catalog\Api\ProductRepositoryInterface
into its constructor - Set up an env file with your environment settings
- Install Magento from CLI
Expected result (*)
Magento will be installed
Actual result (*)
Magento is not installed. At step 4, Installing database schema
, the installer will fail with the exception:
Base table or view not found: 1146 Table 'YOUR_DATABASE_NAME.store_website' doesn't exist
The exception occurs because Magento\Framework\Locale\Resolver
has logic in its constructor that ends up making a database query. The "creation stack" goes down through \Magento\Framework\Stdlib\DateTime\Timezone
-> Magento\Framework\Stdlib\DateTime\Filter\Date
-> Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper
-> \Magento\Catalog\Model\ProductRepository
.