ACP2E-5122: Handled GraphQL cart errors are incorrectly written to the exception log

The ACP2E-5122 patch fixes the issue where handled GraphQL cart request errors are written to the exception log as application errors. This patch is available when the Quality Patches Tool (QPT) 1.1.84 is installed. The patch ID is ACP2E-5122. Please note that this issue is scheduled to be fixed in Adobe Commerce 2.4.10.

Affected products and versions

The patch is created for Adobe Commerce version:

  • Adobe Commerce (all deployment methods) 2.4.8-p5

Compatible with Adobe Commerce versions:

  • Adobe Commerce (all deployment methods) 2.4.4 - 2.4.9
NOTE
The patch might become applicable to other versions with new Quality Patches Tool releases. To check if the patch is compatible with your Adobe Commerce version, update the magento/quality-patches package to the latest version and check the compatibility on the Quality Patches Tool: Search for patches page. Use the patch ID as a search keyword to locate the patch.

Issue

Handled GraphQL cart request errors are written to the exception log as application errors.

Steps to reproduce:

  1. Send a GraphQL placeOrder mutation with an invalid, expired, or already-destroyed masked cart ID, such as this mutation:

    code language-none
        mutation {
            placeOrder(input: { cart_id: "test" }) {
                orderV2 {
                    id
                    number
                }
            }
        }
    
  2. Check the GraphQL response.

  3. Check var/log/exception.log for the cart error.

Expected results:

  1. The GraphQL request returns a handled client-facing error payload for the invalid cart without an HTTP 500 response.
  2. The handled GraphQlNoSuchEntityException is not written to var/log/exception.log and is routed to a lower-severity log channel instead.

Actual results:

Each request writes the handled exception to var/log/exception.log at report.ERROR severity, which causes unbounded log growth during repeated requests.

Apply the patch

To apply individual patches, use the following links depending on your deployment method:

To learn more about Quality Patches Tool, refer to:

recommendation-more-help
commerce-operations-help-tools