woocommerce / action-scheduler

A scalable, traceable job queue for background processing large queues of tasks in WordPress. Specifically designed for distribution in WordPress plugins (and themes) - no server access required.
https://actionscheduler.org
GNU General Public License v3.0
622 stars 113 forks source link

Reasons for past-due actions #1064

Closed Dani2449 closed 1 week ago

Dani2449 commented 1 month ago

image

i got everytime this error

barryhughes commented 1 month ago

@Dani2449 to confirm, the problem here is that issues generally become past-due, within your site, or is it a specific problem with the action_scheduler/migration_hook task?

Dani2449 commented 1 month ago

image

Hello @barryhughes it's just showing like this I am not sure if there is a problem caused to anything else just dont know why its going it.

I am using the plugin Popup Maker and WPForm and i think it start from there

barryhughes commented 1 month ago

Hi @Dani2449,

So it sounds like the queue isn't always running successfully. There are actually several different contexts in which Action Scheduler typically runs:

Context Supported 'out of the box' Requires web traffic
WP Cron (async HTTP) Yes Yes
WP Cron (via system cron) No No
Async HTTP Yes Yes
WP CLI (via system cron) No No

As you can see from the above table, both of the default ('out of the box') methods require your website to receive a regular flow of traffic, otherwise the queue runner may not be started. You can mitigate this by using a system scheduler ('cron') and, if you set this up for WordPress, then Action Scheduler should also be able to take advantage of it:

developer.wordpress.org/plugins/cron/hooking-wp-cron-into-the-system-task-scheduler

If you haven't already done so, can you follow the steps outlined in the above post and see if that helps?

It's not clear if this is the problem, so it may be something else is happening (such as a 'rogue plugin' throwing an error or prematurely ending execution in a way that stops Action Scheduler for being able to reliably process the queue of waiting actions), but that is relatively rare so I'd recommend starting with the above.

Note also that many web hosts have their own set of instructions for reliably invoking WP Cron, so you may also wish to search their help pages for further guidance.

Dani2449 commented 1 month ago

i am for now using the Local to have the wrodpress on my computer first this is why i want to fix it.

i did so before but there were not problem it looks like after Popup Marker because i have some buttons on te website for call to action and i wanted when you click it will use the WPForm if you can suggest how to do it easyer or with other plugin i think it will work.

can you suggest a better plugin to see if this problem is repyting.

barryhughes commented 1 month ago

If the problem started after you activated Popup Marker, I guess the next thing to test is if it is solved when you deactivate it. Then, you would have a pretty good idea if that is truly the source of the problem.

Additionally, you could:

Again, that's only if you believe it is the source of the problem. I'm afraid I am unfamiliar with Popup Marker and do not have any recommendations for replacements.

Dani2449 commented 4 weeks ago

it's strange it still repeating it i tried to write to the developers and it moved me here can you assist me in seeing how i can see the error logs or the debugging?

Dani2449 commented 4 weeks ago

i activated by force all and waited few days Look how many errors it gives (I am using Astar theme) - this template https://websitedemos.net/sierra-industry-02/

image

barryhughes commented 4 weeks ago

If I'm reading correctly, these are not "errors", exactly ... it's just that the queue is not being processed as promptly as we'd like and expect.

it's strange it still repeating it i tried to write to the developers and it moved me here can you assist me in seeing how i can see the error logs or the debugging?

I don't really know anything about your local development environment—so it's a little hard to offer suggestions—and you may find it easiest to install a plugin that helps to surface error log messages (there are a few to pick from).

It may also be worth doing some basic troubleshooting. The screenshots suggest you are using WP Forms, and that plugin appears to use Action Scheduler. So, keep that active, and deactivate all other plugins (please also switch to a default theme, such as Twenty Twenty-Four). Does the problem clear up then? If so, it suggests a conflict of some kind.

i am for now using the Local to have the wrodpress on my computer first this is why i want to fix it.

I'm a little curious if the root of the problem is simply that you are running your site locally, without any sort of reliable system scheduler integration, and so lack the traffic required to process the queue (which would lead to you periodically seeing unprocessed actions).

Also, to be clear, when you reference 'Local' do you mean LocalWP (...if so, you may wish to search their docs to learn how to access the logs)?

Dani2449 commented 4 weeks ago

Hello barry

thank you you are very helpful.

yes, I am using LocalWP.

This is the plugin that I use image

before it looked like it didn't appear because I used it for another website and it looks okay.

I thought also maybe because I using it locally and this is why it happened.

I with try with a different theme and come back to you.

I added https://wordpress.org/plugins/error-log-monitor/ to check let see what it gives us

Dani2449 commented 4 weeks ago

I hope i configured it correctly i put it in the

image

and i put this code here image

Dani2449 commented 3 weeks ago

still look its there but i have the debugger i am putting it here maybe you can help me with it please. error.log

barryhughes commented 3 weeks ago

Many of the errors seem to relate to Elementor, or else Image Optimizer. It's not impossible they are surfacing when the queue is being processed, and causing difficulties there.

Regarding LocalWP, I don't use this myself but I understand you can register cronjobs in the container, and you could use these to trigger WP Cron with a rule looking something like this (just an example ... you would need to correct the path, etc):

* * * * * wp --path=/path/to/wordpress cron event run

That might get things running locally. Or, if you are not comfortable with that, you could perhaps install WP Crontrol. This could help you to understand if the problem is exclusive to Action Scheduler, or if WP Cron in general is having problems running in your local site (which is what I suspect).

barryhughes commented 1 week ago

Since this sounds like a problem with a particular local development setup, rather than a bug in the plugin itself, I'm going to go ahead and close.