woocommerce / woocommerce

A customizable, open-source ecommerce platform built on WordPress. Build any commerce solution you can imagine.
https://woocommerce.com
9.42k stars 10.77k forks source link

CRITICAL Uncaught Error: Cannot use object of type WP_Error as array in class-wc-install.php:480 #19377

Closed danielbair closed 6 years ago

danielbair commented 6 years ago

Prerequisites

Steps to reproduce the issue

  1. It is random...
  2. Accessing any page on the website and sometimes get a blank page
  3. Reload the page and it is working again.

Expected/actual behavior

When I follow those steps, I see... Blank page In the error log: PHP Fatal Error... 2018-03-13T05:38:32+00:00 CRITICAL Uncaught Error: Cannot use object of type WP_Error as array in /nas/content/live/jesus4asia/wp-content/plugins/woocommerce/includes/class-wc-install.php:480 Stack trace:

0 /nas/content/live/jesus4asia/wp-content/plugins/woocommerce/includes/class-wc-install.php(189): WC_Install::create_terms()

1 /nas/content/live/jesus4asia/wp-content/plugins/woocommerce/includes/class-wc-install.php(145): WC_Install::install()

2 [internal function]: WC_Install::check_version('')

3 /nas/content/live/jesus4asia/wp-includes/class-wp-hook.php(286): call_user_func_array(Array, Array)

4 /nas/content/live/jesus4asia/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)

5 /nas/content/live/jesus4asia/wp-includes/plugin.php(453): WP_Hook->do_action(Array)

6 /nas/content/live/jesus4asia/wp-settings.php(450): do_action('init')

7 /nas/content/live/jesus4asia/wp-config.php(141): require_once('/nas/content/li...')

8 /nas/content/live/jesus4asia/wp-load.php(37): require_once('/nas/content/li...')

9 /nas/content/

I was expecting to see... My website

Isolating the problem

WordPress Environment

``` ` ### WordPress Environment ### Home URL: https://jesus4asia.org Site URL: https://jesus4asia.org WC Version: 3.3.3 Log Directory Writable: ✔ WP Version: 4.9.4 WP Multisite: – WP Memory Limit: 512 MB WP Debug Mode: – WP Cron: ✔ Language: en_US ### Server Environment ### Server Info: Apache PHP Version: 7.0.25-0ubuntu0.16.04.1 PHP Post Max Size: 100 MB PHP Time Limit: 0 PHP Max Input Vars: 4000 cURL Version: 7.47.0 OpenSSL/1.0.2g SUHOSIN Installed: – MySQL Version: 5.7.21 Max Upload Size: 50 MB Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ✔ DOMDocument: ✔ GZip: ✔ Multibyte String: ✔ Remote Post: ✔ Remote Get: ✔ ### Database ### WC Database Version: 3.3.3 WC Database Prefix: wp_xh6h65_ MaxMind GeoIP Database: ✔ Total Database Size: 45.13MB Database Data Size: 30.78MB Database Index Size: 14.35MB wp_xh6h65_woocommerce_sessions: Data: 1.02MB + Index: 0.02MB wp_xh6h65_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB wp_xh6h65_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB wp_xh6h65_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.05MB wp_xh6h65_woocommerce_order_items: Data: 0.11MB + Index: 0.06MB wp_xh6h65_woocommerce_order_itemmeta: Data: 1.52MB + Index: 0.73MB wp_xh6h65_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB wp_xh6h65_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.05MB wp_xh6h65_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB wp_xh6h65_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.05MB wp_xh6h65_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB wp_xh6h65_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB wp_xh6h65_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB wp_xh6h65_woocommerce_log: Data: 0.02MB + Index: 0.02MB wp_xh6h65_commentmeta: Data: 0.02MB + Index: 0.03MB wp_xh6h65_commentmeta_backup: Data: 0.02MB + Index: 0.03MB wp_xh6h65_comments: Data: 0.44MB + Index: 0.55MB wp_xh6h65_duplicator_packages: Data: 0.02MB + Index: 0.02MB wp_xh6h65_ecp_data: Data: 0.02MB + Index: 0.00MB wp_xh6h65_ecp_options: Data: 0.02MB + Index: 0.02MB wp_xh6h65_et_bloom_stats: Data: 0.17MB + Index: 0.00MB wp_xh6h65_ewwwio_images: Data: 0.02MB + Index: 0.03MB wp_xh6h65_iconic_woosocial_activity_log: Data: 0.02MB + Index: 0.00MB wp_xh6h65_itsec_lockouts: Data: 0.02MB + Index: 0.08MB wp_xh6h65_itsec_log: Data: 0.14MB + Index: 0.03MB wp_xh6h65_itsec_logs: Data: 2.02MB + Index: 0.09MB wp_xh6h65_itsec_temp: Data: 0.02MB + Index: 0.06MB wp_xh6h65_iwp_backup_status: Data: 0.02MB + Index: 0.00MB wp_xh6h65_layerslider: Data: 0.02MB + Index: 0.00MB wp_xh6h65_links: Data: 0.02MB + Index: 0.02MB wp_xh6h65_options: Data: 2.42MB + Index: 0.31MB wp_xh6h65_options_backup: Data: 6.52MB + Index: 0.38MB wp_xh6h65_phppc_functions: Data: 0.02MB + Index: 0.02MB wp_xh6h65_postmeta: Data: 5.52MB + Index: 7.03MB wp_xh6h65_postmeta_backup: Data: 2.52MB + Index: 3.03MB wp_xh6h65_posts: Data: 2.44MB + Index: 0.61MB wp_xh6h65_revslider_css: Data: 0.02MB + Index: 0.00MB wp_xh6h65_revslider_layer_animations: Data: 0.02MB + Index: 0.00MB wp_xh6h65_revslider_settings: Data: 0.02MB + Index: 0.00MB wp_xh6h65_revslider_sliders: Data: 0.02MB + Index: 0.00MB wp_xh6h65_revslider_slides: Data: 0.02MB + Index: 0.00MB wp_xh6h65_rm_log: Data: 4.52MB + Index: 0.00MB wp_xh6h65_say_what_strings: Data: 0.02MB + Index: 0.00MB wp_xh6h65_termmeta: Data: 0.02MB + Index: 0.03MB wp_xh6h65_terms: Data: 0.02MB + Index: 0.03MB wp_xh6h65_term_relationships: Data: 0.05MB + Index: 0.02MB wp_xh6h65_term_taxonomy: Data: 0.02MB + Index: 0.05MB wp_xh6h65_usermeta: Data: 0.39MB + Index: 0.42MB wp_xh6h65_usermeta_backup: Data: 0.13MB + Index: 0.13MB wp_xh6h65_users: Data: 0.05MB + Index: 0.05MB wp_xh6h65_wc_download_log: Data: 0.02MB + Index: 0.03MB wp_xh6h65_wc_webhooks: Data: 0.02MB + Index: 0.02MB wp_xh6h65_wdi_feeds: Data: 0.02MB + Index: 0.02MB wp_xh6h65_wdi_themes: Data: 0.02MB + Index: 0.02MB wp_xh6h65_wpdoctor_configuration: Data: 0.02MB + Index: 0.00MB wp_xh6h65_wsluserscontacts: Data: 0.02MB + Index: 0.02MB wp_xh6h65_wslusersprofiles: Data: 0.02MB + Index: 0.03MB ### Post Type Counts ### attachment: 396 customize_changeset: 2 custom_css: 3 et_pb_layout: 22 flamingo_contact: 212 flamingo_inbound: 56 nav_menu_item: 24 oembed_cache: 1 page: 72 payment_retry: 10 paypal_ipn: 288 post: 38 product: 58 project: 29 revision: 11 scheduled-action: 59 shop_order: 1151 shop_order_refund: 3 shop_subscription: 35 woo_product_tab: 1 wpcf7_contact_form: 3 wps-redirects: 29 ### Security ### Secure connection (HTTPS): ✔ Hide errors from visitors: ✔ ### Active Plugins (58) ### InfiniteWP - Client: by Revmakx – 1.7.1 Custom Bulk/Quick Edit: by Axelerant – 1.6.7 Admin Menu Editor: by Janis Elsts – 1.8.2 Advanced Dashboard for WooCommerce: by Piotr Pesta – 0.2.5 – Not tested with the active version of WooCommerce Akismet Anti-Spam: by Automattic – 4.0.3 iThemes Security: by iThemes – 6.9.2 Bloom: by Elegant Themes – 1.2.23 Child Theme Configurator: by Lilaea Media – 2.2.9 Contact Form 7: by Takayuki Miyoshi – 5.0.1 Custom Permalinks: by Sami Ahmed Siddiqui – 1.2.17 Custom Field Redirect: by Nathan Rice – 0.1 Dashicons + Custom Post Types: by Hal Gatewood – 1.0.2 Duplicate Page: by mndpsingh287 – 2.5 Easy Redirect Manager: by Premium WP Suite – 28.07-17 Easy Theme and Plugin Upgrades: by Chris Jean – 2.0.0 Enjoy Plugin for Instagram: by F. Prestipino F. Di Pane - Mediabeta Srl – 3.4.3 File Manager Advanced: by modalweb – 1.4.3 Flamingo: by Takayuki Miyoshi – 1.8 Jilt for WooCommerce: by Jilt – 1.4.0 Media Library Assistant: by David Lingren Fair Trade Judaica – 2.70 P3 (Plugin Performance Profiler): by GoDaddy.com – 1.5.3.9 PayPal for WooCommerce: by Angell EYE – 1.4.7.4 – Not tested with the active version of WooCommerce PayPal IPN for WordPress: by Angell EYE – 1.1.2 PHP Compatibility Checker: by WP Engine – 1.4.5 Product Tabs for WooCommerce: by Algoritmika Ltd – 1.1.1 – Not tested with the active version of WooCommerce Regenerate Thumbnails: by Alex Mills (Viper007Bond) – 3.0.2 Say What?: by Lee Willis – 1.9.1 Search & Replace: by Inpsyde GmbH – 3.1.2 SoundCloud Shortcode: by SoundCloud Inc. – 3.0.2 SSL Insecure Content Fixer: by WebAware – 2.5.0 Category Order and Taxonomy Terms Order: by Nsp-Code – 1.5.3.2 Toolbar Publish Button: by wpUXsolutions – 1.6 WC Speed Drain Repair: by WP Fix It – 1.2 – Not tested with the active version of WooCommerce WooCommerce Popup Mini Cart: by Daniel Bair – 1.0.1 – Not tested with the active version of WooCommerce Crowdfunding Extensions for WooCommerce Booster: by Daniel Bair – 1.0.1 – Not tested with the active version of WooCommerce Thermometer for WooCommerce Crowdfunding: by Daniel Bair – 1.0.1 – Not tested with the active version of WooCommerce Woocommerce Blocker Lite: by multidots – 1.6.3 – Not tested with the active version of WooCommerce Change Product Author for WooCommerce: by Ollie Murphy – 1.0.0 – Not tested with the active version of WooCommerce WooCommerce Order Cancel For Customers: by Techjewel – 1.0 – Not tested with the active version of WooCommerce WooCommerce Admin Bar Addition: by David Decker - DECKERWEB – 2.7.0 – Not tested with the active version of WooCommerce WooCommerce ACH Stripe Gateway: by FEST Agency – 1.2.7 – Not tested with the active version of WooCommerce WooCommerce Dwolla Gateway: by SkyVerge – 1.7.0 – Not tested with the active version of WooCommerce WooCommerce Stripe Gateway: by WooCommerce – 4.0.7 Booster for WooCommerce: by Algoritmika Ltd – 3.4.5 WooCommerce My Account Widget: by Bart Pluijms – 0.6.3 – Not tested with the active version of WooCommerce WooCommerce Name Your Price: by Kathy Darling – 2.7.1 WooCommerce Product Primary Category: by BeoCode.d.o.o. – 0.1.2 – Not tested with the active version of WooCommerce WooCommerce Social Media Share Buttons: by Toastie Studio – 1.3.0 – Not tested with the active version of WooCommerce WooCommerce Subscribe All the Things: by Prospress Inc. – 2.0.0-alpha – Not tested with the active version of WooCommerce WooCommerce Subscriptions: by Prospress Inc. – 2.2.18 WooCommerce: by Automattic – 3.3.3 WooSocial: by Iconic – 1.1.0 – Not tested with the active version of WooCommerce WordPress Social Login: by Miled – 2.3.3 WP Doctor: by BestiaWeb S.C.P. – 1.7 WP Facebook Pixel: by Night Shift Apps – 4.5 WP-Optimize: by David Anderson Ruhani Rabin Team Updraft – 2.2.2 WPSSO Social Sharing Buttons: by JS Morisset – 2.6.2 WPSSO Core [Main Plugin]: by JS Morisset – 3.55.2 ### Settings ### API Enabled: ✔ Force SSL: ✔ Currency: USD ($) Currency Position: left Thousand Separator: , Decimal Separator: . Number of Decimals: 2 Taxonomies: Product Types: simple (simple) variable (variable) grouped (grouped) external (external) subscription (subscription) variable subscription (variable-subscription) Taxonomies: Product Visibility: outofstock (outofstock) rated-5 (rated-5) featured (featured) exclude-from-search (exclude-from-search) exclude-from-catalog (exclude-from-catalog) rated-1 (rated-1) rated-2 (rated-2) rated-3 (rated-3) rated-4 (rated-4) ### WC Pages ### Shop base: #2753 - /invest/ Cart: #4708 - /cart/ Checkout: #496 - /checkout/ My account: #497 - /my-account/ Terms and conditions: ❌ Page not set ### Theme ### Name: Divi Child Theme Version: 1.2.3.6 Author URL: https://www.danielbair.com Child Theme: ✔ Parent Theme Name: Divi Parent Theme Version: 3.0.106 Parent Theme Author URL: http://www.elegantthemes.com WooCommerce Support: ✔ ### Templates ### Overrides: divichild/woocommerce/archive-product.php version 2.0.0 is out of date. The core version is 3.3.0 divichild/woocommerce/emails/admin-cancelled-order.php divichild/woocommerce/emails/admin-failed-order.php divichild/woocommerce/emails/admin-new-order.php divichild/woocommerce/emails/customer-completed-order.php divichild/woocommerce/emails/customer-invoice.php version 2.5.0 is out of date. The core version is 3.3.0 divichild/woocommerce/emails/customer-note.php divichild/woocommerce/emails/customer-on-hold-order.php divichild/woocommerce/emails/customer-processing-order.php divichild/woocommerce/emails/customer-refunded-order.php Outdated Templates: ❌Learn how to update ### subscriptions ### WCS_DEBUG: ✔ No Subscriptions Mode: ✔ Live Subscriptions Template Theme Overrides: divichild/woocommerce/emails/admin-new-renewal-order.php version 1.4 is out of date. The core version is 1.4.0divichild/woocommerce/emails/admin-new-switch-order.php version 1.5 is out of date. The core version is 1.5.0divichild/woocommerce/emails/cancelled-subscription.php version 2.1 is out of date. The core version is 2.1.0divichild/woocommerce/emails/customer-completed-renewal-order.php version 1.4 is out of date. The core version is 1.4.0divichild/woocommerce/emails/customer-completed-switch-order.php version 1.4 is out of date. The core version is 1.4.0divichild/woocommerce/emails/customer-processing-renewal-order.php version 1.4 is out of date. The core version is 1.4.0divichild/woocommerce/emails/customer-renewal-invoice.php version 1.4 is out of date. The core version is 1.4.0divichild/woocommerce/emails/expired-subscription.php version 2.1 is out of date. The core version is 2.1.0divichild/woocommerce/emails/on-hold-subscription.php version 2.1 is out of date. The core version is 2.1.0 ❌ Learn how to update Report Cache Enabled: ✔ Yes Cache Update Failures: ✔ 0 failure ### Jilt ### Plugin Version: 1.4.0 API Version: v2 API Authentication Method: OAuth API Connected: ✔ Linked to Jilt: ✔ Enabled: ✔ ` ```
rodrigoprimo commented 6 years ago

Thanks for your report, @danielbair. PR #19386 should fix the fatal error.

I'd be curious to know if there is already a default product category in your site or not. Could you please check? To do so, simply go to the Product categories admin page (https://jesus4asia.org/wp-admin/edit-tags.php?taxonomy=product_cat&post_type=product) and see if the first item on the list has a question mark icon instead of the regular checkbox. Usually, the name of the default product category is "Uncategorized".

danielbair commented 6 years ago

Yes, I did set a default product category in our WooCommerce. It is not the first item in the list, though. Here is our default category edit link... https://jesus4asia.org/wp-admin/term.php?taxonomy=product_cat&tag_ID=1131&post_type=product&wp_http_referer=%2Fwp-admin%2Fedit-tags.php%3Ftaxonomy%3Dproduct_cat%26post_type%3Dproduct

BTW, I am NOT able to add a new category named "Uncategorized" from the Product Categories admin area.