ACSD-65913: OpenSearch throws an illegal_argument_exception for categories with products having the same price

The ACSD-65913 patch fixes the issue where OpenSearch threw an illegal_argument_exception for categories with products having the same price. This patch is available when the Quality Patches Tool (QPT) 1.1.66 is installed. The patch ID is ACSD-65913. Please note that this issue is scheduled to be fixed in Adobe Commerce 2.4.9.

Affected products and versions

The patch is created for Adobe Commerce version:

  • Adobe Commerce (all deployment methods) 2.4.7-p5

Compatible with Adobe Commerce versions:

  • Adobe Commerce (all deployment methods) 2.4.7 - 2.4.8
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

OpenSearch throws an illegal_argument_exception ([from] parameter cannot be negative) when loading categories in which all products shared the same price.

Steps to reproduce:

  1. Install OpenSearch version 2.19.1 and set it as the default search engine.

  2. Configure the Price product attribute to be visible in Layered Navigation:

    1. Visible in Advanced Search: Yes
    2. Comparable on Storefront: Yes
    3. Use in Layered Navigation: Filterable (with results)
  3. Go to Stores > Configuration > Catalog > Catalog > Layered Navigation. Set Price Navigation Step Calculation to Automatic (equalize product counts).

  4. Create a category with six products that all have the same price:

    1. SKU: product_super_0-1-1-1, Price: $150
    2. SKU: product_super_0-1-1, Price: $48
    3. SKU: product_super_0-1, Price: $48
    4. SKU: product_super_0, Price: $48
    5. SKU: product_super_0-1-1-1-1-1-1-1-1-1-1-1-1-1, Price: $48
    6. SKU: product_super_0-1-1-1-1-1-1-1-1-1-1, Price: $48
  5. Run the following command:
    bin/magento indexer:reindex

  6. Open the category page. You’ll see an error:
    [from] parameter cannot be negative, found [-1]

Expected results:

OpenSearch should not throw an illegal_argument_exception when all products in a category have the same price.

Actual results:

  • OpenSearch throws an illegal_argument_exception with the message:
    [from] parameter cannot be negative, found [-1]

  • The var/log/exception.log file contains:

    code language-text
    [2025-05-14T22:39:33.595272+00:00] report.CRITICAL: OpenSearch\Common\Exceptions\BadRequest400Exception: {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"[from] parameter cannot be negative, found [-1]"}],"type":"illegal_argument_exception","reason":"[from] parameter cannot be negative, found [-1]"},"status":400}
    

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