Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Custom Module and core_url_rewrite error Duplicate entry
 
saps101
Jr. Member
 
Total Posts:  5
Joined:  2012-11-12
 

Hi,
I have been developing a module that syncronises categories and products from an external inventory/product management system.
I can create all the categories/subcategories and product however when i attempt to refresh index after the process have complete i get an exception within the core_url_rewrite table.

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry “08586700_1371769895-0-1” for key
“UNQ_ZQZHBQOPMVWOJSDOSCOX”

i know the error means that that is already a duplicate entry in the table for the composite key of
“08586700_1371769895-0-1”
however i cannot find the value “08586700_1371769895” within the table.

i know the -0-1 signify that
is_system=0
and store_id =1

i am not setting any url’s or keys on the categories or products when their created could this be causing the issue? i would like the url rewrites to be generated by the system if possible.
the is_system=0 is throwing me because i am not setting them.

What could cause this issue? has anyone had any experience with it?

What fields would be recommmened to be set for
and Mage_Catalog_Model_Product
Mage_Catalog_Model_Category
when i am creating the new products from the external service.

The full Exception Dump

Trace:
#0 C:\Inetpub\vhosts\camec.com\httpdocs\shop\lib\Varien\Db\Statement\Pdo\Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 C:\Inetpub\vhosts\camec.com\httpdocs\shop\lib\Zend\Db\Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 C:\Inetpub\vhosts\camec.com\httpdocs\shop\lib\Zend\Db\Adapter\Abstract.php(479): Zend_Db_Statement->execute(Array)
#3 C:\Inetpub\vhosts\camec.com\httpdocs\shop\lib\Zend\Db\Adapter\Pdo\Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `co...', Array)
#4 C:\Inetpub\vhosts\camec.com\httpdocs\shop\lib\Varien\Db\Adapter\Pdo\Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `co...', Array)
#5 C:\Inetpub\vhosts\camec.com\httpdocs\shop\lib\Zend\Db\Adapter\Abstract.php(574): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `co...', Array)
#6 C:\Inetpub\vhosts\camec.com\httpdocs\shop\app\code\core\Mage\Catalog\Model\Resource\Url.php(338): Zend_Db_Adapter_Abstract->insert('core_url_rewrit...', Array)
#7 C:\Inetpub\vhosts\camec.com\httpdocs\shop\app\code\core\Mage\Catalog\Model\Url.php(963): Mage_Catalog_Model_Resource_Url->saveRewriteHistory(Array)
#8 C:\Inetpub\vhosts\camec.com\httpdocs\shop\app\code\core\Mage\Catalog\Model\Url.php(369): Mage_Catalog_Model_Url->_saveRewriteHistory(Array, Object(Varien_Object))
#9 C:\Inetpub\vhosts\camec.com\httpdocs\shop\app\code\core\Mage\Catalog\Model\Url.php(568): Mage_Catalog_Model_Url->_refreshProductRewrite(Object(Varien_Object), Object(Varien_Object))
#10 C:\Inetpub\vhosts\camec.com\httpdocs\shop\app\code\core\Mage\Catalog\Model\Url.php(255): Mage_Catalog_Model_Url->refreshProductRewrites('1')
#11 C:\Inetpub\vhosts\camec.com\httpdocs\shop\app\code\core\Mage\Catalog\Model\Url.php(248): Mage_Catalog_Model_Url->refreshRewrites('1')
#12 C:\Inetpub\vhosts\camec.com\httpdocs\shop\app\code\core\Mage\Catalog\Model\Indexer\Url.php(257): Mage_Catalog_Model_Url->refreshRewrites()
#13 C:\Inetpub\vhosts\camec.com\httpdocs\shop\app\code\core\Mage\Index\Model\Process.php(209): Mage_Catalog_Model_Indexer_Url->reindexAll()
#14 C:\Inetpub\vhosts\camec.com\httpdocs\shop\app\code\core\Mage\Index\Model\Process.php(255): Mage_Index_Model_Process->reindexAll()
#15 C:\Inetpub\vhosts\camec.com\httpdocs\shop\app\code\local\Aerion\NavToMagento\Model\Navision.php(290): Mage_Index_Model_Process->reindexEverything()
#16 C:\Inetpub\vhosts\camec.com\httpdocs\shop\app\code\local\Aerion\NavToMagento\Model\Navision.php(133): Aerion_NavToMagento_Model_Navision->clearAll()
#17 C:\Inetpub\vhosts\camec.com\httpdocs\shop\app\code\local\Aerion\NavToMagento\controllers\Adminhtml\CatsynchController.php(24): Aerion_NavToMagento_Model_Navision->synchCategories()
#18 C:\Inetpub\vhosts\camec.com\httpdocs\shop\app\code\local\Aerion\NavToMagento\controllers\Adminhtml\CatsynchController.php(17): Aerion_NavToMagento_Adminhtml_CatsynchController->catSynch()
#19 C:\Inetpub\vhosts\camec.com\httpdocs\shop\app\code\core\Mage\Core\Controller\Varien\Action.php(419): Aerion_NavToMagento_Adminhtml_CatsynchController->indexAction()
#20 C:\Inetpub\vhosts\camec.com\httpdocs\shop\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#21 C:\Inetpub\vhosts\camec.com\httpdocs\shop\app\code\core\Mage\Core\Controller\Varien\Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#22 C:\Inetpub\vhosts\camec.com\httpdocs\shop\app\code\core\Mage\Core\Model\App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#23 C:\Inetpub\vhosts\camec.com\httpdocs\shop\app\Mage.php(683): Mage_Core_Model_App->run(Array)
#24 C:\Inetpub\vhosts\camec.com\httpdocs\shop\index.php(87): Mage::run('', 'store')
#25 {main}
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top