We are running Magento store for more than 3 years and this error happened today suddenly.
This error happens in Sales->Order
After adding the Shipping Information (Title and Tracking Number) and checking "Email Copy of Shipment", I try to click on "Submit Shipment" Button.
The page reloads and show the following.
Cannot save Shipment [RED]
The Shipment has been created [GREEN]
I don't have any clue, why this showing suddenly. and I am not able to save shipment for all orders in Magento. Please help me to fix this.
EXCEPTION LOG
Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '100029587' for key 2' in /var/www/vhosts/XXXXXXXXXXXXXx/httpdocs/lib/Zend/Db/Statement/Pdo.php:234 Stack trace:
0 /var/www/vhosts/XXXXXXXXXXXXXx/httpdocs/lib/Varien/Db/Statement/Pdo/Mysql.php(110):
Zend_Db_Statement_Pdo->_execute(Array)1 /var/www/vhosts/XXXXXXXXXXXXXx/httpdocs/lib/Zend/Db/Statement.php(300):
Varien_Db_Statement_Pdo_Mysql->_execute(Array) -#2 /var/www/vhosts/XXXXXXXXXXXXXx/httpdocs/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array) -#3 /var/www/vhosts/XXXXXXXXXXXXXx/httpdocs/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTOsa...', Array) -#4 /var/www/vhosts/XXXXXXXXXXXXXx/httpdocs/lib/Varien/Db/Adapter/Pdo/Mysql.php(394): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO
sa...', Array) -#5 /var/www/vhosts/XXXXXXXXXXXXXx/httpdocs/lib/Zend/Db/Adapter/Abstract.php(574): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `sa...', Array) -#6 /var/www/vhosts/XXXXXXXXXXXXXx/httpdocs/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(448): Zend_Db_Adapter_Abstract->insert('sales_flat_ship...', Array) -#7 /var/www/vhosts/XXXXXXXXXXXXXx/httpdocs/app/code/core/Mage/Sales/Model/Resource/Order/Abstract.php(425): Mage_Core_Model_Resource_Db_Abstract->save(Object(Mage_Sales_Model_Order_Shipment)) -#8 /var/www/vhosts/XXXXXXXXXXXXXx/httpdocs/app/code/core/Mage/Core/Model/Abstract.php(318): Mage_Sales_Model_Resource_Order_Abstract->save(Object(Mage_Sales_Model_Order_Shipment)) -#9 /var/www/vhosts/XXXXXXXXXXXXXx/httpdocs/app/code/core/Mage/Core/Model/Resource/Transaction.php(151): Mage_Core_Model_Abstract->save() -#10 /var/www/vhosts/XXXXXXXXXXXXXx/httpdocs/app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php(120): Mage_Core_Model_Resource_Transaction->save() -#11 /var/www/vhosts/XXXXXXXXXXXXXx/httpdocs/app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php(225): Mage_Adminhtml_Sales_Order_ShipmentController->_saveShipment(Object(Mage_Sales_Model_Order_Shipment)) -#12 /var/www/vhosts/XXXXXXXXXXXXXx/httpdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(420): Mage_Adminhtml_Sales_Order_ShipmentController->saveAction() -#13 /var/www/vhosts/XXXXXXXXXXXXXx/httpdocs/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('save') -#14 /var/www/vhosts/XXXXXXXXXXXXXx/httpdocs/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http)) -#15 /var/www/vhosts/XXXXXXXXXXXXXx/httpdocs/app/code/core/Mage/Core/Model/App.php(349): Mage_Core_Controller_Varien_Front->dispatch() -#16 /var/www/vhosts/XXXXXXXXXXXXXx/httpdocs/app/Mage.php(640): Mage_Core_Model_App->run(Array) -#17 /var/www/vhosts/XXXXXXXXXXXXXx/httpdocs/index.php(80): Mage::run('', 'website') -#18 {main}