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

Added a try catch for the fatal error #725

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

CrochetFeve0251
Copy link
Contributor

Fix the issue due to the Runtime exception raised by Action Scheduler when the tables are not present.

Fix #720

@CrochetFeve0251 CrochetFeve0251 self-assigned this May 2, 2023
@CrochetFeve0251 CrochetFeve0251 requested a review from a team May 2, 2023 12:31
@Mai-Saad Mai-Saad self-requested a review May 24, 2023 14:27
@Mai-Saad
Copy link

@CrochetFeve0251 thanks for the PR.
Can see the error on the PR with the following steps: (can you please check)
precondition: manually delete AS tables from database
1- fresh install and activation of imagify
2- add keys => error appeared although it's valid
3- open imagify settings https://new.rocketlabsqa.ovh/wp-admin/options-general.php?page=imagify => error in logs
[24-May-2023 14:52:49 UTC] PHP Fatal error: Uncaught RuntimeException: Unable to claim actions. Database error. in /var/www/new.rocketlabsqa.ovh/htdocs/wp-content/plugins/imagify-plugin/inc/Dependencies/ActionScheduler/classes/data-stores/ActionScheduler_DBStore.php:938 Stack trace: #0 /var/www/new.rocketlabsqa.ovh/htdocs/wp-content/plugins/imagify-plugin/inc/Dependencies/ActionScheduler/classes/data-stores/ActionScheduler_DBStore.php(799): ActionScheduler_DBStore->claim_actions() #1 /var/www/new.rocketlabsqa.ovh/htdocs/wp-content/plugins/imagify-plugin/inc/Dependencies/ActionScheduler/classes/data-stores/ActionScheduler_HybridStore.php(221): ActionScheduler_DBStore->stake_claim() #2 /var/www/new.rocketlabsqa.ovh/htdocs/wp-content/plugins/imagify-plugin/inc/Dependencies/ActionScheduler/classes/ActionScheduler_QueueRunner.php(157): ActionScheduler_HybridStore->stake_claim() #3 /var/www/new.rocketlabsqa.ovh/htdocs/wp-content/plugins/imagify-plugin/inc/Dependencies/ActionScheduler/classes/ActionScheduler_QueueRunner.php(136): ActionScheduler_QueueRunner->do_batch() #4 /var/www/new.rocketlabsqa.ovh/htdocs/wp-includes/class-wp-hook.php(308): ActionScheduler_QueueRunner->run() #5 /var/www/new.rocketlabsqa.ovh/htdocs/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() #6 /var/www/new.rocketlabsqa.ovh/htdocs/wp-includes/plugin.php(565): WP_Hook->do_action() #7 /var/www/new.rocketlabsqa.ovh/htdocs/wp-cron.php(188): do_action_ref_array() #8 {main} thrown in /var/www/new.rocketlabsqa.ovh/htdocs/wp-content/plugins/imagify-plugin/inc/Dependencies/ActionScheduler/classes/data-stores/ActionScheduler_DBStore.php on line 938
@piotrbak please advise if we need to recreate the tables 🙏

Note: we won't be able to delete the plugin in this case from plugins list

@piotrbak
Copy link

piotrbak commented Jun 2, 2023

@CrochetFeve0251 Aren't we checking the AS tables when installing/updating the WP Rocket? 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PHP Fatal error: Uncaught RuntimeException: Unable to claim actions. Database error
4 participants