Activation fails if performed with automatic dependencies
Created by: totten
Compare these two ways of activating the extension:
## Approach A - One-by-one
cv en mosaico
cv en mosaicomsgtpl
## Approach B - Automatic dependencies
cv en mosaicomsgtpl
The first one works fine. However, the second one crashes. This is easiest to reproduce if you reset the DB before installing. Example:
$ civibuild restore dmaster && cv en mosaicomsgtpl
WARNING: Failed to find recommended PHP extension "imap".
[[Load saved options from /Users/totten/bknix/build/dmaster.sh]]
[[Setup MySQL and HTTP for CMS]]
[[Restore "/Users/totten/bknix/build/dmaster" DB (cms) from file (/Users/totten/bknix/civicrm-buildkit/app/snapshot/dmaster/cms.sql.gz)]]
[[Setup MySQL for Civi]]
[[Restore "/Users/totten/bknix/build/dmaster" DB (civi) from file (/Users/totten/bknix/civicrm-buildkit/app/snapshot/dmaster/civi.sql.gz)]]
[[Setup MySQL for Test]]
[[Restore "/Users/totten/bknix/build/dmaster" DB (test) from file (/Users/totten/bknix/civicrm-buildkit/app/snapshot/dmaster/civi.sql.gz)]]
Enabling extension "org.civicrm.mosaicomsgtpl"
PHP Fatal error: Class name must be a valid object or a string in /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/Civi/API/SelectQuery.php on line 101
PHP Stack trace:
PHP 1. {main}() /Users/totten/bknix/civicrm-buildkit/bin/cv:0
PHP 2. require() /Users/totten/bknix/civicrm-buildkit/bin/cv:10
PHP 3. Civi\Cv\Application::main() phar:///Users/totten/bknix/civicrm-buildkit/bin/cv/bin/cv:26
PHP 4. Symfony\Component\Console\Application->run() phar:///Users/totten/bknix/civicrm-buildkit/bin/cv/src/Application.php:17
PHP 5. Civi\Cv\Application->doRun() phar:///Users/totten/bknix/civicrm-buildkit/bin/cv/vendor/symfony/console/Application.php:124
PHP 6. Symfony\Component\Console\Application->doRun() phar:///Users/totten/bknix/civicrm-buildkit/bin/cv/src/Application.php:48
PHP 7. Symfony\Component\Console\Application->doRunCommand() phar:///Users/totten/bknix/civicrm-buildkit/bin/cv/vendor/symfony/console/Application.php:193
PHP 8. Symfony\Component\Console\Command\Command->run() phar:///Users/totten/bknix/civicrm-buildkit/bin/cv/vendor/symfony/console/Application.php:850
PHP 9. Civi\Cv\Command\ExtensionEnableCommand->execute() phar:///Users/totten/bknix/civicrm-buildkit/bin/cv/vendor/symfony/console/Command/Command.php:257
PHP 10. Civi\Cv\Command\BaseCommand->callApiSuccess() phar:///Users/totten/bknix/civicrm-buildkit/bin/cv/src/Command/ExtensionEnableCommand.php:96
PHP 11. civicrm_api() phar:///Users/totten/bknix/civicrm-buildkit/bin/cv/src/Command/BaseCommand.php:43
PHP 12. Civi\API\Kernel->runSafe() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/api/api.php:23
PHP 13. Civi\API\Kernel->runRequest() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/Civi/API/Kernel.php:100
PHP 14. Civi\API\Provider\MagicFunctionProvider->invoke() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/Civi/API/Kernel.php:169
PHP 15. civicrm_api3_extension_install() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php:89
PHP 16. CRM_Extension_Manager->install() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/api/v3/Extension.php:58
PHP 17. CRM_Extension_Manager_Module->onPreInstall() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/CRM/Extension/Manager.php:234
PHP 18. CRM_Extension_Manager_Module->callHook() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/CRM/Extension/Manager/Module.php:49
PHP 19. mosaicomsgtpl_civicrm_enable() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/CRM/Extension/Manager/Module.php:76
PHP 20. _mosaicomsgtpl_civix_civicrm_enable() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/ext/mosaicomsgtpl/mosaicomsgtpl.php:69
PHP 21. CRM_Mosaicomsgtpl_Upgrader_Base->onEnable() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/ext/mosaicomsgtpl/mosaicomsgtpl.civix.php:170
PHP 22. CRM_Mosaicomsgtpl_Upgrader->enable() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/ext/mosaicomsgtpl/CRM/Mosaicomsgtpl/Upgrader/Base.php:350
PHP 23. civicrm_api3() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/ext/mosaicomsgtpl/CRM/Mosaicomsgtpl/Upgrader.php:52
PHP 24. Civi\API\Kernel->runSafe() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/api/api.php:43
PHP 25. Civi\API\Kernel->runRequest() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/Civi/API/Kernel.php:100
PHP 26. Civi\API\Provider\MagicFunctionProvider->invoke() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/Civi/API/Kernel.php:169
PHP 27. civicrm_api3_job_mosaico_msg_sync() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php:89
PHP 28. CRM_Core_Transaction->run() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/ext/mosaicomsgtpl/api/v3/Job/MosaicoMsgSync.php:61
PHP 29. {closure:/Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/ext/mosaicomsgtpl/api/v3/Job/MosaicoMsgSync.php:27-61}() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/CRM/Core/Transaction.php:185
PHP 30. civicrm_api3() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/ext/mosaicomsgtpl/api/v3/Job/MosaicoMsgSync.php:33
PHP 31. Civi\API\Kernel->runSafe() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/api/api.php:43
PHP 32. Civi\API\Kernel->runRequest() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/Civi/API/Kernel.php:100
PHP 33. Civi\API\Provider\MagicFunctionProvider->invoke() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/Civi/API/Kernel.php:169
PHP 34. civicrm_api3_mosaico_template_get() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php:89
PHP 35. _civicrm_api3_basic_get() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/ext/mosaico/api/v3/MosaicoTemplate.php:45
PHP 36. Civi\API\SelectQuery->__construct() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/api/v3/utils.php:1237
Fatal error: Class name must be a valid object or a string in /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/Civi/API/SelectQuery.php on line 101
Call Stack:
0.0016 289904 1. {main}() /Users/totten/bknix/civicrm-buildkit/bin/cv:0
0.0062 549456 2. require('phar:///Users/totten/bknix/civicrm-buildkit/bin/cv/bin/cv') /Users/totten/bknix/civicrm-buildkit/bin/cv:10
0.0094 1115384 3. Civi\Cv\Application::main() phar:///Users/totten/bknix/civicrm-buildkit/bin/cv/bin/cv:26
0.0318 3850984 4. Symfony\Component\Console\Application->run() phar:///Users/totten/bknix/civicrm-buildkit/bin/cv/src/Application.php:17
0.0342 4214336 5. Civi\Cv\Application->doRun() phar:///Users/totten/bknix/civicrm-buildkit/bin/cv/vendor/symfony/console/Application.php:124
0.0342 4214640 6. Symfony\Component\Console\Application->doRun() phar:///Users/totten/bknix/civicrm-buildkit/bin/cv/src/Application.php:48
0.0344 4215696 7. Symfony\Component\Console\Application->doRunCommand() phar:///Users/totten/bknix/civicrm-buildkit/bin/cv/vendor/symfony/console/Application.php:193
0.0344 4216272 8. Symfony\Component\Console\Command\Command->run() phar:///Users/totten/bknix/civicrm-buildkit/bin/cv/vendor/symfony/console/Application.php:850
0.0348 4221296 9. Civi\Cv\Command\ExtensionEnableCommand->execute() phar:///Users/totten/bknix/civicrm-buildkit/bin/cv/vendor/symfony/console/Command/Command.php:257
1.9574 41615776 10. Civi\Cv\Command\BaseCommand->callApiSuccess() phar:///Users/totten/bknix/civicrm-buildkit/bin/cv/src/Command/ExtensionEnableCommand.php:96
1.9574 41616424 11. civicrm_api() phar:///Users/totten/bknix/civicrm-buildkit/bin/cv/src/Command/BaseCommand.php:43
1.9575 41616472 12. Civi\API\Kernel->runSafe() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/api/api.php:23
1.9575 41617672 13. Civi\API\Kernel->runRequest() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/Civi/API/Kernel.php:100
1.9621 41700456 14. Civi\API\Provider\MagicFunctionProvider->invoke() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/Civi/API/Kernel.php:169
1.9621 41700592 15. civicrm_api3_extension_install() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php:89
1.9635 41755696 16. CRM_Extension_Manager->install() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/api/v3/Extension.php:58
2.3433 43196744 17. CRM_Extension_Manager_Module->onPreInstall() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/CRM/Extension/Manager.php:234
2.3468 43385688 18. CRM_Extension_Manager_Module->callHook() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/CRM/Extension/Manager/Module.php:49
2.3469 43385976 19. mosaicomsgtpl_civicrm_enable() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/CRM/Extension/Manager/Module.php:76
2.3469 43386032 20. _mosaicomsgtpl_civix_civicrm_enable() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/ext/mosaicomsgtpl/mosaicomsgtpl.php:69
2.3469 43386120 21. CRM_Mosaicomsgtpl_Upgrader_Base->onEnable() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/ext/mosaicomsgtpl/mosaicomsgtpl.civix.php:170
2.3469 43386176 22. CRM_Mosaicomsgtpl_Upgrader->enable() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/ext/mosaicomsgtpl/CRM/Mosaicomsgtpl/Upgrader/Base.php:350
2.3469 43386480 23. civicrm_api3() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/ext/mosaicomsgtpl/CRM/Mosaicomsgtpl/Upgrader.php:52
2.3469 43386832 24. Civi\API\Kernel->runSafe() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/api/api.php:43
2.3470 43388088 25. Civi\API\Kernel->runRequest() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/Civi/API/Kernel.php:100
2.3501 43526656 26. Civi\API\Provider\MagicFunctionProvider->invoke() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/Civi/API/Kernel.php:169
2.3501 43526712 27. civicrm_api3_job_mosaico_msg_sync() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php:89
2.3509 43625136 28. CRM_Core_Transaction->run() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/ext/mosaicomsgtpl/api/v3/Job/MosaicoMsgSync.php:61
2.3509 43625224 29. {closure:/Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/ext/mosaicomsgtpl/api/v3/Job/MosaicoMsgSync.php:27-61}() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/CRM/Core/Transaction.php:185
2.3509 43626008 30. civicrm_api3() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/ext/mosaicomsgtpl/api/v3/Job/MosaicoMsgSync.php:33
2.3509 43626448 31. Civi\API\Kernel->runSafe() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/api/api.php:43
2.3510 43627696 32. Civi\API\Kernel->runRequest() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/Civi/API/Kernel.php:100
2.3532 43644920 33. Civi\API\Provider\MagicFunctionProvider->invoke() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/Civi/API/Kernel.php:169
2.3532 43644952 34. civicrm_api3_mosaico_template_get() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php:89
2.3532 43645048 35. _civicrm_api3_basic_get() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/ext/mosaico/api/v3/MosaicoTemplate.php:45
2.3534 43646872 36. Civi\API\SelectQuery->__construct() /Users/totten/bknix/build/dmaster/sites/all/modules/civicrm/api/v3/utils.php:1237
I suspect a salient bit in the call-stack is where CRM/Mosaicomsgtpl/Upgrader.php
which calls civicrm_api3('Job', 'mosaico_msg_sync', array());
.
(Aside: When/if this issue is addressed, then we can try activating the automated PR test bot.)