Description
@fredden Reopening this issue reported by you as the old one is transferred to partnersee-repo
https://github.com/magento/partners-magento2ee/issues/681
Preconditions and environment
- Tested with Adobe Commerce v2.4.3-p1. Other versions are also affected.
- Create a new Website and associated Store but no store view
- cron enabled
Steps to reproduce
- Created new website and Store (Stores - All Stores) but no store view
- Reindex and clear cache
- Inserted record in cron_schedule table with job_code "jmagento_giftcardaccount_update_states"
- ran cron job from CLI:
- php bin/magento cron:run --group magento_giftcardaccount_update_states;
Output: Job ran successfully without any errors - Verify message in cron_schedule table:
Note: Other records inserted gives no errors.
Note: If Store view is created for the new store, error is not displayed on performing above steps.
Expected result
No PHP error should be displayed.
Actual result
PHP Fatal error is thrown.
app@686b4c600be7:~/html$ vendor/bin/n98-magerun2 sys:cron:run magento_giftcardaccount_update_states
Run Magento\GiftCardAccount\Model\Cron::updateStates PHP Fatal error: Uncaught Error: Call to a member function getId() on null in /var/www/html/vendor/magento/module-gift-card-account/Model/Cron.php:91
Stack trace:
#0 phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/src/N98/Magento/Command/System/Cron/RunCommand.php(66): Magento\GiftCardAccount\Model\Cron->updateStates(Object(Magento\Cron\Model\Schedule\Interceptor))
#1 /var/www/html/vendor/symfony/console/Command/Command.php(255): N98\Magento\Command\System\Cron\RunCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/src/N98/Magento/Command/AbstractMagentoCommand.php(363): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/vendor/symfony/console/Application.php(1027): N98\Magento\Command\AbstractMagentoCommand->run(Object(S in /var/www/html/vendor/magento/module-gift-card-account/Model/Cron.php on line 91
Fatal error: Uncaught Error: Call to a member function getId() on null in /var/www/html/vendor/magento/module-gift-card-account/Model/Cron.php:91
Stack trace:
#0 phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/src/N98/Magento/Command/System/Cron/RunCommand.php(66): Magento\GiftCardAccount\Model\Cron->updateStates(Object(Magento\Cron\Model\Schedule\Interceptor))
#1 /var/www/html/vendor/symfony/console/Command/Command.php(255): N98\Magento\Command\System\Cron\RunCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/src/N98/Magento/Command/AbstractMagentoCommand.php(363): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 phar:///var/www/html/vendor/n98/magerun2-dist/n98-magerun2/vendor/symfony/console/Application.php(1027): N98\Magento\Command\AbstractMagentoCommand->run(Object(S in /var/www/html/vendor/magento/module-gift-card-account/Model/Cron.php on line 91
app@686b4c600be7:~/html$
Additional information
No response
Release note
No response
Triage and priority
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.