experius / Magento2-Module-Multiple-Website-Store-Code-Url

14 stars 8 forks source link

causes connection error during ./bin/magento setup:static-content:deploy in pre deployment step #16

Open Flyingmana opened 4 years ago

Flyingmana commented 4 years ago

execution in an early build step, where no database is available yet

command: ./bin/magento setup:static-content:deploy

error: DomainException: Connection "default" is not defined in

DomainException: Connection "default" is not defined in /var/www/html/vendor/magento/framework/App/ResourceConnection.php:149
Stack trace:
 #0 /var/www/html/vendor/magento/framework/App/ResourceConnection.php(97): Magento\Framework\App\ResourceConnection->getConnectionByName('default')
#1 /var/www/html/vendor/experius/module-multiplewebsitestorecodeurl/Helper/Data.php(104): Magento\Framework\App\ResourceConnection->getConnection()
#2 /var/www/html/vendor/experius/module-multiplewebsitestorecodeurl/Helper/Data.php(124): Experius\MultipleWebsiteStoreCodeUrl\Helper\Data->getRequestToWebsiteId(Object(Magento\Framework\App\Request\Http))
#3 /var/www/html/vendor/experius/module-multiplewebsitestorecodeurl/Plugin/Magento/Store/App/Request/StorePathInfoValidator.php(105): Experius\MultipleWebsiteStoreCodeUrl\Helper\Data->getRequestToWebsite(Object(Magento\Framework\App\Request\Http))
#4 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(146): Experius\MultipleWebsiteStoreCodeUrl\Plugin\Magento\Store\App\Request\StorePathInfoValidator->afterGetValidStoreCode(Object(Magento\Store\App\Request\StorePathInfoValidator\Interceptor), NULL, Object(Magento\Framework\App\Request\Http))
#5 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Store\App\Request\StorePathInfoValidator\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#6 /var/www/html/generated/code/Magento/Store/App/Request/StorePathInfoValidator/Interceptor.php(26): Magento\Store\App\Request\StorePathInfoValidator\Interceptor->___callPlugins('getValidStoreCo...', Array, Array)
#7 /var/www/html/vendor/magento/module-store/Model/StoreResolver.php(99): Magento\Store\App\Request\StorePathInfoValidator\Interceptor->getValidStoreCode(Object(Magento\Framework\App\Request\Http))
#8 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Store\Model\StoreResolver->getCurrentStoreId()
#9 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Store\Model\StoreResolver\Interceptor->___callParent('getCurrentStore...', Array)
#10 /var/www/html/vendor/magento/module-staging/Plugin/Store/Model/StoreResolver.php(77): Magento\Store\Model\StoreResolver\Interceptor->Magento\Framework\Interception\{closure}()
....
Flyingmana commented 4 years ago

I guess \Experius\MultipleWebsiteStoreCodeUrl\Helper\Data::getRequestToWebsiteId needs to be extended to also support configs set via app/etc/config.php