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
627 stars 113 forks source link

PHP Fatal error: Uncaught Error: Unknown named parameter $uniqid #976

Closed kijamve closed 1 year ago

kijamve commented 1 year ago

This line: https://github.com/woocommerce/action-scheduler/blob/4eb2fa9737a53e4d284dafcf3e0bf428b5f941bc/classes/ActionScheduler_QueueRunner.php#L69C68-L69C68

Generate this error in some versions of PHP8:

PHP Fatal error:  Uncaught Error: Unknown named parameter $uniqid in /wp-includes/class-wp-hook.php:313
  Stack trace:
  #0 /wp-includes/class-wp-hook.php(337): WP_Hook->apply_filters('', Array)
  #1 /wp-includes/plugin.php(565): WP_Hook->do_action(Array)
  #2 /wp-cron.php(191): do_action_ref_array('action_schedule...', Array)
  #3 {main}
    thrown in /wp-includes/class-wp-hook.php on line 313`

I think of correct code is:

add_action( self::WP_CRON_HOOK, array( self::instance(), 'run' ), 10, 0 );
barryhughes commented 1 year ago

Thanks for reporting this, however I seem unable to replicate even when using PHP 8.2.

We're open to making the suggested change, but we'd like to understand the origin of the problem before doing so. Can you confirm you can replicate this problem when using only Action Scheduler, a default theme and no other plugins?

kijamve commented 1 year ago

I am using WooCommerce Subscription and I am following this guide: https://woocommerce.com/document/subscriptions/develop/complete-guide-to-scheduled-events-with-subscriptions/#section-5

In that guide you ask me to install https://wordpress.org/plugins/wp-crontrol/

Perhaps it is the combination of those 3 plugins that generates this problem?

barryhughes commented 1 year ago

OK ... I don't believe that is the cause—at least, I cannot replicate the problem myself with just those plugins, plus WooCommerce and Action Scheduler. I also don't see any references in those codebases that would explain it.

@fgilio I saw you gave a thumbs-up reaction to the initial post: are you also experiencing this (and are you also using the plugins noted by @kijamve)?

fgilio commented 1 year ago

Hi @barryhughes, I work with @kijamve. We'll make sure to provide any further details we find.

Do you have any specific recommendation on how to approach it?

barryhughes commented 1 year ago

Hmm. One idea is installing WP Crontrol. Then, visit Tools ▸ Cron Events and search for action_scheduler_run_queue. What do you see there for the argument list? Normally, I'd expect to see ["WP Cron"]. Is it different from that? If it is, can you try editing and resetting it to just ["WP Cron"]?

Otherwise, perhaps you could create a fresh WordPress installation running just Action Scheduler (and create a script to generate a few test actions). Can you replicate the problem? If not, try incrementally adding the same plugins and theme you have on your production site, until you can replicate the error ... this might help us identify the source of the conflict.

kijamve commented 1 year ago

image

`

WordPress Environment

WordPress address (URL): https:// Site address (URL): https:// WC Version: 8.0.2 REST API Version: ✔ 8.0.2 WC Blocks Version: ✔ 10.6.5 Action Scheduler Version: ✔ 3.6.1 Log Directory Writable: ✔ WP Version: 6.3 WP Multisite: – WP Memory Limit: 512 MB WP Debug Mode: ✔ WP Cron: ✔ Language: es_ES External object cache: –

Server Environment

Server Info: Apache PHP Version: 8.2.8 PHP Post Max Size: 100 MB PHP Time Limit: 3600 PHP Max Input Vars: 10000 cURL Version: 7.74.0 OpenSSL/1.1.1n

SUHOSIN Installed: – MySQL Version: 5.7.42-46-log Max Upload Size: 50 MB Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ✔ DOMDocument: ✔ GZip: ✔ Multibyte String: ✔ Remote Post: ✔ Remote Get: ✔

Database

WC Database Version: 8.0.2 WC Database Prefix: wp_ Tamaño total de la base de datos: 74.87MB Tamaño de los datos de la base de datos: 62.70MB Tamaño del índice de la base de datos: 12.17MB wp_woocommerce_sessions: Datos: 0.14MB + Índice: 0.02MB + Motor InnoDB wp_woocommerce_api_keys: Datos: 0.02MB + Índice: 0.03MB + Motor InnoDB wp_woocommerce_attribute_taxonomies: Datos: 0.02MB + Índice: 0.02MB + Motor InnoDB wp_woocommerce_downloadable_product_permissions: Datos: 0.02MB + Índice: 0.06MB + Motor InnoDB wp_woocommerce_order_items: Datos: 0.08MB + Índice: 0.02MB + Motor InnoDB wp_woocommerce_order_itemmeta: Datos: 0.33MB + Índice: 0.30MB + Motor InnoDB wp_woocommerce_tax_rates: Datos: 0.02MB + Índice: 0.06MB + Motor InnoDB wp_woocommerce_tax_rate_locations: Datos: 0.02MB + Índice: 0.03MB + Motor InnoDB wp_woocommerce_shipping_zones: Datos: 0.02MB + Índice: 0.00MB + Motor InnoDB wp_woocommerce_shipping_zone_locations: Datos: 0.02MB + Índice: 0.03MB + Motor InnoDB wp_woocommerce_shipping_zone_methods: Datos: 0.02MB + Índice: 0.00MB + Motor InnoDB wp_woocommerce_payment_tokens: Datos: 0.02MB + Índice: 0.02MB + Motor InnoDB wp_woocommerce_payment_tokenmeta: Datos: 0.05MB + Índice: 0.03MB + Motor InnoDB wp_woocommerce_log: Datos: 0.02MB + Índice: 0.02MB + Motor InnoDB wp_actionscheduler_actions: Datos: 3.02MB + Índice: 1.58MB + Motor InnoDB wp_actionscheduler_claims: Datos: 0.02MB + Índice: 0.02MB + Motor InnoDB wp_actionscheduler_groups: Datos: 0.02MB + Índice: 0.02MB + Motor InnoDB wp_actionscheduler_logs: Datos: 1.52MB + Índice: 1.80MB + Motor InnoDB wp_adfoin_integration: Datos: 0.02MB + Índice: 0.02MB + Motor InnoDB wp_adfoin_log: Datos: 0.02MB + Índice: 0.02MB + Motor InnoDB wp_commentmeta: Datos: 0.02MB + Índice: 0.03MB + Motor InnoDB wp_comments: Datos: 0.41MB + Índice: 0.42MB + Motor InnoDB wp_ee_products_sync_list: Datos: 0.02MB + Índice: 0.00MB + Motor InnoDB wp_ee_product_feed: Datos: 0.02MB + Índice: 0.00MB + Motor InnoDB wp_ee_product_sync_call: Datos: 0.02MB + Índice: 0.00MB + Motor InnoDB wp_ee_product_sync_data: Datos: 0.02MB + Índice: 0.00MB + Motor InnoDB wp_e_events: Datos: 0.02MB + Índice: 0.02MB + Motor InnoDB wp_links: Datos: 0.02MB + Índice: 0.02MB + Motor InnoDB wp_newsletter: Datos: 0.02MB + Índice: 0.03MB + Motor InnoDB wp_newsletter_emails: Datos: 0.02MB + Índice: 0.00MB + Motor InnoDB wp_newsletter_sent: Datos: 0.02MB + Índice: 0.03MB + Motor InnoDB wp_newsletter_stats: Datos: 0.02MB + Índice: 0.03MB + Motor InnoDB wp_newsletter_user_logs: Datos: 0.02MB + Índice: 0.00MB + Motor InnoDB wp_nextend2_image_storage: Datos: 0.02MB + Índice: 0.02MB + Motor InnoDB wp_nextend2_section_storage: Datos: 0.09MB + Índice: 0.06MB + Motor InnoDB wp_nextend2_smartslider3_generators: Datos: 0.02MB + Índice: 0.00MB + Motor InnoDB wp_nextend2_smartslider3_sliders: Datos: 0.06MB + Índice: 0.03MB + Motor InnoDB wp_nextend2_smartslider3_sliders_xref: Datos: 0.02MB + Índice: 0.02MB + Motor InnoDB wp_nextend2_smartslider3_slides: Datos: 0.09MB + Índice: 0.11MB + Motor InnoDB wp_options: Datos: 6.42MB + Índice: 0.14MB + Motor InnoDB wp_postmeta: Datos: 10.52MB + Índice: 3.64MB + Motor InnoDB wp_posts: Datos: 9.48MB + Índice: 0.25MB + Motor InnoDB wp_post_smtp_logmeta: Datos: 0.02MB + Índice: 0.00MB + Motor InnoDB wp_post_smtp_logs: Datos: 12.02MB + Índice: 0.00MB + Motor InnoDB wp_simple_history: Datos: 0.27MB + Índice: 0.16MB + Motor InnoDB wp_simple_history_contexts: Datos: 16.52MB + Índice: 1.89MB + Motor InnoDB wp_swpm_membership_meta_tbl: Datos: 0.02MB + Índice: 0.02MB + Motor InnoDB wp_swpm_membership_tbl: Datos: 0.02MB + Índice: 0.00MB + Motor InnoDB wp_swpm_members_tbl: Datos: 0.02MB + Índice: 0.00MB + Motor InnoDB wp_swpm_payments_tbl: Datos: 0.02MB + Índice: 0.00MB + Motor InnoDB wp_termmeta: Datos: 0.02MB + Índice: 0.03MB + Motor InnoDB wp_terms: Datos: 0.02MB + Índice: 0.03MB + Motor InnoDB wp_term_relationships: Datos: 0.02MB + Índice: 0.02MB + Motor InnoDB wp_term_taxonomy: Datos: 0.02MB + Índice: 0.03MB + Motor InnoDB wp_um_metadata: Datos: 0.02MB + Índice: 0.05MB + Motor InnoDB wp_usermeta: Datos: 0.23MB + Índice: 0.25MB + Motor InnoDB wp_users: Datos: 0.02MB + Índice: 0.05MB + Motor InnoDB wp_wcs_payment_retries: Datos: 0.09MB + Índice: 0.02MB + Motor InnoDB wp_wc_admin_notes: Datos: 0.08MB + Índice: 0.00MB + Motor InnoDB wp_wc_admin_note_actions: Datos: 0.06MB + Índice: 0.02MB + Motor InnoDB wp_wc_category_lookup: Datos: 0.02MB + Índice: 0.00MB + Motor InnoDB wp_wc_customer_lookup: Datos: 0.02MB + Índice: 0.03MB + Motor InnoDB wp_wc_download_log: Datos: 0.02MB + Índice: 0.03MB + Motor InnoDB wp_wc_orders: Datos: 0.02MB + Índice: 0.11MB + Motor InnoDB wp_wc_orders_meta: Datos: 0.02MB + Índice: 0.03MB + Motor InnoDB wp_wc_order_addresses: Datos: 0.02MB + Índice: 0.06MB + Motor InnoDB wp_wc_order_coupon_lookup: Datos: 0.02MB + Índice: 0.03MB + Motor InnoDB wp_wc_order_operational_data: Datos: 0.02MB + Índice: 0.03MB + Motor InnoDB wp_wc_order_product_lookup: Datos: 0.05MB + Índice: 0.06MB + Motor InnoDB wp_wc_order_stats: Datos: 0.05MB + Índice: 0.05MB + Motor InnoDB wp_wc_order_tax_lookup: Datos: 0.02MB + Índice: 0.03MB + Motor InnoDB wp_wc_product_attributes_lookup: Datos: 0.02MB + Índice: 0.02MB + Motor InnoDB wp_wc_product_download_directories: Datos: 0.02MB + Índice: 0.02MB + Motor InnoDB wp_wc_product_meta_lookup: Datos: 0.02MB + Índice: 0.09MB + Motor InnoDB wp_wc_rate_limits: Datos: 0.02MB + Índice: 0.02MB + Motor InnoDB wp_wc_reserved_stock: Datos: 0.02MB + Índice: 0.00MB + Motor InnoDB wp_wc_tax_rate_classes: Datos: 0.02MB + Índice: 0.02MB + Motor InnoDB wp_wc_webhooks: Datos: 0.02MB + Índice: 0.02MB + Motor InnoDB

Post Type Counts

accordions: 1 attachment: 61 bc_x1379_op_type: 1 custom_css: 2 custom-css-js: 2 customize_changeset: 164 elementor_library: 1 ep-synonym: 1 nav_menu_item: 7 page: 17 post: 5 postman_sent_mail: 232 product: 1 product_variation: 5 revision: 27 shop_coupon: 5 shop_order: 151 shop_order_refund: 2 shop_shipping_note: 96 shop_subscription: 85 swpm_payment_button: 2 swpm_transactions: 1 um_directory: 1 um_form: 3 wp_navigation: 1 wpcf7_contact_form: 1 xlwcty_thankyou: 1

Security

Secure connection (HTTPS): ✔ Hide errors from visitors: ✔

Active Plugins (4)

WooCommerce Stripe Gateway: por WooCommerce – 7.5.0 WooCommerce Subscriptions: por WooCommerce – 5.4.0 WooCommerce: por Automattic – 8.0.2 WP Crontrol: por John Blackbourn & crontributors – 1.15.3

Inactive Plugins (23)

Accordions Combo: por PickPlugins – 2.2.87 BC Woo Custom Thank You Pages: por WooCommerce & WordPress Tutorials – 1.4.3 CF7 Google Sheet Connector: por GSheetConnector – 5.0.4 Checkout Field Editor for WooCommerce: por ThemeHigh – 1.9.0 Contact Form 7: por Takayuki Miyoshi – 5.8 Departamentos y Ciudades de Colombia para Woocommerce: por Saul Morales Pacheco – 2.0.9 eCommerce Store Optimizer: por StudioPress Team – 0.6.2 Genesis Blocks Pro: por WP Engine – 3.0.0 Live Cart by WP Engine: por WP Engine – 1.0.1 Loco Translate: por Tim Whitlock – 2.6.4 Post SMTP: por Post SMTP – 2.5.9.3 Publica.la Customization: por Publica.la – 1.1.1 Publica.la Marketplace Integration: por Publica.la – 1.1.5 Publica.la Shipping Note: por Publica.la – 1.0.15 Publica.la WordPress Pack: por Publica.la – 1.0.1 PublishPress Capabilities: por PublishPress – 2.9.1 Regenerate Thumbnails: por Alex Mills (Viper007Bond) – 3.1.6 Simple Custom CSS and JS: por SilkyPress.com – 3.44 Simple History: por Pär Thernström – 4.5.0 Smart Image Resize for WooCommerce: por Nabil Lemsieh – 1.8.1 Smart Slider 3: por Nextend – 3.5.1.19 Woocommerce Add-to-Cart Custom Redirect: por ForwardFlip – 1.2.12 WP Revisions Control: por Erick Hitter – 1.4.3

Dropin Plugins (1)

advanced-cache.php: advanced-cache.php

Must Use Plugins (5)

Force Strong Passwords - WPE Edition: por Jason Cosper – 1.8.0 WP Engine Cache Plugin: por WP Engine – 1.1.4 WP Engine Seamless Login Plugin: por WP Engine – 1.6.1 WP Engine Security Auditor: por wpengine – 1.0.11 WP Engine System: por WP Engine – 5.0.1

Settings

API Enabled: – Force SSL: – Currency: COP ($) Currency Position: left Thousand Separator: , Decimal Separator: . Number of Decimals: 2 Taxonomies: Product Types: external (external) grouped (grouped) simple (simple) subscription (subscription) variable (variable) variable subscription (variable-subscription)

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: ✔ HPOS feature screen enabled: – HPOS feature enabled: – Order datastore: WC_Order_Data_Store_CPT HPOS data sync enabled: –

WC Pages

Base de la tienda: #5 - /tienda/ Carrito: #6 - /cart/ Finalizar compra: #7 - /checkout/ Mi cuenta: #8 - /my-account/ Términos y condiciones: #729 - /terminos-y-condiciones/

Theme

Name: Storefront Child Version: 4.2.0.1689090357 Author URL: https://woocommerce.com/ Child Theme: ✔ Parent Theme Name: Storefront Parent Theme Version: 4.3.0 – 4.5.2 está disponible Parent Theme Author URL: https://woocommerce.com/ WooCommerce Support: ✔

Templates

Overrides: –

Suscripciones

WCS_DEBUG: ✔ No Subscriptions Mode: ✔ Activo Subscriptions Live URL: https://*** Subscriptions-core Library Version: 6.2.0 Subscription Statuses: wc-active: 30 wc-expired: 7 wc-pending-cancel: 1 wc-pending: 11 wc-on-hold: 36

WooCommerce Account Connected: ❌ No Custom Retry Rules: ✔ No Custom Retry Rule Class: ✔ No Custom Raw Retry Rule: ✔ No Custom Retry Rule: ✔ No Retries Migration Status: ✔ Completed Report Cache Enabled: ✔ Si Cache Update Failures: ✔ 0 fallo

Configuración de la tienda

Country / State: Colombia — Distrito Capital

Suscripciones por pasarela de pago

Stripe: wc-active: 30 wc-expired: 7 wc-on-hold: 36 wc-pending: 11 wc-pending-cancel: 1

Compatibilidad de pasarelas de pago

Stripe: products refunds tokenization add_payment_method subscriptions subscription_cancellation subscription_suspension subscription_reactivation subscription_amount_changes subscription_date_changes subscription_payment_method_change subscription_payment_method_change_customer subscription_payment_method_change_admin multiple_subscriptions

Admin

Enabled Features: activity-panels analytics product-block-editor coupons core-profiler customer-effort-score-tracks import-products-task experimental-fashion-sample-products 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 woo-mobile-welcome wc-pay-promotion wc-pay-welcome-page

Disabled Features: minified-js new-product-management-experience product-variation-management settings async-product-editor-category-field

Daily Cron: ✔ Next scheduled: 2023-08-29 16:14:28 +00:00 Options: ✔ Notes: 105 Onboarding: completed

Action Scheduler

Completo: 4.303 Oldest: 2023-07-30 00:00:20 +0000 Newest: 2023-08-29 15:41:46 +0000

Fallida: 1.217 Oldest: 2023-07-30 04:07:22 +0000 Newest: 2023-08-29 15:33:54 +0000

Pendiente: 47 Oldest: 2023-08-29 15:43:02 +0000 Newest: 2024-08-25 14:27:08 +0000

Status report information

Generated at: 2023-08-29 15:42:17 +00:00 `

kijamve commented 1 year ago

We have eliminated the event that had the uniqid argument and it has not happened again, we do not know how that got there, maybe some plugin that was previously active did it, we will be attentive if it happens again and we will give you more information. Thank you very much for your help @barryhughes

barryhughes commented 1 year ago

No problem, glad it's resolved :+1: