woocommerce / woocommerce-admin

(Deprecated) This plugin has been merged to woocommerce/woocommerce
https://woocommerce.github.io/woocommerce-admin/#/
Other
362 stars 146 forks source link

503 Errors in Admin #3943

Closed szuranski closed 3 years ago

szuranski commented 4 years ago

When accessing the backend in version 4.0 multiple AJAX call are being made which caused the server to start returning 503 errors. The more AJAX requests being made the more likely the page doesn't load.

Many others reporting the same problem. https://wordpress.org/support/plugin/woocommerce/

image

To Reproduce Steps to reproduce the behavior:

  1. Login in to WordPress dashboard.
  2. Click WooCommerce > Dashboard
  3. Open dev console
  4. Watch multiple AJAX calls being made and eventually return 503 codes.
  5. This happens on other Woo admin pages but the dashboard tab is the worst.
  6. After attempting to access a few pages that cause the issue the server crashes and starts return can't connect to database errors.

Screenshots image

image

image

Expected behavior All WooCommerce admin pages should load without crashing the server.

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

WordPress Environment

``` ` ### WordPress Environment ### WordPress address (URL): https://www.hi-vis-shirts.com/ Site address (URL): https://www.hi-vis-shirts.com/ 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: 512 MB WP Debug Mode: – WP Cron: ✔ Language: en_US External object cache: – ### Server Environment ### Server Info: Apache PHP Version: 7.3.13 PHP Post Max Size: 64 MB PHP Time Limit: 180 PHP Max Input Vars: 1000 cURL Version: 7.62.0 OpenSSL/1.0.2k SUHOSIN Installed: – MySQL Version: 5.6.46-cll-lve Max Upload Size: 64 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: wp_ Total Database Size: 12.83MB Database Data Size: 10.28MB Database Index Size: 2.55MB wp_woocommerce_sessions: Data: 0.02MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_api_keys: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_attribute_taxonomies: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_downloadable_product_permissions: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_order_items: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_order_itemmeta: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_tax_rates: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_tax_rate_locations: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_shipping_zones: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_shipping_zone_locations: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_shipping_zone_methods: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_payment_tokens: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_payment_tokenmeta: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_log: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_actionscheduler_actions: Data: 0.49MB + Index: 0.12MB + Engine MyISAM wp_actionscheduler_claims: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_actionscheduler_groups: Data: 0.00MB + Index: 0.01MB + Engine MyISAM wp_actionscheduler_logs: Data: 0.36MB + Index: 0.21MB + Engine MyISAM wp_blc_filters: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_blc_instances: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_blc_links: Data: 0.01MB + Index: 0.01MB + Engine MyISAM wp_blc_synch: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_blogmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_blogs: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_blog_versions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_comments: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_db7_forms: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_nm_personalized: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_options: Data: 2.47MB + Index: 0.16MB + Engine InnoDB wp_postmeta: Data: 1.52MB + Index: 0.73MB + Engine InnoDB wp_posts: Data: 1.22MB + Index: 0.13MB + Engine InnoDB wp_registration_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_signups: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_site: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_sitemeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_term_relationships: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_tm_taskmeta: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_tm_tasks: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_usermeta: Data: 0.06MB + Index: 0.03MB + Engine InnoDB wp_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wcuf_upload_sessions: Data: 0.00MB + Index: 0.01MB + Engine MyISAM wp_wc_admin_notes: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wc_admin_note_actions: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wc_category_lookup: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wc_customer_lookup: Data: 0.00MB + Index: 0.01MB + Engine MyISAM wp_wc_download_log: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wc_order_coupon_lookup: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wc_order_product_lookup: Data: 0.00MB + Index: 0.01MB + Engine MyISAM wp_wc_order_stats: Data: 0.00MB + Index: 0.01MB + Engine MyISAM wp_wc_order_tax_lookup: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wc_product_meta_lookup: Data: 0.03MB + Index: 0.04MB + Engine MyISAM wp_wc_tax_rate_classes: Data: 0.00MB + Index: 0.01MB + Engine MyISAM wp_wc_webhooks: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wfblockediplog: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wfblocks7: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wfconfig: Data: 0.39MB + Index: 0.01MB + Engine MyISAM wp_wfcrawlers: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wffilechanges: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wffilemods: Data: 2.13MB + Index: 0.32MB + Engine MyISAM wp_wfhits: Data: 0.01MB + Index: 0.00MB + Engine MyISAM wp_wfhoover: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wfissues: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wfknownfilelist: Data: 1.10MB + Index: 0.14MB + Engine MyISAM wp_wflivetraffichuman: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wflocs: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wflogins: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wfls_2fa_secrets: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wfls_settings: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wfnotifications: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wfpendingissues: Data: 0.05MB + Index: 0.01MB + Engine MyISAM wp_wfreversecache: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wfsnipcache: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wfstatus: Data: 0.07MB + Index: 0.03MB + Engine MyISAM wp_wftrafficrates: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_yoast_seo_links: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_yoast_seo_meta: Data: 0.01MB + Index: 0.02MB + Engine MyISAM ### Post Type Counts ### acf-field: 4 acf-field-group: 1 attachment: 142 custom_css: 2 et_pb_layout: 2 nav_menu_item: 21 page: 9 post: 3 product: 15 product_variation: 222 shop_order: 4 shop_order_refund: 1 wpcf7_contact_form: 1 ### Security ### Secure connection (HTTPS): ✔ Hide errors from visitors: ✔ ### Active Plugins (17) ### ManageWP - Worker: by GoDaddy – 4.9.3 Broken Link Checker: by ManageWP – 1.11.11 Child Theme Configurator: by Lilaea Media – 2.5.2 Contact Form 7: by Takayuki Miyoshi – 5.1.7 Contact Form CFDB7: by Arshid – 1.2.4.8 Duplicate Page: by mndpsingh287 – 4.1 Limit Login Attempts Reloaded: by WPChef – 2.10.1 Woocommerce Bulk Order discount: by QuanticEde – 1.0 – Not tested with the active version of WooCommerce Redirection: by John Godley – 4.7.1 UpdraftPlus - Backup/Restore: by UpdraftPlus.Com DavidAnderson – 1.16.22 Woocommerce Ebizcharge Gateway: by EBizCharge – 3.8.1 – Not tested with the active version of WooCommerce WooCommerce Upload Files: by Lagudi Domenico – 53.4 – Not tested with the active version of WooCommerce WooCommerce: by Automattic – 4.0.0 Wordfence Security: by Wordfence – 7.4.6 Yoast SEO: by Team Yoast – 13.3 WP Fastest Cache: by Emre Vona – 0.9.0.4 Redirection for Contact Form 7: by Query Solutions – 1.3.5 ### Inactive Plugins (4) ### Advanced Custom Fields PRO: by Elliot Condon – 5.8.8 Megabytz Debugger: by szuranski – 1.0.0 Query Monitor: by John Blackbourn – 3.5.2 WooCommerce Bulk Variations: by Lucas Stark – 1.6.5 – Not tested with the active version of WooCommerce ### Must Use Plugins (2) ### installatron_hide_status_test.php: by – ManageWP - Worker Loader: by GoDaddy – ### 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: ✔ ### WC Pages ### Shop base: woocommerce/woocommerce#184 - /shop/ Cart: woocommerce/woocommerce#185 - /cart/ Checkout: woocommerce/woocommerce#186 - /checkout/ My account: woocommerce/woocommerce#187 - /my-account/ Terms and conditions: ❌ Page not set ### Theme ### Name: Divi Child Version: 4.0.4.1575395020 Author URL: http://www.elegantthemes.com Child Theme: ✔ Parent Theme Name: Divi Parent Theme Version: 4.4.1 Parent Theme Author URL: http://www.elegantthemes.com WooCommerce Support: ✔ ### Templates ### Overrides: – ### Action Scheduler ### Canceled: 1 Oldest: 2020-03-16 14:49:50 +0000 Newest: 2020-03-16 14:49:50 +0000 Complete: 1,364 Oldest: 2020-02-16 21:39:22 +0000 Newest: 2020-03-18 21:05:57 +0000 Pending: 1 Oldest: 2020-03-18 22:05:57 +0000 Newest: 2020-03-18 22:05:57 +0000 ` ```
peterfabian commented 4 years ago

Thanks for reporting. We will be looking at improving the performance in the upcoming releases. Transferring the issue to WC Admin repo.

szuranski commented 4 years ago

Thanks for reporting. We will be looking at improving the performance in the upcoming releases. Transferring the issue to WC Admin repo.

Can you give any idea how long? 1 week, 1 month?

timmyc commented 4 years ago

@szuranski thanks for the report. Can you share a few more details about your site to see if we can reproduce? Where is the site hosted specifically? Based upon the status report above, it says "example.com" is this happening in a local environment only?

We have tested the dashboard, and all of WooCommerce 4.0 on a variety of hosting environments and did not encounter this, but I am aware it has happened on other sites. Also have you tried disabling other plugins/extensions to determine if another one is possibly hooking into the REST API and causing slower response times?

szuranski commented 4 years ago

@timmyc

https://www.hi-vis-shirts.com/

It's a fresh install of WP and Woo on a GoDaddy server. All plugins except Woo where disabled with the same result. It's directly related to the amount of AJAX calls made after page load. There more calls the more likely the page times out.

timmyc commented 4 years ago

@szuranski thanks so much! We have tested on GoDaddy, but I will test again and see if I can reproduce. It almost sounds like there might be some sort of firewall/web security thing triggering to block the requests to the REST API.

I'm not extremely familiar with GoDaddy, but what is the name/level of the hosting plan that is in use? We do have some contacts at GoDaddy I can reach out to also and get some help debugging from their side.

szuranski commented 4 years ago

@timmyc

GoDaddy Deluxe Hosting

dz0ny commented 4 years ago

I did a quick trace on wp-json/wc-analytics/admin/notes

Spec:

Plugins: +------------------------------------+----------+-----------+---------+ | name | status | update | version | +------------------------------------+----------+-----------+---------+ | query-monitor | inactive | none | 3.5.2 | | sendgrid-email-delivery-simplified | active | none | 1.11.8 | | woocommerce | active | none | 4.0.1 | +------------------------------------+----------+-----------+---------+

Completely fresh install with no products or orders.

Summary image

Trace for wp-json/wc-analytics/admin/notes app tideways io_o_Niteo_dz0 us_trace_NFldAnEBlTGRFerWPRSv_full_fn=register_rest_route (1)

file_exists via spl_autoload_call would explain high IO seen in the first comment (this happens for every request to wc-analytics). register_rest_route seems erroneous and should not be called so many times.

@timmyc Ping me if you need reproducible env.

timmyc commented 4 years ago

@szuranski I set up a new site on GoDaddy hosting and can not re-create myself there. By chance are you running Sucuri firewall or a similar service.

@dz0ny absolutely, please do reach out with a site where this is happening that I can access 🙌

timmy.crawford -at- automattic.com

szuranski commented 4 years ago

@timmyc

The Wordfence plugin is installed but even with it deactivated it still happens.

There's still dozens of AJAX requests on page load on the WooCommerce > Dashboard tab that all end with a 503. Are you seeing the same amount of requests on your setup?

image

timmyc commented 4 years ago

@szuranski indeed I have those REST API xhr requests happening too, just none are failing for me.

Did you by chance configure the site/DNS to use the Sucuri firewall service still? I'm not really savvy with their offering, and am in the process of setting it up myself to see if that could be throttling the requests.

sandra-sanz commented 4 years ago

I am having the same issue with the 503 Errors. The log shows some errores related to the database:

Error while sending QUERY packet. PID=1024988 in /home/fardatxo/public_html/wp-includes/wp-db.php on line 2030

mysqli_real_connect(): (HY000/1203): User fardatxo_woo already has more than 'max_user_connections' active connections in /home/fardatxo/public_html/wp-includes/wp-db.php on line 1633

There's also some intense resource usage whenever I try to access the WC Dashboard.

Screenshot_4

It's very unlikely that this is due to traffic since the site has low traffic. Not using sucuri. I can provide access to a staging site if needed.

szuranski commented 4 years ago

@timmyc

Sucuri or any other firewall is not set up on the site.

5PENC3 commented 4 years ago

I am having this exact issue. I have an open support case with woo commerce about this. Did you get anywhere with it?

szuranski commented 4 years ago

@5PENC3 I have not found a solution yet.

5PENC3 commented 4 years ago

@5PENC3 I have not found a solution yet.

Thanks - Woocommerce have referenced this thread in my ticket. I have clients eagerly waiting to launch the website so I need a solution as soon as possible or I could potentially lose them. They have also expressed interest in moving to Shopify :(

rrennick commented 4 years ago

@szuranski @5PENC3 The next release reduces the number of REST API calls on page load and has some performance improvements in some of the API processing. Hopefully that will reduce the load below your max_user_connections setting.

addedlovely commented 4 years ago

Not sure if the update has been released yet, but have experienced this today with WooCommerce version 4.0.1. On Nimbus hosting, running via Plesk, PHP 7.3 with 768M memory limit. Several AJAX requests, most don't complete and 503 causing the dashboard to stall and show no statistics.

ERROR 500 GET /wp-json/wc-analytics/reports/downloads/stats?after=2019-04-01T00%3A00%3A00&before=2019-04-19T23%3A59%3A59&interval=day&order=asc&per_page=100&_locale=user HTTP/1.0

ERROR 503 GET /wp-json/wc-analytics/reports/performance-indicators?after=2020-04-01T00%3A00%3A00&before=2020-04-19T19%3A05%3A00&stats=revenue%2Ftotal_sales%2Crevenue%2Fnet_revenue%2Corders%2Forders_count%2Corders%2Favg_order_value%2Cproducts%2Fitems_sold%2Crevenue%2Frefunds%2Crevenue%2Fgross_sales&_locale=user HTTP/1.0

We do have WordFence enabled - will setup a staging site and test with it disabled.

Are the API requests cached, as doesn't seem to get much better on next load(s)?

Screenshot 2020-04-19 at 20 08 21
5PENC3 commented 4 years ago

To my knowledge there isn't an update yet but I wouldn't know as I have been forced to downgrade to 3.9 which has not solved the problem but it has made it less frequent. I have had to rebuild the website from scratch and will be aiming to swap the website over tomorrow morning. This has been the only solution I can provide for the client and had been a tonne of extra work on my part. I pray the new website doesn't develop the fault too otherwise I really don't know what I'm going to tell them.

addedlovely commented 4 years ago

@5PENC3 it's essentially a resource issue - so if you're in a pickle in the meantime - would suggest that you upgrade or change your hosting plan. Personally I rate SiteGround - enable their dynamic caching, memcache and NGINX file serving options which come on their 'GoGeek' package - or look into a VPS if the site gets a high number of visitors.

If you don't already have a static caching system on the site, install one - that will alleviate the load on the server from frontend visits ( something like WP Rocket ). You could also look into serving your static files from a CDN, again to alleviate load on the server ( fairly simple to setup with WP Rocket ).

If you can't migrate hosting, increase your PHP memory limit and use the latest version of PHP available on the hosting package.

5PENC3 commented 4 years ago

@5PENC3 it's essentially a resource issue - so if you're in a pickle in the meantime - would suggest that you upgrade or change your hosting plan. Personally I rate SiteGround - enable their dynamic caching, memcache and NGINX file serving options which come on their 'GoGeek' package - or look into a VPS if the site gets a high number of visitors.

If you don't already have a static caching system on the site, install one - that will alleviate the load on the server from frontend visits ( something like WP Rocket ). You could also look into serving your static files from a CDN, again to alleviate load on the server ( fairly simple to setup with WP Rocket ).

If you can't migrate hosting, increase your PHP memory limit and use the latest version of PHP available on the hosting package.

Thanks for the reply I appreciate it. Here's how it went today;

I moved over to the rebuilt website and still had the same issue. I'd already increased all of the memory limits available to me so I contacted my host again and upgraded my hosting account. This did still not fix the issue. At this point I've tried everything I can think of except a new host. I set up an account with Siteground after a couple of recommendations online and boom, working flawlessly. I'm not sure what the issue was and if my hosts are to blame or not but this was one of the things they said:


As for the website it time out as there are processes that took too long to respond, for example:

[21-Apr-2020 09:06:15 UTC] PHP Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 20480 bytes) in /public_html/wp-includes/sodium_compat/src/Compat.php on line 1108

That is the last error message for your website and as you can see it shows the file that failed to complete to be executed.

(not sure why that's so big couldn't clear the formatting)

Moving the site away from a host that I've used for years wasn't the ideal solution for me but myself and my client are both relieved. I just hope I don't run into this issue again.

rrennick commented 4 years ago

@5PENC3 Glad you were able to get it sorted out. This info is really helpful

[21-Apr-2020 09:06:15 UTC] PHP Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 20480 bytes)
lammersma commented 4 years ago

I installed a plugin that disables the WC analytics features. This solved the 503 issues!

igorradovanov commented 4 years ago

Does anyone use the realtime backup plugin on their environment? I've resolved my issues by disabling the backup plugin. No more 503s after the backup plugin was disabled.

timmyc commented 4 years ago

@igorradovanov interesting - could you share a link to that plugin - I'm having issues finding it.

igorradovanov commented 4 years ago

Sure thing, @timmyc It was the BackupBuddy in my case.

mackaaij commented 3 years ago

@lammersma did you install Disable WooCommerce Bloat?

lammersma commented 3 years ago

Yes, I believe I did. But I removed it as soon as it turned out not solve any issues… Is there a left over causes new issues? ☹

Van: Patrick Mackaaij notifications@github.com Verzonden: zondag 3 januari 2021 14:01 Aan: woocommerce/woocommerce-admin woocommerce-admin@noreply.github.com CC: lammersma lammersma@hotmail.com; Mention mention@noreply.github.com Onderwerp: Re: [woocommerce/woocommerce-admin] 503 Errors in Admin (#3943)

@lammersmahttps://github.com/lammersma did you install Disable WooCommerce Bloathttps://wordpress.org/plugins/disable-dashboard-for-woocommerce/?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/woocommerce/woocommerce-admin/issues/3943#issuecomment-753613549, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGJPR6GD44KPMW2GWGJ5CL3SYBTAJANCNFSM4LPLZ55Q.

mackaaij commented 3 years ago

I stumbled upon this topic as I received a few warnings from my hosting provider regarding RAM exhaustion. Almost all of the errors trace back to calls related to WooCommerce.

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 3 years ago

This issue was automatically closed due to being stale. Please feel free to re-open it if you still experience this problem.

JorisA-JT commented 2 years ago

I have the same problem... Anyone knows how to fix this? Tried almost everything, from clean installation on new host to disabling/enabling every plugin and theme at once.