woocommerce / woocommerce-ios

WooCommerce iOS app
https://www.woocommerce.com/mobile
GNU General Public License v2.0
262 stars 106 forks source link

Error loading dashboard (Swift.DecodingError) #6921

Open joashrajin opened 2 years ago

joashrajin commented 2 years ago

Describe the bug

Reported in #5229716-zen

Similar to https://github.com/woocommerce/woocommerce-ios/issues/5512

The issue is that Products are not loading in the app

image

Logs mention:

2022/05/20 09:16:36:537 ⛔️ Error loading dashboard: keyNotFound(CodingKeys(stringValue: "orders_count", intValue: nil), Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "data", intValue: nil), CodingKeys(stringValue: "totals", intValue: nil)], debugDescription: "No value associated with key CodingKeys(stringValue: \"orders_count\", intValue: nil) (\"orders_count\").", underlyingError: nil))

We recommended conflict testing, but the user said it did not help. It looks like the data may already be altered on a DB Level.

Mobile Environment Please include:

WordPress Environment

``` ### WordPress Environment ### WordPress address (URL): https://fussschaum.de/ Site address (URL): https://fussschaum.de/ WC Version: 6.5.1 REST API Version: ✔ 6.5.1 WC Blocks Version: ✔ 7.4.3 Action Scheduler Version: ✔ 3.4.0 Log Directory Writable: ✔ WP Version: 5.9.3 WP Multisite: – WP Memory Limit: 1 GB WP Debug Mode: – WP Cron: ✔ Language: de_DE External object cache: – ### Server Environment ### Server Info: Apache PHP Version: 8.0.19 PHP Post Max Size: 128 MB PHP Time Limit: 30 PHP Max Input Vars: 1000 cURL Version: 7.64.0 OpenSSL/1.1.1n SUHOSIN Installed: – MySQL Version: 10.5.15-MariaDB-1:10.5.15+maria~bullseye-log Max Upload Size: 128 MB Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ✔ DOMDocument: ✔ GZip: ✔ Multibyte String: ✔ Remote Post: ✔ Remote Get: ✔ ### Database ### WC Database Version: 6.5.1 WC Database Prefix: BTcctCTl Datenbank-Gesamtgröße: 36.19MB Datenbank-Datengröße: 33.00MB Datenbank-Indexgröße: 3.19MB BTcctCTlwoocommerce_sessions: Daten: 1.02MB + Index: 0.02MB + Engine InnoDB BTcctCTlwoocommerce_api_keys: Daten: 0.02MB + Index: 0.03MB + Engine InnoDB BTcctCTlwoocommerce_attribute_taxonomies: Daten: 0.02MB + Index: 0.02MB + Engine InnoDB BTcctCTlwoocommerce_downloadable_product_permissions: Daten: 0.02MB + Index: 0.06MB + Engine InnoDB BTcctCTlwoocommerce_order_items: Daten: 0.06MB + Index: 0.02MB + Engine InnoDB BTcctCTlwoocommerce_order_itemmeta: Daten: 0.28MB + Index: 0.30MB + Engine InnoDB BTcctCTlwoocommerce_tax_rates: Daten: 0.02MB + Index: 0.06MB + Engine InnoDB BTcctCTlwoocommerce_tax_rate_locations: Daten: 0.02MB + Index: 0.03MB + Engine InnoDB BTcctCTlwoocommerce_shipping_zones: Daten: 0.02MB + Index: 0.00MB + Engine InnoDB BTcctCTlwoocommerce_shipping_zone_locations: Daten: 0.02MB + Index: 0.03MB + Engine InnoDB BTcctCTlwoocommerce_shipping_zone_methods: Daten: 0.02MB + Index: 0.00MB + Engine InnoDB BTcctCTlwoocommerce_payment_tokens: Daten: 0.02MB + Index: 0.02MB + Engine InnoDB BTcctCTlwoocommerce_payment_tokenmeta: Daten: 0.02MB + Index: 0.03MB + Engine InnoDB BTcctCTlwoocommerce_log: Daten: 0.02MB + Index: 0.02MB + Engine InnoDB BTcctCTlactionscheduler_actions: Daten: 0.16MB + Index: 0.17MB + Engine InnoDB BTcctCTlactionscheduler_claims: Daten: 0.02MB + Index: 0.02MB + Engine InnoDB BTcctCTlactionscheduler_groups: Daten: 0.02MB + Index: 0.02MB + Engine InnoDB BTcctCTlactionscheduler_logs: Daten: 0.09MB + Index: 0.09MB + Engine InnoDB BTcctCTlcommentmeta: Daten: 0.02MB + Index: 0.03MB + Engine InnoDB BTcctCTlcomments: Daten: 0.09MB + Index: 0.09MB + Engine InnoDB BTcctCTlewwwio_images: Daten: 0.08MB + Index: 0.06MB + Engine InnoDB BTcctCTlewwwio_queue: Daten: 0.02MB + Index: 0.02MB + Engine InnoDB BTcctCTle_events: Daten: 0.02MB + Index: 0.02MB + Engine InnoDB BTcctCTllinks: Daten: 0.02MB + Index: 0.02MB + Engine InnoDB BTcctCTloptions: Daten: 6.22MB + Index: 0.23MB + Engine InnoDB BTcctCTlpostmeta: Daten: 7.23MB + Index: 0.48MB + Engine InnoDB BTcctCTlposts: Daten: 16.36MB + Index: 0.09MB + Engine InnoDB BTcctCTltermmeta: Daten: 0.02MB + Index: 0.03MB + Engine InnoDB BTcctCTlterms: Daten: 0.02MB + Index: 0.03MB + Engine InnoDB BTcctCTlterm_relationships: Daten: 0.02MB + Index: 0.02MB + Engine InnoDB BTcctCTlterm_taxonomy: Daten: 0.02MB + Index: 0.03MB + Engine InnoDB BTcctCTlusermeta: Daten: 0.06MB + Index: 0.03MB + Engine InnoDB BTcctCTlusers: Daten: 0.02MB + Index: 0.05MB + Engine InnoDB BTcctCTlwc_admin_notes: Daten: 0.05MB + Index: 0.00MB + Engine InnoDB BTcctCTlwc_admin_note_actions: Daten: 0.02MB + Index: 0.02MB + Engine InnoDB BTcctCTlwc_category_lookup: Daten: 0.02MB + Index: 0.00MB + Engine InnoDB BTcctCTlwc_customer_lookup: Daten: 0.02MB + Index: 0.03MB + Engine InnoDB BTcctCTlwc_download_log: Daten: 0.02MB + Index: 0.03MB + Engine InnoDB BTcctCTlwc_order_coupon_lookup: Daten: 0.02MB + Index: 0.03MB + Engine InnoDB BTcctCTlwc_order_product_lookup: Daten: 0.05MB + Index: 0.06MB + Engine InnoDB BTcctCTlwc_order_stats: Daten: 0.02MB + Index: 0.06MB + Engine InnoDB BTcctCTlwc_order_tax_lookup: Daten: 0.02MB + Index: 0.03MB + Engine InnoDB BTcctCTlwc_product_attributes_lookup: Daten: 0.02MB + Index: 0.02MB + Engine InnoDB BTcctCTlwc_product_download_directories: Daten: 0.02MB + Index: 0.02MB + Engine InnoDB BTcctCTlwc_product_meta_lookup: Daten: 0.02MB + Index: 0.09MB + Engine InnoDB BTcctCTlwc_rate_limits: Daten: 0.02MB + Index: 0.02MB + Engine InnoDB BTcctCTlwc_reserved_stock: Daten: 0.02MB + Index: 0.00MB + Engine InnoDB BTcctCTlwc_tax_rate_classes: Daten: 0.02MB + Index: 0.02MB + Engine InnoDB BTcctCTlwc_webhooks: Daten: 0.02MB + Index: 0.02MB + Engine InnoDB BTcctCTlwoocommerce_gzd_dhl_im_products: Daten: 0.02MB + Index: 0.03MB + Engine InnoDB BTcctCTlwoocommerce_gzd_dhl_im_product_services: Daten: 0.02MB + Index: 0.03MB + Engine InnoDB BTcctCTlwoocommerce_gzd_packaging: Daten: 0.02MB + Index: 0.00MB + Engine InnoDB BTcctCTlwoocommerce_gzd_packagingmeta: Daten: 0.02MB + Index: 0.03MB + Engine InnoDB BTcctCTlwoocommerce_gzd_shipmentmeta: Daten: 0.02MB + Index: 0.03MB + Engine InnoDB BTcctCTlwoocommerce_gzd_shipments: Daten: 0.02MB + Index: 0.05MB + Engine InnoDB BTcctCTlwoocommerce_gzd_shipment_itemmeta: Daten: 0.02MB + Index: 0.03MB + Engine InnoDB BTcctCTlwoocommerce_gzd_shipment_items: Daten: 0.02MB + Index: 0.06MB + Engine InnoDB BTcctCTlwoocommerce_gzd_shipment_labelmeta: Daten: 0.02MB + Index: 0.03MB + Engine InnoDB BTcctCTlwoocommerce_gzd_shipment_labels: Daten: 0.02MB + Index: 0.03MB + Engine InnoDB BTcctCTlwoocommerce_gzd_shipping_provider: Daten: 0.02MB + Index: 0.00MB + Engine InnoDB BTcctCTlwoocommerce_gzd_shipping_providermeta: Daten: 0.02MB + Index: 0.03MB + Engine InnoDB BTcctCTlwoo_shippment_provider: Daten: 0.09MB + Index: 0.00MB + Engine InnoDB BTcctCTlwt_iew_action_history: Daten: 0.02MB + Index: 0.00MB + Engine InnoDB BTcctCTlwt_iew_mapping_template: Daten: 0.02MB + Index: 0.00MB + Engine InnoDB BTcctCTlyoast_indexable: Daten: 0.08MB + Index: 0.09MB + Engine InnoDB BTcctCTlyoast_indexable_hierarchy: Daten: 0.02MB + Index: 0.05MB + Engine InnoDB BTcctCTlyoast_migrations: Daten: 0.02MB + Index: 0.02MB + Engine InnoDB BTcctCTlyoast_primary_term: Daten: 0.02MB + Index: 0.03MB + Engine InnoDB BTcctCTlyoast_seo_links: Daten: 0.02MB + Index: 0.03MB + Engine InnoDB ### Post Type Counts ### attachment: 30 custom_css: 3 customize_changeset: 41 elementor_library: 2 nav_menu_item: 10 page: 25 post: 8 product: 8 revision: 243 shop_order: 78 shop_order_refund: 3 wp_block: 4 wp_global_styles: 1 wpcf7_contact_form: 2 yaymail_template: 11 ### Security ### Secure connection (HTTPS): ✔ Hide errors from visitors: ✔ ### Active Plugins (18) ### Blocksy Companion: von CreativeThemes – 1.8.32 Contact Form 7: von Takayuki Miyoshi – 5.5.6.1 Droit Elementor Addons: von DroitThemes – 3.0.9 Elementor: von Elementor.com – 3.6.5 EWWW Image Optimizer: von Exactly WWW – 6.5.2 Head, Footer and Post Injections: von Stefano Lissa – 3.2.3 Jetpack: von Automattic – 10.9.1 All-in-One-Marketing von HubSpot – Formulare, Popups, Live-Chat: von HubSpot – 8.11.161 Seitlicher WooCommerce-Warenkorb: von XootiX – 2.1 Smart PayPal Checkout For WooCommerce: von mbjtech – 3.0.3 Erweiterte Sendungsverfolgung für WooCommerce: von zorem – 3.3.2 WPC Product Bundles for WooCommerce: von WPClever – 6.2.1 WooCommerce Stripe-Gateway: von WooCommerce – 6.4.0 Germanized für WooCommerce: von vendidero – 3.9.2 WooCommerce PayPal Payments: von WooCommerce – 1.8.0 WooCommerce: von Automattic – 6.5.1 Yoast SEO: von Team Yoast – 18.9 YayMail - WooCommerce Email Customizer: von YayCommerce – 2.9.3 ### Inactive Plugins (0) ### ### Must Use Plugins (1) ### 1&1 Product Subdomain: von 1&1 – 1.1.0 ### Settings ### API Enabled: – Force SSL: – Currency: EUR (€) Currency Position: right_space Thousand Separator: . Decimal Separator: , Number of Decimals: 2 Taxonomies: Product Types: external (external) grouped (grouped) simple (simple) variable (variable) woosb (woosb) 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-Basis: [#22](22-zd-woothemes) - /shop/ Warenkorb: [#23](23-zd-woothemes) - /cart-2/ Kasse: [#24](24-zd-woothemes) - /checkout-2/ Mein Konto: [#25](25-zd-woothemes) - /my-account-2/ Allgemeine Geschäftsbedingungen: [#1602](1602-zd-woothemes) - /agb/ ### Theme ### Name: Blocksy Child Version: (Update auf Version 0 ist verfügbar) Author URL: Child Theme: ✔ Parent Theme Name: Blocksy Parent Theme Version: 1.8.34 Parent Theme Author URL: https://creativethemes.com/ WooCommerce Support: ✔ ### Templates ### Overrides: blocksy/woocommerce/cart/cart.php blocksy/woocommerce/cart/mini-cart.php blocksy/woocommerce/content-widget-product.php blocksy/woocommerce/content-widget-reviews.php blocksy/woocommerce/myaccount/my-account.php blocksy/woocommerce/product-searchform.php blocksy/woocommerce/single-product/tabs/tabs.php ### WooCommerce PayPal Payments ### Onboarded: ✔ Shop country code: DE WooCommerce currency supported: ✔ PayPal card processing available in country: ✔ Pay Later messaging available in country: ✔ Webhook status: ✔ Vault enabled: ✔ Logging enabled: ✔ Reference Transactions: – Used PayPal Checkout plugin: – ### Action Scheduler ### Abgebrochen: 1 Oldest: 2022-05-18 08:19:50 +0000 Newest: 2022-05-18 08:19:50 +0000 Abgeschlossen: 392 Oldest: 2022-05-18 08:19:55 +0000 Newest: 2022-05-23 06:57:18 +0000 Ausstehend: 3 Oldest: 2022-05-24 02:04:23 +0000 Newest: 2022-05-24 04:46:53 +0000 ### Status report information ### Generated at: 2022-05-23 06:57:52 +00:00 ```
jostnes commented 2 years ago

👋 @jaclync, I noticed that you recently made some Stats related PRs in the 9.3 release, pinging you here since you might have more insights and can help with this merchant issue.

It looks like the issue is that the merchant is having trouble loading Stats data.

jaclync commented 2 years ago

Hello 👋 the recent dashboard updates just changed the timing of the stats API requests, and the requests stayed the same.

From the error message in the issue description:

"No value associated with key CodingKeys(stringValue: \"orders_count\", intValue: nil) (\"orders_count\")."

It sounds like the value for orders_count field does not exist in the API response. It's most likely some other plugin altering the response for wc-analytics/reports/revenue/stats requests.

rachelmcr commented 1 year ago

I looked into adding a fallback to the app to handle this scenario, but if we don't have this data we can't show accurate stats for Orders or Conversions in the dashboard. I don't think we want to handle this silently, because it will make the stats look inaccurate and potentially damage merchant trust in the app's stats. In cases like this we should probably show something in the UI to alert the merchant that the stats aren't complete because of a third-party plugin conflict.

For now, I've added an analytics event (in https://github.com/woocommerce/woocommerce-ios/pull/9858) so we can track this and other decoding errors that we weren't tracking before. That way we can check how often this is occurring and prioritize work on any design/behavior decisions and changes accordingly.