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

PHP Fatal error in cron job magento_giftcardaccount_update_states #35523

Open
5 tasks
engcom-November opened this issue May 23, 2022 · 6 comments
Open
5 tasks
Labels
Adobe Commerce The issue related to the Adobe Commerce(EE) or B2B functionality Area: UI Framework Component: Cron Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: ready for dev Reported on 2.4.x Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch

Comments

@engcom-November
Copy link

engcom-November commented May 23, 2022

@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

  1. Tested with Adobe Commerce v2.4.3-p1. Other versions are also affected.
  2. Create a new Website and associated Store but no store view
  3. cron enabled

Steps to reproduce

  1. Created new website and Store (Stores - All Stores) but no store view
  2. Reindex and clear cache
  3. Inserted record in cron_schedule table with job_code "jmagento_giftcardaccount_update_states"
  4. ran cron job from CLI:
  5. php bin/magento cron:run --group magento_giftcardaccount_update_states;
    Output: Job ran successfully without any errors
  6. 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”.
@m2-assistant
Copy link

m2-assistant bot commented May 23, 2022

Hi @engcom-November. Thank you for your report.
To speed up processing of this issue, make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@m2-community-project m2-community-project bot added this to Ready for Confirmation in Issue Confirmation and Triage Board May 23, 2022
@engcom-November engcom-November changed the title https://github.com/magento/partners-magento2ee/issues/682 PHP Fatal error in cron job magento_giftcardaccount_update_states May 23, 2022
@engcom-November engcom-November added the Reported on 2.4.x Indicates original Magento version for the Issue report. label May 23, 2022
@engcom-November engcom-November self-assigned this May 23, 2022
@m2-assistant
Copy link

m2-assistant bot commented May 23, 2022

Hi @engcom-November. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-November
Copy link
Author

Created new issue as this issue got moved to partners-ee repo: https://github.com/magento/partners-magento2ee/issues/681. Hence confirming the issue here.

@engcom-November engcom-November added Component: Cron Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Area: UI Framework Adobe Commerce The issue related to the Adobe Commerce(EE) or B2B functionality labels May 23, 2022
@m2-community-project m2-community-project bot moved this from Ready for Confirmation to Confirmed in Issue Confirmation and Triage Board May 23, 2022
@engcom-November engcom-November added Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Issue: ready for confirmation labels May 23, 2022
@m2-community-project m2-community-project bot moved this from Confirmed to Ready for Confirmation in Issue Confirmation and Triage Board May 23, 2022
@m2-community-project m2-community-project bot added Issue: ready for confirmation and removed Issue: ready for confirmation Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels May 23, 2022
@engcom-November engcom-November added the Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed label May 23, 2022
@m2-community-project m2-community-project bot moved this from Ready for Confirmation to Confirmed in Issue Confirmation and Triage Board May 23, 2022
@engcom-November engcom-November added the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label May 23, 2022
@m2-community-project m2-community-project bot added this to Dev In Progress in High Priority Backlog May 23, 2022
@github-jira-sync-bot
Copy link

❌ Cannot export the issue. This GitHub issue is already linked to Jira issue(s): https://jira.corp.magento.com/browse/AC-3024

@fredden
Copy link
Member

fredden commented May 23, 2022

@engcom-November can the original issue not be transferred back here?
It looks like the formatting of the issue has been lost in the copy/paste.

@engcom-November engcom-November removed their assignment Aug 8, 2022
@m2-community-project m2-community-project bot moved this from Dev In Progress to Ready for Development in High Priority Backlog Aug 8, 2022
@fredden
Copy link
Member

fredden commented Sep 5, 2022

@engcom-November please can you fix the formatting of this issue to match the original I submitted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Adobe Commerce The issue related to the Adobe Commerce(EE) or B2B functionality Area: UI Framework Component: Cron Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: ready for dev Reported on 2.4.x Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch
Projects
High Priority Backlog
  
Ready for Development
Development

No branches or pull requests

3 participants