• Resolved Sunshyme

    (@sunshyme)


    The actionscheduler_logs table of my database is getting huge all the time. I cleared the table this afternoon and after a few hours there are already 5 million rows again and still counting…

    Most of the rows are the same three lines (translated from Dutch) below.

    The first
    An error occured while getting this action: Action [49] has an invalid scheme: (object) array(

    The second
    Action ignored via Async Request

    The third
    Action ignored via WP Cron

    I have no idea what action 49 is or how to stop this issue from happening. Maybe remove and install Woocommerce fresh? A complete new WordPress install and just migrate content (quite a lot)?

Viewing 11 replies - 1 through 11 (of 11 total)
  • Is the WooCommerce Admin active on the site?

    it can be disabled using this filter in WooCommerce core in a code snippet.
    add_filter( 'woocommerce_admin_disabled', '__return_true' );

    Did the historical data import?
    https://docs.woocommerce.com/document/woocommerce-analytics/#section-15

    Thread Starter Sunshyme

    (@sunshyme)

    WC Admin was not active but I have installed it now. Or should I de-activate it if that is what you meant?

    I just did the historical data import. As it means just 2 previous orders were done it was not a big deal so I am wondering what that import actually did/improve.

    I emptied the actionscheduler_logs table (already at 16 million rows now) so it starts fresh and I can see if it increases a lot again.

    Hi @sunshyme ,

    The WooCommerce Admin plugin was incorporated into WooCommerce Core, so you don’t need to have it installed, and sometimes if you’re running an outdated version it can cause extra logs.

    Hopefully this got resolved. If not, you can get more details of what’s running to cause those logs under WP Admin > WooCommerce > Status > Scheduled Actions. That may add some insight to what’s happening.

    Thread Starter Sunshyme

    (@sunshyme)

    Hi,

    In the scheduled actions section I see All (7516) | Complete (7515) | Pending (1)

    There are hundreds of facebook for woocommerce (each 15 minutes) completed. But I have no idea what the pending action is. Maybe that can be the troublemaker? Because the actionscheduler-logs is still getting huge. I have to truncate the table each week or my website will be incredibly big (120GB just that table) and slow.

    • This reply was modified 4 years, 3 months ago by Sunshyme.

    @sunshyme that could be the culprit, but every 15 minutes shouldn’t fill it that fast.

    If you click on the Pending tab, you can see what that action is. Having an action that’s pending isn’t in and of itself bad, but if that action keeps repeating, then it could be a problem.

    If you can share the details of the pending action, we might be able to help identify it. A screenshot of that page could even help.

    If the vast majority of the completed items are from Facebook for WooCommerce, you can try deactivating that for a little while to see if the rapid growth stops. If it does, you can open a ticket at WooCommerce.com > My Account > Tickets. You may need to create an account before you can access that page. Choose “Facebook for WooCommerce” from the list under “I need help with:” so it gets to the right team. Please include a link to this forum thread, so that they can keep track of what’s already been done.

    Until this is resolved, you can add this code snippet in your functions.php or using a plugin like Code Snippets:

    function adjust_action_scheduler_log_retention() {
    	return 7 * DAY_IN_SECONDS;
    }
    
    add_filter('action_scheduler_retention_period', 'adjust_action_scheduler_log_retention');

    This will shorten the automatic purge time for your Action Scheduler from 30 days to 7 days.

    Let us know what you find!

    Plugin Support Damianne P (a11n)

    (@drwpcom)

    Hi @sunshyme. We haven’t heard back from you in a while, so I’m going to mark this as resolved. Please start a new thread if you have further questions.

    Thread Starter Sunshyme

    (@sunshyme)

    Sorry for the delay. I just tried the code but get a fatal error on line 5.
    Maybe the suggested code is not correct?

    I think it is a good workaround for now to use such code so that the table is not getting too huge. Is it also possible to clear the table every day or every 3 days instead of 7?

    Thread Starter Sunshyme

    (@sunshyme)

    And I am not sure if it is related to each other, but I just installed Code Snippets. It showed a few examples in the overview of snippets/fragments. But now after just 10 minutes the number of examples is also increasing! I am not doing anything but with every refresh/revisit of the Code Snippet section I see more and more examples coming. Right now already 300+ so I will deactivate it.

    Hi @sunshyme ,

    That sounds very odd! It sounds like something either in a code snippet or another plugin is causing things to multiply.

    I wonder if there’s either some database corruption or some rogue code in your theme or a plugin causing this. Are you able to set up a staging site? If your host doesn’t offer that option, we recommend WP Staging for quickly spinning up a new test site.

    Try cloning your site to a staging site, then deactivate all plugins except WooCommerce and switch to a default theme like Twenty Twenty or Storefront, then use the site for a while and see if the Action Scheduler logs are still growing rapidly.

    If not, try deactivating one thing at a time until things start going wrong again, which should narrow down where the problem is.

    If it still grows like that, it may be a database corruption issue.

    As far as the code snippet, I tested it on my own site first and it worked without an error. Here’s how it looks in my test site:

    Action Scheduler retention snippet
    Link to image: https://d.pr/i/xGp5FM

    If it’s identical on your site, the error might clue us in, too. What was the error you saw?

    And finally, regarding the timing, the number 7 is the number of days to retain, you can set it to any number you like.

    It actually doesn’t run every 7 or 3 days. Instead whenever you access the dashboard it checks and deletes the logs older than the time period you set.

    Plugin Support Damianne P (a11n)

    (@drwpcom)

    Hi @sunshyme. Did you manage to resolve this issue using Mike’s suggestions? Note that we do resolve forum threads if we don’t get a response within 1 week.

    Thread Starter Sunshyme

    (@sunshyme)

    I am afraid it will be in some way a database corruption. So with that in mind, it might be the best solution to just ‘start over’. Fresh WP install, on a new database. And then try to export/import as much products, pages, posts et cetera as possible to minimize manual copy and paste.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Actionscheduler_logs is getting huge’ is closed to new replies.