Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commerce fails to install via command line on 2.1.0 #752

Closed
boboldehampsink opened this issue Feb 26, 2019 · 2 comments

Comments

@boboldehampsink
Copy link
Contributor

commented Feb 26, 2019

Description

Craft Commerce fails to install via cli with project.yaml:

web_1         | Exception: No primary site exists (/app/user/vendor/craftcms/cms/src/services/Sites.php:496)
web_1         | #0 /app/user/vendor/craftcms/cms/src/base/Element.php(876): craft\services\Sites->getPrimarySite()
web_1         | #1 /app/user/vendor/yiisoft/yii2/base/BaseObject.php(109): craft\base\Element->init()
web_1         | #2 /app/user/vendor/craftcms/commerce/src/migrations/Install.php(1646): yii\base\BaseObject->__construct()
web_1         | #3 /app/user/vendor/craftcms/commerce/src/migrations/Install.php(1201): craft\commerce\migrations\Install->_defaultDonationPurchasable()
web_1         | #4 /app/user/vendor/craftcms/commerce/src/migrations/Install.php(71): craft\commerce\migrations\Install->insertDefaultData()
web_1         | #5 /app/user/vendor/craftcms/cms/src/db/Migration.php(56): craft\commerce\migrations\Install->safeUp()
web_1         | #6 /app/user/vendor/craftcms/cms/src/db/MigrationManager.php(243): craft\db\Migration->up(true)
web_1         | #7 /app/user/vendor/craftcms/cms/src/base/Plugin.php(152): craft\db\MigrationManager->migrateUp(Object(craft\commerce\migrations\Install))
web_1         | #8 /app/user/vendor/craftcms/cms/src/services/Plugins.php(520): craft\base\Plugin->install()
web_1         | #9 /app/user/vendor/craftcms/cms/src/migrations/Install.php(1121): craft\services\Plugins->installPlugin('commerce')
web_1         | #10 /app/user/vendor/craftcms/cms/src/migrations/Install.php(1015): craft\migrations\Install->_installPlugins()
web_1         | #11 /app/user/vendor/craftcms/cms/src/migrations/Install.php(71): craft\migrations\Install->insertDefaultData()
web_1         | #12 /app/user/vendor/craftcms/cms/src/db/Migration.php(56): craft\migrations\Install->safeUp()
web_1         | #13 /app/user/vendor/craftcms/cms/src/db/MigrationManager.php(243): craft\db\Migration->up(true)
web_1         | #14 /app/user/vendor/craftcms/cms/src/console/controllers/InstallController.php(161): craft\db\MigrationManager->migrateUp(Object(craft\migrations\Install))
web_1         | #15 [internal function]: craft\console\controllers\InstallController->actionCraft()
web_1         | #16 /app/user/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
web_1         | #17 /app/user/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
web_1         | #18 /app/user/vendor/yiisoft/yii2/console/Controller.php(148): yii\base\Controller->runAction('', Array)
web_1         | #19 /app/user/vendor/yiisoft/yii2/base/Module.php(528): yii\console\Controller->runAction('', Array)
web_1         | #20 /app/user/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('install', Array)
web_1         | #21 /app/user/vendor/craftcms/cms/src/console/Application.php(93): yii\console\Application->runAction('install', Array)
web_1         | #22 /app/user/vendor/yiisoft/yii2/console/Application.php(147): craft\console\Application->runAction('install', Array)
web_1         | #23 /app/user/vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest(Object(craft\console\Request))
web_1         | #24 /app/user/craft(23): yii\base\Application->run()
web_1         | #25 {main}

Steps to reproduce

  1. Create project with project.yaml
  2. Install fresh project with that project.yaml

Additional info

  • Craft version: 3.1.14
  • PHP version: 7.3.2
  • Database driver & version: PostgreSQL 10.6
  • Plugins & versions: 2.1.0.2
@boboldehampsink

This comment has been minimized.

Copy link
Contributor Author

commented Feb 27, 2019

This is because Craft Commerce is saving the donation purchasable element on Craft install, when no site exists yet. This should probably be done with a more low-level migration.

@boboldehampsink

This comment has been minimized.

Copy link
Contributor Author

commented Feb 27, 2019

PR #756 fixes this

@boboldehampsink boboldehampsink changed the title Commerce fails to install on 2.1.0 Commerce fails to install via command line on 2.1.0 Feb 28, 2019
@andris-sevcenko andris-sevcenko self-assigned this Mar 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.