• Resolved omahoung

    (@omahoung)


    Hello,

    I have a problem with the cron job “woocommerce_cancel_unpaid_orders”. This cron job sometimes disappear and the orders stay at the “Pending Payment” status instead of being canceled (I have set “Hold stock” value to 60 minutes). When I go to the Woocommerce settings > inventory and save again the settings, “woocommerce_cancel_unpaid_orders” is re-created and all is working fine. The problem is that after sometime this cron job will not be automatically re-created and the orders will stay at “Pending”.

    The first time this happened was 2 months ago after all plugins update, the cron job disappeared. 1 month ago it happened again, also after plugins update. Few days ago the cron job disappeared for unknown reason as there was no update at all.

    In the Woocommerce logs I have this issue:

    2022-09-14T09:12:42+00:00 ERROR Spec is invalid because a rule is invalid in feed
    2022-09-14T09:12:42+00:00 ERROR stdClass Object
    (
        [type] => wcadmin_active_for
        [operation] => >
        [months] => 11
    )
    
    2022-09-14T09:12:42+00:00 ERROR stdClass Object
    (
        [slug] => googlelistings_signals2022_hasGLA
        [type] => marketing
        [status] => unactioned
        [is_snoozable] => 0
        [source] => woocommerce.com
        [locales] => Array
            (
                [0] => stdClass Object
                    (
                        [locale] => en_US
                        [title] => Show off your products with Ads on Google
                        [content] => You’re ready to grow with ads. Google optimizes for performance across your products; you only pay for results. If you’re new to Google, you can earn up to $500 in ad credits (T&Cs apply). <a href="https://woocommerce.com/my-account/create-a-ticket/">Contact support</a> if you need guidance with Google Listings & Ads.
                    )
    
            )
    
        [actions] => Array
            (
                [0] => stdClass Object
                    (
                        [name] => googlelistings_signals2022_hasGLA_click
                        [locales] => Array
                            (
                                [0] => stdClass Object
                                    (
                                        [locale] => en_US
                                        [label] => Connect Google Listings & Ads
                                    )
    
                            )
    
                        [url] => admin.php?page=wc-admin&path=marketing
                        [url_is_admin_query] => 1
                        [is_primary] => 1
                        [status] => unactioned
                    )
    
            )
    
        [rules] => Array
            (
                [0] => stdClass Object
                    (
                        [type] => publish_after_time
                        [publish_after] => 2022-09-12 07:23:39
                    )
    
                [1] => stdClass Object
                    (
                        [type] => publish_before_time
                        [publish_before] => 2022-10-12 23:59:00
                    )
    
                [2] => stdClass Object
                    (
                        [type] => plugins_activated
                        [plugins] => Array
                            (
                                [0] => google-listings-and-ads
                            )
    
                    )
    
                [3] => stdClass Object
                    (
                        [type] => wcadmin_active_for
                        [operation] => >
                        [months] => 11
                    )
    
                [4] => stdClass Object
                    (
                        [type] => product_count
                        [operation] => >
                        [value] => 76
                    )
    
                [5] => stdClass Object
                    (
                        [type] => order_count
                        [operation] => >
                        [value] => 38
                    )
    
                [6] => stdClass Object
                    (
                        [type] => total_payments_value
                        [days] => last_year
                        [value] => 3700
                        [operation] => >
                    )
    
            )
    
    )

    Do you have any idea of what could cause this cron job to not be automatically re-created?

    Thanks.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi @omahoung

    Thanks for reaching out!

    WooCommercce uses the WP Cron system that’s part of WordPress to handle automated tasks like canceling unpaid orders. If that’s not happening it could indicate there is an issue with the operation of WP Cron.

    Can you please try to install the WP Crontrol plugin? This will add a new menu under the Tools section of the site to show cron tasks. This will also show any errors that it detects.

    Once you’ve installed the plugin, please check to see if there are any problems with WP Cron on the site. Let us know what you find out.

    Thread Starter omahoung

    (@omahoung)

    Hi,
    WP Crontrol is the plugin I used to check the cron jobs. The point is that “woocommerce_cancel_unpaid_orders” is not in the list. It will appear again after I save the Woocommerce > inventory settings, and it will work. After saving these settings, I see the cron job in the list with the correct “next run” time (1 hour on the website), then after 1 hour the orders are canceled, the cron job is re-created, and so on… all works fine.
    The cron job disappeared from the list 2 times after plugin update (I am not 100% sure update is the cause of the problem, I just guess), and 1 time without any previous special action that I could see.
    Just “woocommerce_cancel_unpaid_orders” has a problem. All the other recurrent cron jobs work normally.

    Saif

    (@babylon1999)

    Hello @omahoung,

    I found this comment in a GH thread that seems to have fixed the problem.

    Can you please try the solution and let us know how it goes?

    Thread Starter omahoung

    (@omahoung)

    Hello,
    Like written in my previous messages, the way explained in this thread (save again the settings) is exactly what I did to solve the problem. It works. But the problem is that after some time, the cron job disappears again.

    Mirko P.

    (@rainfallnixfig)

    Hi @omahoung,

    Do you have any active caching plugins on your site or does your host offer caching facilities? If so, can you make sure all cache is purged and disabled? I’ve seen reports of WP-Cron issues with Redis Object Cache and other caching systems.

    Could you please share a copy of your site’s System Status? You can find it via WooCommerce > Status. Select “Get system report” and then “Copy for support”. Once you’ve done that, paste it here in your response.

    Thanks!

    Thread Starter omahoung

    (@omahoung)

    Hello,

    I had to save again the Woocommerce inventory settings, so the missing cron job was re-created and it is working without issue for now. There is a cache plugin (SG optimizer), I will try to purge and deactivate next time the problem happens.

    Here is the Woocommerce status report:

    
    ### WordPress Environment ###
    
    WordPress address (URL): https://www.armaspeed.com
    Site address (URL): https://www.armaspeed.com
    WC Version: 6.8.2
    REST API Version: ? 6.8.2
    WC Blocks Version: ? 8.0.0
    Action Scheduler Version: ? 3.4.0
    Log Directory Writable: ?
    WP Version: 6.0.2
    WP Multisite: –
    WP Memory Limit: 768 MB
    WP Debug Mode: –
    WP Cron: ?
    Language: en_US
    External object cache: ?
    
    ### Server Environment ###
    
    Server Info: Apache
    PHP Version: 7.4.30
    PHP Post Max Size: 256 MB
    PHP Time Limit: 120
    PHP Max Input Vars: 3000
    cURL Version: 7.66.0
    OpenSSL/1.1.1q-fips
    
    SUHOSIN Installed: –
    MySQL Version: 5.7.39-42-log
    Max Upload Size: 256 MB
    Default Timezone is UTC: ?
    fsockopen/cURL: ?
    SoapClient: ?
    DOMDocument: ?
    GZip: ?
    Multibyte String: ?
    Remote Post: ?
    Remote Get: ?
    
    ### Database ###
    
    WC Database Version: 6.8.2
    WC Database Prefix: arma_
    Total Database Size: 90.30MB
    Database Data Size: 62.50MB
    Database Index Size: 27.80MB
    arma_woocommerce_sessions: Data: 0.17MB + Index: 0.01MB + Engine MyISAM
    arma_woocommerce_api_keys: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    arma_woocommerce_attribute_taxonomies: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    arma_woocommerce_downloadable_product_permissions: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    arma_woocommerce_order_items: Data: 0.20MB + Index: 0.08MB + Engine MyISAM
    arma_woocommerce_order_itemmeta: Data: 1.22MB + Index: 0.73MB + Engine MyISAM
    arma_woocommerce_tax_rates: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    arma_woocommerce_tax_rate_locations: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    arma_woocommerce_shipping_zones: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    arma_woocommerce_shipping_zone_locations: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    arma_woocommerce_shipping_zone_methods: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    arma_woocommerce_payment_tokens: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    arma_woocommerce_payment_tokenmeta: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    arma_woocommerce_log: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    arma_actionscheduler_actions: Data: 0.40MB + Index: 0.20MB + Engine MyISAM
    arma_actionscheduler_claims: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    arma_actionscheduler_groups: Data: 0.00MB + Index: 0.01MB + Engine MyISAM
    arma_actionscheduler_logs: Data: 0.30MB + Index: 0.21MB + Engine MyISAM
    arma_aiowps_debug_log: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    arma_aiowps_events: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    arma_aiowps_failed_logins: Data: 0.01MB + Index: 0.01MB + Engine MyISAM
    arma_aiowps_global_meta: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    arma_aiowps_login_activity: Data: 0.08MB + Index: 0.02MB + Engine MyISAM
    arma_aiowps_login_lockdown: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    arma_aiowps_permanent_block: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    arma_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    arma_comments: Data: 1.52MB + Index: 0.59MB + Engine InnoDB
    arma_duplicator_packages: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    arma_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    arma_nf3_actions: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    arma_nf3_action_meta: Data: 0.03MB + Index: 0.01MB + Engine MyISAM
    arma_nf3_chunks: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    arma_nf3_fields: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    arma_nf3_field_meta: Data: 0.11MB + Index: 0.01MB + Engine MyISAM
    arma_nf3_forms: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    arma_nf3_form_meta: Data: 0.02MB + Index: 0.00MB + Engine MyISAM
    arma_nf3_objects: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    arma_nf3_object_meta: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    arma_nf3_relationships: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    arma_nf3_upgrades: Data: 0.08MB + Index: 0.00MB + Engine MyISAM
    arma_options: Data: 3.52MB + Index: 1.81MB + Engine InnoDB
    arma_postmeta: Data: 27.55MB + Index: 9.03MB + Engine InnoDB
    arma_posts: Data: 4.52MB + Index: 0.95MB + Engine InnoDB
    arma_pum_subscribers: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    arma_termmeta: Data: 0.11MB + Index: 0.11MB + Engine InnoDB
    arma_terms: Data: 0.06MB + Index: 0.03MB + Engine InnoDB
    arma_term_relationships: Data: 0.13MB + Index: 0.08MB + Engine InnoDB
    arma_term_taxonomy: Data: 0.06MB + Index: 0.06MB + Engine InnoDB
    arma_tm_taskmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    arma_tm_tasks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    arma_usermeta: Data: 13.52MB + Index: 10.03MB + Engine InnoDB
    arma_users: Data: 1.52MB + Index: 0.80MB + Engine InnoDB
    arma_wc_admin_notes: Data: 0.04MB + Index: 0.00MB + Engine MyISAM
    arma_wc_admin_note_actions: Data: 0.02MB + Index: 0.01MB + Engine MyISAM
    arma_wc_category_lookup: Data: 0.01MB + Index: 0.02MB + Engine MyISAM
    arma_wc_customer_lookup: Data: 0.48MB + Index: 0.39MB + Engine MyISAM
    arma_wc_cvo_cache: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    arma_wc_download_log: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    arma_wc_order_coupon_lookup: Data: 0.00MB + Index: 0.01MB + Engine MyISAM
    arma_wc_order_product_lookup: Data: 0.14MB + Index: 0.12MB + Engine MyISAM
    arma_wc_order_stats: Data: 0.10MB + Index: 0.07MB + Engine MyISAM
    arma_wc_order_tax_lookup: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    arma_wc_product_attributes_lookup: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    arma_wc_product_download_directories: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    arma_wc_product_meta_lookup: Data: 0.04MB + Index: 0.05MB + Engine MyISAM
    arma_wc_rate_limits: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    arma_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    arma_wc_tax_rate_classes: Data: 0.00MB + Index: 0.01MB + Engine MyISAM
    arma_wc_webhooks: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    arma_wpmailsmtp_debug_events: Data: 0.05MB + Index: 0.00MB + Engine InnoDB
    arma_wpmailsmtp_tasks_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    arma_yith_wcwl: Data: 0.01MB + Index: 0.01MB + Engine MyISAM
    arma_yith_wcwl_lists: Data: 0.01MB + Index: 0.03MB + Engine MyISAM
    arma_yoast_indexable: Data: 5.52MB + Index: 1.70MB + Engine InnoDB
    arma_yoast_indexable_hierarchy: Data: 0.23MB + Index: 0.30MB + Engine InnoDB
    arma_yoast_migrations: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    arma_yoast_primary_term: Data: 0.05MB + Index: 0.03MB + Engine InnoDB
    arma_yoast_seo_links: Data: 0.14MB + Index: 0.09MB + Engine InnoDB
    arma_yoast_seo_meta: Data: 0.31MB + Index: 0.00MB + Engine InnoDB
    
    ### Post Type Counts ###
    
    attachment: 2784
    blocks: 2
    bwg_gallery: 1
    bwg_share: 1
    custom_css: 1
    et_pb_layout: 94
    nav_menu_item: 196
    nf_sub: 2902
    oembed_cache: 76
    page: 18
    popup: 4
    popup_theme: 9
    post: 2
    product: 292
    product_variation: 188
    project: 11
    revision: 45
    search-filter-widget: 1
    shop_coupon: 78
    shop_order: 1357
    shop_order_refund: 31
    wp_global_styles: 1
    
    ### Security ###
    
    Secure connection (HTTPS): ?
    Hide errors from visitors: ?
    
    ### Active Plugins (19) ###
    
    All In One WP Security: by All In One WP Security & Firewall Team – 4.4.12
    amr shortcode any widget: by anmari – 4.0
    Facebook for WooCommerce: by Facebook – 2.6.21
    Loco Translate: by Tim Whitlock – 2.6.2
    Ninja Forms: by Saturday Drive – 3.6.13
    Facebook for WordPress: by Facebook – 3.0.7
    Popup Maker: by Popup Maker – 1.16.7
    SiteGround Optimizer: by SiteGround – 7.2.1
    WPC Frequently Bought Together for WooCommerce (Premium): by WPClever – 4.4.2
    Checkout Field Editor for WooCommerce: by ThemeHigh – 1.7.1
    Advanced Order Export For WooCommerce: by AlgolPlus – 3.3.2
    WooCommerce PayPal Checkout Gateway: by WooCommerce – 2.1.3
    WooCommerce Price Based on Country (Basic): by Oscar Gare – 2.2.4
    WooCommerce: by Automattic – 6.8.2 (update to version 6.9.3 is available)
    Yoast SEO: by Team Yoast – 19.6
    WP Crontrol: by John Blackbourn & crontributors – 1.14.0
    WP Mail SMTP: by WPForms – 3.5.2
    WPC Variations Radio Buttons for WooCommerce: by WPClever – 3.1.7
    YITH WooCommerce Wishlist: by YITH – 3.12.0
    
    ### Inactive Plugins (3) ###
    
    Duplicator: by Snap Creek – 1.5.0
    Flexible Shipping: by Octolize – 4.14.0
    WP-Optimize - Clean, Compress, Cache: by David Anderson
    Ruhani Rabin
    Team Updraft – 3.2.7
    
    ### Dropin Plugins (1) ###
    
    object-cache.php: Memcached
    
    ### Settings ###
    
    API Enabled: –
    Force SSL: –
    Currency: USD ($)
    Currency Position: left
    Thousand Separator: ,
    Decimal Separator: .
    Number of Decimals: 2
    Taxonomies: Product Types: external (external)
    grouped (grouped)
    simple (simple)
    variable (variable)
    
    Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
    exclude-from-search (exclude-from-search)
    featured (featured)
    outofstock (outofstock)
    rated-1 (rated-1)
    rated-2 (rated-2)
    rated-3 (rated-3)
    rated-4 (rated-4)
    rated-5 (rated-5)
    
    Connected to WooCommerce.com: –
    Enforce Approved Product Download Directories: –
    
    ### WC Pages ###
    
    Shop base: #7771 - /shop/
    Cart: #7772 - /cart/
    Checkout: #7773 - /checkout/
    My account: #7774 - /my-account/
    Terms and conditions: ? Page not set
    
    ### Theme ###
    
    Name: Armaspeed
    Version: 3.0
    Author URL: 
    Child Theme: ?
    Parent Theme Name: Flatsome
    Parent Theme Version: 3.15.7
    Parent Theme Author URL: https://www.uxthemes.com/
    WooCommerce Support: ?
    
    ### Templates ###
    
    Overrides: flatsome/woocommerce/archive-product.php
    flatsome/woocommerce/cart/cart-empty.php
    flatsome/woocommerce/cart/cart-shipping.php
    flatsome/woocommerce/cart/cart.php
    flatsome/woocommerce/checkout/form-checkout.php
    flatsome/woocommerce/checkout/form-coupon.php
    flatsome/woocommerce/checkout/terms.php
    flatsome/woocommerce/checkout/thankyou.php
    flatsome/woocommerce/content-product-cat.php
    flatsome/woocommerce/content-product.php
    flatsome/woocommerce/content-single-product.php
    flatsome/woocommerce/content-widget-product.php
    armaspeed/woocommerce/emails/customer-processing-order.php
    flatsome/woocommerce/global/breadcrumb.php
    flatsome/woocommerce/global/quantity-input.php
    flatsome/woocommerce/global/wrapper-end.php
    flatsome/woocommerce/global/wrapper-start.php
    flatsome/woocommerce/loop/loop-end.php
    flatsome/woocommerce/loop/loop-start.php
    flatsome/woocommerce/loop/pagination.php
    flatsome/woocommerce/loop/result-count.php
    flatsome/woocommerce/loop/sale-flash.php
    armaspeed/woocommerce/myaccount/form-edit-address.php
    flatsome/woocommerce/myaccount/form-login.php
    flatsome/woocommerce/myaccount/navigation.php
    flatsome/woocommerce/notices/error.php
    flatsome/woocommerce/notices/notice.php
    flatsome/woocommerce/notices/success.php
    flatsome/woocommerce/product-searchform.php
    flatsome/woocommerce/single-product/photoswipe.php
    flatsome/woocommerce/single-product/price.php
    flatsome/woocommerce/single-product/product-image.php
    flatsome/woocommerce/single-product/product-thumbnails.php
    flatsome/woocommerce/single-product/rating.php
    flatsome/woocommerce/single-product/related.php
    flatsome/woocommerce/single-product/review.php
    flatsome/woocommerce/single-product/sale-flash.php
    flatsome/woocommerce/single-product/share.php
    flatsome/woocommerce/single-product/short-description.php
    flatsome/woocommerce/single-product/tabs/tabs.php
    flatsome/woocommerce/single-product/title.php
    flatsome/woocommerce/single-product/up-sells.php
    flatsome/woocommerce/single-product-reviews.php
    flatsome/woocommerce/single-product.php
    flatsome/woocommerce/content-product_cat.php
    
    ### Geolocation debug info ###
    
    Default customer location: geolocation
    MaxMind GeoIP database: ?
    MaxMind GeoIP license: ?
    MM_COUNTRY_CODE: ?
    GEOIP_COUNTRY_CODE: ?
    HTTP_CF_IPCOUNTRY: ?
    HTTP_X_COUNTRY_CODE: ?
    HTTP_X_REAL_IP: 101.9.179.134
    HTTP_X_FORWARDED_FOR: ?
    REMOTE_ADDR: 101.9.179.134
    Real external IP: 101.9.179.134
    WCPBC_USE_REMOTE_ADDR: –
    Geolocation Test: ?
    
    ### PBC Settings ###
    
    Version: 2.2.4
    Base location: TW
    Base currency: USD
    Price Based On: shipping
    Shipping: –
    Test mode: –
    Test country: –
    Load products price in background: ?
    Prices entered with tax: –
    Calculate tax based on: shipping
    Display prices in the shop: excl
    
    ### Zone Pricing Outside EU ###
    
    zone_id: hong-kong
    name: Outside EU
    countries: HK | MO | MY
    currency: USD
    exchange_rate: 999
    auto_exchange_rate: no
    disable_tax_adjustment: no
    
    ### Admin ###
    
    Enabled Features: activity-panels
    analytics
    coupons
    customer-effort-score-tracks
    experimental-products-task
    experimental-import-products-task
    experimental-fashion-sample-products
    experimental-product-tour
    shipping-smart-defaults
    shipping-setting-tour
    homescreen
    marketing
    mobile-app-banner
    navigation
    onboarding
    onboarding-tasks
    remote-inbox-notifications
    remote-free-extensions
    payment-gateway-suggestions
    shipping-label-banner
    subscriptions
    store-alerts
    transient-notices
    wc-pay-promotion
    wc-pay-welcome-page
    wc-pay-subscriptions-page
    
    Disabled Features: minified-js
    settings
    
    Daily Cron: ? Next scheduled: 2022-09-26 09:12:32 +08:00
    Options: ?
    Notes: 100
    Onboarding: completed
    
    ### Action Scheduler ###
    
    Complete: 1,486
    Oldest: 2022-09-19 08:29:11 +0800
    Newest: 2022-09-26 11:39:06 +0800
    
    Failed: 1
    Oldest: –
    Newest: –
    
    Pending: 2
    Oldest: 2022-09-26 12:50:12 +0800
    Newest: 2022-09-26 22:26:10 +0800
    
    ### Status report information ###
    
    Generated at: 2022-09-26 11:39:07 +08:00
    

    Thank you.

    Mirko P.

    (@rainfallnixfig)

    Hi @omahoung,

    Welcome back to the WooCommerce core forum.

    There is a cache plugin (SG optimizer), I will try to purge and deactivate next time the problem happens.

    Sounds good. I also see that you have other plugins for security, firewall, and caching so please check those too.

    All In One WP Security: by All In One WP Security & Firewall Team – 4.4.12
    object-cache.php: Memcached

    In the meantime, after saving a backup you can update theme and plugins. Make sure to run a database update for WooCommerce once you update to the latest core version.

    We’ll be here if you have any questions.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Cron job “woocommerce_cancel_unpaid_orders” problem’ is closed to new replies.