Skip to content

Magento 2 REST API `POST /carts/mine` takes forever to respond

It’s an endpoint that:

Creates an empty cart and quote for a specified customer if customer
does not have a cart yet.

Doc: https://magento.redoc.ly/2.3.7-admin/tag/cartsmine#operation/quoteCartManagementV1CreateEmptyCartForCustomerPost

It took minutes before I cancelled the request or sometimes got HTTP 502 Bad Gateway from nginx server since Magento 2 was not responding.

By the way, it responds normally if the customer token provided is invalid. But if the token is valid, it takes forever to process.

I can’t find any Magento 2 log information about the process or request. I guess it is because it never finish processing the request.

It worked before until lately. I don’t know how to debug this. Please help!

I’m using Magento 2.3.3