SQLSTATE[21000]: Cardinality violation: 1242 Subquery returns more than 1 row

SQLSTATE[21000]: Cardinality violation: 1242 Subquery returns more than 1 row

Issue:

Orders fail to sync back to Stock2shop because it contains a product apearring twice on the console.

Solution:

This error indicates that the order data conflicts with the data in Stock2Shop. When an order contains a product that appears twice in the console, our system does not know which item should be used when posting the order back to your ERP.

This causes the order to fail in the queue.

To process the failed order you will need to search the console products using each SKU code on the order. These can be found on the Queue error payload under the line items.

When searching the products in the console, you will see one of the SKU codes appear twice in the list of items when searching.

Of the 2 items listed, you will need to check which is the correct product that will need to remain on the console. The 2nd product will need to be manually deleted by following the steps below:

  • On your Stock2Shop console, navigate to Products > View
  • On the duplicated product > Edit > General Tab > Delete

Once you have removed the duplicate items, you can retry the queue error by following the steps below:

  • Navigate to the failed order on your Stock2Shop console
  • Click on the three dots > Try Again

After you have followed the steps above, it should process the order without any issues If you are not certain which item needs to be removed, you can contact support@stock2shop.com for assistance.