woocommerce / woocommerce-rest-api

This is the WooCommerce core REST API Package. It runs standalone as a feature plugin too.
71 stars 46 forks source link

ERROR 502 Bad Request #243

Closed mirco261 closed 3 years ago

mirco261 commented 4 years ago

Hi, sometimes when I try to make api call, like download products: GET /wp-json/wc/v3/products?per_page=100&page=28

I get error 502 bad gateway

sometimes GET 1-30 pages return all fine, but sometimes (2-3rd run) I've got 502 bad gateway error

Response Headers

HTTP/1.1 502 Bad Gateway
Server: nginx
Date: Mon, 14 Sep 2020 20:11:54 GMT
Content-Type: text/html
Content-Length: 89474
Connection: keep-alive
ETag: "5e786dfc-15d82"
Host-Header: 6b7412fb82ca5edfd0917e3957f05d89
X-Proxy-Cache: MISS
X-Proxy-Cache-Info: W NC:000000 UP:0

Do you have any idea?

Woocommerce 4.5.2 Wordpress 5.5.1 PHP on server 7.4.8 (7.3.20 tested too and same result)

I've tried disable all plugins and templates and same result

vedanshujain commented 3 years ago

502 error generally happens when it takes a very long time to compute an API response. This is likely a generic performance issue, we are infact targetting some performance enhancements in #27735 and #27734.

Meanwhile, I would recommend that you try with less products per page, perhaps 75 or even 50 to see if that helps. I am closing this issue since we will be targetting performance bottlenecks in seperate granular issues, instead of a generic issue like this one.