Woocommerce-admin: Impossible to import historical data

Created on 16 Mar 2020  ·  10Comments  ·  Source: woocommerce/woocommerce-admin

Describe the bug
Trying to import Historical Data results in this error : "No route was found matching the URL and request method". Moreover, the console shows that the browser tries to GET a URL that doesn't exist : /wp-json/wc-analytics/reports/import/?skip_existing=true&_locale=user

To Reproduce
Steps to reproduce the behavior:

  1. Go to Setting in the Analytics section
  2. Scroll down to Import Historical Data
  3. Click the Start button

Screenshots
2020-03-16 à 22 58 53

Expected behavior
I was expecting the Historical Data to be imported

Isolating the problem (mark completed items with an [x]):

  • [x] I have deactivated other plugins and confirmed this bug occurs when only WooCommerce plugin is active.
  • [x] This bug happens with a default WordPress theme active, or Storefront.
  • [x] I can reproduce this bug consistently using the steps above.

WordPress Environment

WordPress Environment

WC Version: 4.0.0
REST API Version: ✔ 1.0.7
WC Blocks Version: ✔ 2.5.14
Action Scheduler Version: ✔ 3.1.2
WC Admin Version: ✔ 1.0.0
Log Directory Writable: ✔
WP Version: 5.3.2
WP Multisite: –
WP Memory Limit: 256 MB
WP Debug Mode: –
WP Cron: ✔
Language: fr_FR
External object cache: –

Server Environment

Server Info: Apache
PHP Version: 7.3.15
PHP Post Max Size: 8 MB
PHP Time Limit: 30
PHP Max Input Vars: 1000
cURL Version: 7.68.0
OpenSSL/1.1.1d

SUHOSIN Installed: –
MySQL Version: 5.6.45
Max Upload Size: 2 MB
Default Timezone is UTC: ✔
fsockopen/cURL: ✔
SoapClient: ✔
DOMDocument: ✔
GZip: ✔
Multibyte String: ✔
Remote Post: ✔
Remote Get: ✔

Database

WC Database Version: 4.0.0
WC Database Prefix: rp_
Taille totale de la base de données: 23.75MB
Taille de la base de données: 14.46MB
Taille de l’index: 9.29MB
rp_woocommerce_sessions: Données : 0.04MB + Index : 0.00MB + Moteur MyISAM
rp_woocommerce_api_keys: Données : 0.00MB + Index : 0.00MB + Moteur MyISAM
rp_woocommerce_attribute_taxonomies: Données : 0.00MB + Index : 0.00MB + Moteur MyISAM
rp_woocommerce_downloadable_product_permissions: Données : 0.02MB + Index : 0.02MB + Moteur MyISAM
rp_woocommerce_order_items: Données : 0.01MB + Index : 0.01MB + Moteur MyISAM
rp_woocommerce_order_itemmeta: Données : 0.07MB + Index : 0.05MB + Moteur MyISAM
rp_woocommerce_tax_rates: Données : 0.00MB + Index : 0.00MB + Moteur MyISAM
rp_woocommerce_tax_rate_locations: Données : 0.00MB + Index : 0.00MB + Moteur MyISAM
rp_woocommerce_shipping_zones: Données : 0.00MB + Index : 0.00MB + Moteur MyISAM
rp_woocommerce_shipping_zone_locations: Données : 0.00MB + Index : 0.00MB + Moteur MyISAM
rp_woocommerce_shipping_zone_methods: Données : 0.00MB + Index : 0.00MB + Moteur MyISAM
rp_woocommerce_payment_tokens: Données : 0.00MB + Index : 0.00MB + Moteur MyISAM
rp_woocommerce_payment_tokenmeta: Données : 0.00MB + Index : 0.00MB + Moteur MyISAM
rp_woocommerce_log: Données : 0.00MB + Index : 0.00MB + Moteur MyISAM
rp_actionscheduler_actions: Données : 0.01MB + Index : 0.02MB + Moteur MyISAM
rp_actionscheduler_claims: Données : 0.00MB + Index : 0.00MB + Moteur MyISAM
rp_actionscheduler_groups: Données : 0.00MB + Index : 0.01MB + Moteur MyISAM
rp_actionscheduler_logs: Données : 0.00MB + Index : 0.01MB + Moteur MyISAM
rp_commentmeta: Données : 0.49MB + Index : 0.09MB + Moteur MyISAM
rp_comments: Données : 0.76MB + Index : 0.11MB + Moteur MyISAM
rp_gf_addon_feed: Données : 0.00MB + Index : 0.00MB + Moteur MyISAM
rp_gf_addon_payment_callback: Données : 0.00MB + Index : 0.00MB + Moteur MyISAM
rp_gf_addon_payment_transaction: Données : 0.00MB + Index : 0.00MB + Moteur MyISAM
rp_gf_draft_submissions: Données : 0.00MB + Index : 0.00MB + Moteur MyISAM
rp_gf_entry: Données : 0.33MB + Index : 0.04MB + Moteur MyISAM
rp_gf_entry_meta: Données : 1.35MB + Index : 0.63MB + Moteur MyISAM
rp_gf_entry_notes: Données : 0.00MB + Index : 0.00MB + Moteur MyISAM
rp_gf_form: Données : 0.00MB + Index : 0.00MB + Moteur MyISAM
rp_gf_form_meta: Données : 0.01MB + Index : 0.00MB + Moteur MyISAM
rp_gf_form_revisions: Données : 0.00MB + Index : 0.00MB + Moteur MyISAM
rp_gf_form_view: Données : 0.68MB + Index : 0.30MB + Moteur MyISAM
rp_hook_list: Données : 0.00MB + Index : 0.00MB + Moteur MyISAM
rp_links: Données : 0.00MB + Index : 0.00MB + Moteur MyISAM
rp_options: Données : 2.24MB + Index : 1.72MB + Moteur MyISAM
rp_postmeta: Données : 0.93MB + Index : 0.42MB + Moteur MyISAM
rp_posts: Données : 5.06MB + Index : 4.89MB + Moteur MyISAM
rp_rg_form: Données : 0.00MB + Index : 0.00MB + Moteur MyISAM
rp_rg_form_meta: Données : 0.01MB + Index : 0.00MB + Moteur MyISAM
rp_rg_form_view: Données : 0.51MB + Index : 0.28MB + Moteur MyISAM
rp_rg_incomplete_submissions: Données : 0.00MB + Index : 0.00MB + Moteur MyISAM
rp_rg_lead: Données : 0.21MB + Index : 0.03MB + Moteur MyISAM
rp_rg_lead_detail: Données : 0.89MB + Index : 0.38MB + Moteur MyISAM
rp_rg_lead_detail_long: Données : 0.62MB + Index : 0.01MB + Moteur MyISAM
rp_rg_lead_meta: Données : 0.00MB + Index : 0.00MB + Moteur MyISAM
rp_rg_lead_notes: Données : 0.00MB + Index : 0.00MB + Moteur MyISAM
rp_termmeta: Données : 0.00MB + Index : 0.01MB + Moteur MyISAM
rp_terms: Données : 0.00MB + Index : 0.01MB + Moteur MyISAM
rp_term_relationships: Données : 0.05MB + Index : 0.09MB + Moteur MyISAM
rp_term_taxonomy: Données : 0.00MB + Index : 0.00MB + Moteur MyISAM
rp_usermeta: Données : 0.02MB + Index : 0.02MB + Moteur MyISAM
rp_users: Données : 0.00MB + Index : 0.01MB + Moteur MyISAM
rp_wc_admin_notes: Données : 0.00MB + Index : 0.00MB + Moteur MyISAM
rp_wc_admin_note_actions: Données : 0.00MB + Index : 0.00MB + Moteur MyISAM
rp_wc_category_lookup: Données : 0.00MB + Index : 0.00MB + Moteur MyISAM
rp_wc_customer_lookup: Données : 0.00MB + Index : 0.01MB + Moteur MyISAM
rp_wc_download_log: Données : 0.05MB + Index : 0.05MB + Moteur MyISAM
rp_wc_order_coupon_lookup: Données : 0.00MB + Index : 0.00MB + Moteur MyISAM
rp_wc_order_product_lookup: Données : 0.00MB + Index : 0.01MB + Moteur MyISAM
rp_wc_order_stats: Données : 0.00MB + Index : 0.01MB + Moteur MyISAM
rp_wc_order_tax_lookup: Données : 0.00MB + Index : 0.00MB + Moteur MyISAM
rp_wc_product_meta_lookup: Données : 0.00MB + Index : 0.01MB + Moteur MyISAM
rp_wc_tax_rate_classes: Données : 0.00MB + Index : 0.01MB + Moteur MyISAM
rp_wc_webhooks: Données : 0.00MB + Index : 0.00MB + Moteur MyISAM
rp_yoast_seo_links: Données : 0.09MB + Index : 0.02MB + Moteur MyISAM
rp_yoast_seo_meta: Données : 0.01MB + Index : 0.01MB + Moteur MyISAM

Post Type Counts

attachment: 204
forum: 9
nav_menu_item: 8
page: 24
post: 217
product: 1
reply: 8
revision: 376
shop_order: 176

Security

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

Active Plugins (9)

Advanced GA plugin: par Ismail El Korchi – 0.1
Akismet Anti-Spam: par Automattic – 4.1.3
Classic Editor: par Contributeurs et contributrices WordPress – 1.5
Disable Embeds: par Pascal Birchler – 1.4.0
Gravity Forms: par rocketgenius – 2.4.17
WooCommerce Stripe Gateway: par WooCommerce – 4.3.2 – Non testé avec la version active de WooCommerce
WooCommerce: par Automattic – 4.0.0
Yoast SEO: par L’équipe Yoast – 13.2 – Non testé avec la version active de WooCommerce
WP Super Cache: par Automattic – 1.7.1

Inactive Plugins (1)

EDD Sendy: par Ismail el korchi – 0.1

Dropin Plugins (1)

advanced-cache.php: advanced-cache.php

Settings

API Enabled: –
Force SSL: ✔
Currency: EUR (€)
Currency Position: right
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: –

WC Pages

Base de la boutique: woocommerce/woocommerce#7777 - /boutique/
Panier: woocommerce/woocommerce#7778 - /panier/
Validation de la commande: woocommerce/woocommerce#7779 - /commande/
Mon compte: woocommerce/woocommerce#7780 - /mon-compte/
Conditions générales de vente et d’utilisation: ❌ Page non définie

Theme

Name: Réussite Personnelle 2015
Version: 1.0
Author URL:
Child Theme: ✔
Parent Theme Name: Genesis
Parent Theme Version: 3.3.0
Parent Theme Author URL: https://www.studiopress.com/
WooCommerce Support: ❌ Non déclaré

Templates

Overrides: –

Action Scheduler

Terminer: 25
Oldest: 2020-03-11 10:39:04 +0100
Newest: 2020-03-16 23:03:00 +0100

All 10 comments

Hi @Ismail-elkorchi

Thank you for reporting the issue. WooCommerce Admin is being developed in another repository: https://github.com/woocommerce/woocommerce-admin.

I am going to move your bug report there so that the right team could take a look further.

Hello @Ismail-elkorchi,

Are you perhaps using any plugins that restrict the WP REST API? That endpoint should exist with WooCommerce 4.0.0 and/or WooCommerce Admin enabled.

Hello @jeffstieler,

No I don't have any plugins that restrict the WP REST API. As an example, the "/wp-json/wc-analytics/" endpoint is working well.

@Ismail-elkorchi Can you load the /wp-json/wc-analytics/reports/import/?skip_existing=true endpoint directly in an authenticated rest client?

@Ismail-elkorchi that's quite curious - the /wp-json/wc-analytics/reports/import/ endpoint expects a POST request to be made, not a GET.

What plugins do you have active?

@rrennick Loading the /wp-json/wc-analytics/reports/import/?skip_existing=true endpoint results in this response :

{
  "code": "rest_no_route",
  "message": "No route was found matching the URL and request method",
  "data": {
    "status": 404
  }
}

@jeffstieler You can find all the plugins I'm using under the WordPress Environment heading in the issue report.

This is really strange. The code that makes this API call is hardcoded to send a POST.. not GET: https://github.com/woocommerce/woocommerce-admin/blob/8585ed89b80c394b9cec160ded8c591a8fbfa20d/client/analytics/settings/historical-data/index.js#L55

@rrennick do you know of any cases where @wordpress/api-fetch would change the HTTP method for a POST?

do you know of any cases where @wordpress/api-fetch would change the HTTP method for a POST?

The only thing that comes to mind is this might happen with an expired nonce.

The latest WooCommerce update seems to solve my problem. By installing it I managed to import the historical data.

Thanks for following up with us @Ismail-elkorchi - I'll go ahead and close the issue.

Was this page helpful?
0 / 5 - 0 ratings