Answer the question
In order to leave comments, you need to log in
Why does Duplicate entry '0-1' for key occur when I try to create an order in the store?
Tell me, please, what could be the problem?
[Bitrix\Main\DB\SqlQueryException]
Mysql query error: (1062) Duplicate entry '0-1' for key 'IX_SOPV_ORD_PROP_UNI' (400)
INSERT INTO `b_sale_order_props_value`(`ORDER_ID`, `ORDER_PROPS_ID`, `NAME`, `VALUE`, `CODE`) VALUES (0, 1, 'Комплектация', 'F', '')
/home/m/site/site.beget.tech/public_html/bitrix/modules/main/lib/db/mysqliconnection.php:137
#0: Bitrix\Main\DB\MysqliConnection->queryInternal(string, array, NULL)
/home/m/site/site.beget.tech/public_html/bitrix/modules/main/lib/db/connection.php:330
#1: Bitrix\Main\DB\Connection->query(string, NULL)
/home/m/site/site.beget.tech/public_html/bitrix/modules/main/lib/db/connection.php:379
#2: Bitrix\Main\DB\Connection->queryExecute(string)
/home/m/site/site.beget.tech/public_html/bitrix/modules/main/lib/db/connection.php:454
#3: Bitrix\Main\DB\Connection->add(string, array, string)
/home/m/site/site.beget.tech/public_html/bitrix/modules/main/lib/orm/data/datamanager.php:848
#4: Bitrix\Main\ORM\Data\DataManager::add(array)
/home/m/site/site.beget.tech/public_html/bitrix/modules/sale/lib/propertyvalue.php:175
#5: Bitrix\Sale\PropertyValue->addInternal(array)
/home/m/site/site.beget.tech/public_html/bitrix/modules/sale/lib/propertyvaluebase.php:337
#6: Bitrix\Sale\PropertyValueBase->add()
/home/m/site/site.beget.tech/public_html/bitrix/modules/sale/lib/propertyvalue.php:148
#7: Bitrix\Sale\PropertyValue->add()
/home/m/site/site.beget.tech/public_html/bitrix/modules/sale/lib/propertyvaluebase.php:282
#8: Bitrix\Sale\PropertyValueBase->save()
/home/m/site/site.beget.tech/public_html/bitrix/modules/sale/lib/propertyvaluecollectionbase.php:537
#9: Bitrix\Sale\PropertyValueCollectionBase->save()
/home/m/site/site.beget.tech/public_html/bitrix/modules/sale/lib/propertyvaluecollection.php:49
#10: Bitrix\Sale\PropertyValueCollection->save()
/home/m/site/site.beget.tech/public_html/bitrix/modules/sale/lib/orderbase.php:1483
#11: Bitrix\Sale\OrderBase->saveEntities()
/home/m/site/site.beget.tech/public_html/bitrix/modules/sale/lib/order.php:2166
#12: Bitrix\Sale\Order->saveEntities()
/home/m/site/site.beget.tech/public_html/bitrix/modules/sale/lib/orderbase.php:1142
#13: Bitrix\Sale\OrderBase->save()
/home/m/site/site.beget.tech/public_html/bitrix/modules/sale/lib/order.php:2321
#14: Bitrix\Sale\Order->save()
/home/m/site/site.beget.tech/public_html/checkout/index.php:368
Answer the question
In order to leave comments, you need to log in
For some unknown reason, in the db-base, after the last order No. 73, order No. 0 appeared.
And since auto increment is enabled and order No. 1 is already there - it knocked out an error.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question