• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

MG 1.1 Importing from PhotoPost Error

#1
I received this error and its halted my import. Any ideas on how to clear this and continue?

Server Error

Mysqli statement execute error : Duplicate entry '5391' for key 'PRIMARY'

  1. Zend_Db_Statement_Mysqli->_execute() inZend/Db/Statement.php at line 297
  2. Zend_Db_Statement->execute() inZend/Db/Adapter/Abstract.php at line 479
  3. Zend_Db_Adapter_Abstract->query() inZend/Db/Adapter/Abstract.php at line 574
  4. Zend_Db_Adapter_Abstract->insert() inXenForo/DataWriter.php at line 1624
  5. XenForo_DataWriter->_insert() in XenForo/DataWriter.php at line 1613
  6. XenForo_DataWriter->_save() in XenForo/DataWriter.php at line 1405
  7. XenForo_DataWriter->save() inXenGallery/Model/Importers.php at line 167
  8. XenGallery_Model_Importers->importMedia() inXenGallery/Importer/PhotopostVb.php at line 743
  9. XenGallery_Importer_PhotopostVb->_importMedia() inXenGallery/Importer/PhotopostVb.php at line 620
  10. XenGallery_Importer_PhotopostVb->stepMedia() inXenForo/Importer/Abstract.php at line 97
  11. XenForo_Importer_Abstract->runStep() inXenForo/ControllerAdmin/Import.php at line 187
  12. XenForo_ControllerAdmin_Import->_runStep() inXenForo/ControllerAdmin/Import.php at line 135
  13. XenForo_ControllerAdmin_Import->actionImport() inXenForo/FrontController.php at line 351
  14. XenForo_FrontController->dispatch() inXenForo/FrontController.php at line 134
  15. XenForo_FrontController->run() in/home/jshallo/public_html/forums/admin.php at line 13
 

Chris D

XenForo developer
Staff member
#2
Aside from this error, are there any other errors in the Server Error Log in the Admin CP > Tools > Server Error Log?
 
#3
I see three of them:

Server Error Log
Error Info
Zend_Db_Statement_Mysqli_Exception: Mysqli statement execute error : Duplicate entry '5391' for key 'PRIMARY' - library/Zend/Db/Statement/Mysqli.php:214
Generated By: John Shallo, 47 minutes ago
Stack Trace
#0 /home/jshallo/public_html/forums/library/Zend/Db/Statement.php(297): Zend_Db_Statement_Mysqli->_execute(Array)
#1 /home/jshallo/public_html/forums/library/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#2 /home/jshallo/public_html/forums/library/Zend/Db/Adapter/Abstract.php(574): Zend_Db_Adapter_Abstract->query('INSERT INTO `xe...', Array)
#3 /home/jshallo/public_html/forums/library/XenForo/DataWriter.php(1624): Zend_Db_Adapter_Abstract->insert('xengallery_medi...', Array)
#4 /home/jshallo/public_html/forums/library/XenForo/DataWriter.php(1613): XenForo_DataWriter->_insert()
#5 /home/jshallo/public_html/forums/library/XenForo/DataWriter.php(1405): XenForo_DataWriter->_save()
#6 /home/jshallo/public_html/forums/library/XenGallery/Model/Importers.php(167): XenForo_DataWriter->save()
#7 /home/jshallo/public_html/forums/library/XenGallery/Importer/PhotopostVb.php(743): XenGallery_Model_Importers->importMedia(5391, '/home/jshallo/p...', '', Array, Array, Array)
#8 /home/jshallo/public_html/forums/library/XenGallery/Importer/PhotopostVb.php(620): XenGallery_Importer_PhotopostVb->_importMedia(Array, Array)
#9 /home/jshallo/public_html/forums/library/XenForo/Importer/Abstract.php(97): XenGallery_Importer_PhotopostVb->stepMedia(5390, Array)
#10 /home/jshallo/public_html/forums/library/XenForo/ControllerAdmin/Import.php(187): XenForo_Importer_Abstract->runStep(Object(XenForo_ControllerAdmin_Import), Object(XenForo_ImportSession), 'media', 5390, Array)
#11 /home/jshallo/public_html/forums/library/XenForo/ControllerAdmin/Import.php(135): XenForo_ControllerAdmin_Import->_runStep(Object(XenGallery_Importer_PhotopostVb), Object(XenForo_ImportSession), 'media', 5390, Array)
#12 /home/jshallo/public_html/forums/library/XenForo/FrontController.php(351): XenForo_ControllerAdmin_Import->actionImport()
#13 /home/jshallo/public_html/forums/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#14 /home/jshallo/public_html/forums/admin.php(13): XenForo_FrontController->run()
#15 {main}
Request State
array(3) {
["url"] => string(60) "http://www.cruise-addicts.com/forums/admin.php?import/import"
["_GET"] => array(1) {
["import/import"] => string(0) ""
}
["_POST"] => array(1) {
["_xfToken"] => string(8) "********"
}
}
 
#4
Error Info
Zend_Db_Statement_Mysqli_Exception: Mysqli statement execute error : Duplicate entry '5391' for key 'PRIMARY' - library/Zend/Db/Statement/Mysqli.php:214
Generated By: John Shallo, 34 minutes ago
Stack Trace
#0 /home/jshallo/public_html/forums/library/Zend/Db/Statement.php(297): Zend_Db_Statement_Mysqli->_execute(Array)
#1 /home/jshallo/public_html/forums/library/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#2 /home/jshallo/public_html/forums/library/Zend/Db/Adapter/Abstract.php(574): Zend_Db_Adapter_Abstract->query('INSERT INTO `xe...', Array)
#3 /home/jshallo/public_html/forums/library/XenForo/DataWriter.php(1624): Zend_Db_Adapter_Abstract->insert('xengallery_medi...', Array)
#4 /home/jshallo/public_html/forums/library/XenForo/DataWriter.php(1613): XenForo_DataWriter->_insert()
#5 /home/jshallo/public_html/forums/library/XenForo/DataWriter.php(1405): XenForo_DataWriter->_save()
#6 /home/jshallo/public_html/forums/library/XenGallery/Model/Importers.php(167): XenForo_DataWriter->save()
#7 /home/jshallo/public_html/forums/library/XenGallery/Importer/PhotopostVb.php(743): XenGallery_Model_Importers->importMedia(5391, '/home/jshallo/p...', '', Array, Array, Array)
#8 /home/jshallo/public_html/forums/library/XenGallery/Importer/PhotopostVb.php(620): XenGallery_Importer_PhotopostVb->_importMedia(Array, Array)
#9 /home/jshallo/public_html/forums/library/XenForo/Importer/Abstract.php(97): XenGallery_Importer_PhotopostVb->stepMedia(5390, Array)
#10 /home/jshallo/public_html/forums/library/XenForo/ControllerAdmin/Import.php(187): XenForo_Importer_Abstract->runStep(Object(XenForo_ControllerAdmin_Import), Object(XenForo_ImportSession), 'media', 5390, Array)
#11 /home/jshallo/public_html/forums/library/XenForo/ControllerAdmin/Import.php(135): XenForo_ControllerAdmin_Import->_runStep(Object(XenGallery_Importer_PhotopostVb), Object(XenForo_ImportSession), 'media', 5390, Array)
#12 /home/jshallo/public_html/forums/library/XenForo/FrontController.php(351): XenForo_ControllerAdmin_Import->actionImport()
#13 /home/jshallo/public_html/forums/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#14 /home/jshallo/public_html/forums/admin.php(13): XenForo_FrontController->run()
#15 {main}
Request State
array(3) {
["url"] => string(60) "http://www.cruise-addicts.com/forums/admin.php?import/import"
["_GET"] => array(1) {
["import/import"] => string(0) ""
}
["_POST"] => array(2) {
["_xfToken"] => string(8) "********"
["redirect"] => string(54) "http://www.cruise-addicts.com/forums/admin.php?import/"
}
}
 
#5
They look to be three of the same error. I may have had some earlier but, this is the only ones causing problems. One major factor was i started and then got an error. I then deleted the XMG db tables, uninstalled and reinstalled the add-on. Restarted the import and the got a 'mysql' duplicate entry error while importing categories. It was due to the 'example' category. I deleted it and restarted until this issue.

I am importing photopost from vb4.
 

Chris D

XenForo developer
Staff member
#6
If you delete from the xengallery_media table the rows that have a media_id greater than or equal to 5390, and then refresh the page, does it continue?
 
#9
Oh crap... I just got similar at 96% complete
Mysqli statement execute error : Duplicate entry '24030' for key 'PRIMARY'

Please tell me I don't have to delete anything in the db right now I am so close.
 

Chris D

XenForo developer
Staff member
#10
Can you post the full stack trace and error message?

If it's not on screen now, go to your Admin CP in another tab, Tools > Server Error Log.

Also let me know if there are any other errors in there.
 
#11
Can you post the full stack trace and error message?

If it's not on screen now, go to your Admin CP in another tab, Tools > Server Error Log.

Also let me know if there are any other errors in there.
Mysqli statement execute error : Duplicate entry '24030' for key 'PRIMARY'

  1. Zend_Db_Statement_Mysqli->_execute() in Zend/Db/Statement.php at line 297
  2. Zend_Db_Statement->execute() in Zend/Db/Adapter/Abstract.php at line 479
  3. Zend_Db_Adapter_Abstract->query() in Zend/Db/Adapter/Abstract.php at line 574
  4. Zend_Db_Adapter_Abstract->insert() in XenForo/DataWriter.php at line 1624
  5. XenForo_DataWriter->_insert() in XenForo/DataWriter.php at line 1613
  6. XenForo_DataWriter->_save() in XenForo/DataWriter.php at line 1405
  7. XenForo_DataWriter->save() in XenGallery/Model/Importers.php at line 167
  8. XenGallery_Model_Importers->importMedia() in XenGallery/Importer/PhotopostVb.php at line 743
  9. XenGallery_Importer_PhotopostVb->_importMedia() in XenGallery/Importer/PhotopostVb.php at line 620
  10. XenGallery_Importer_PhotopostVb->stepMedia() in XenForo/Importer/Abstract.php at line 97
  11. XenForo_Importer_Abstract->runStep() in XenForo/ControllerAdmin/Import.php at line 187
  12. XenForo_ControllerAdmin_Import->_runStep() in XenForo/ControllerAdmin/Import.php at line 135
  13. XenForo_ControllerAdmin_Import->actionImport() in XenForo/FrontController.php at line 351
  14. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
  15. XenForo_FrontController->run() in /home/blazer90/mysite.com/forums/admin.php at line 13
 

Chris D

XenForo developer
Staff member
#13
Delete any items from the xengallery_media table that have a media_id greater than or equal to 24030 then refresh the page it should resume. If you get errors about more duplicate items paste the errors here again. (Even if they look the same).
 
#14
I deleted 3 files that were bigger that 24030 then got a "Please enter a positive whole number." error then

Zend_Db_Statement_Mysqli_Exception: Mysqli statement execute error : Duplicate entry '24030' for key 'PRIMARY' - library/Zend/Db/Statement/Mysqli.php:214
Generated By: coloradok5, 1 minute ago
Stack Trace
#0 /home/blazer90/mysite.com/forums/library/Zend/Db/Statement.php(297): Zend_Db_Statement_Mysqli->_execute(Array)
#1 /home/blazer90/mysite.com/forums/library/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#2 /home/blazer90/mysite.com/forums/library/Zend/Db/Adapter/Abstract.php(574): Zend_Db_Adapter_Abstract->query('INSERT INTO `xe...', Array)
#3 /home/blazer90/mysite.com/forums/library/XenForo/DataWriter.php(1624): Zend_Db_Adapter_Abstract->insert('xengallery_medi...', Array)
#4 /home/blazer90/mysite.com/forums/library/XenForo/DataWriter.php(1613): XenForo_DataWriter->_insert()
#5 /home/blazer90/mysite.com/forums/library/XenForo/DataWriter.php(1405): XenForo_DataWriter->_save()
#6 /home/blazer90/mysite.com/forums/library/XenGallery/Model/Importers.php(167): XenForo_DataWriter->save()
#7 /home/blazer90/mysite.com/forums/library/XenGallery/Importer/PhotopostVb.php(743): XenGallery_Model_Importers->importMedia(24030, '/home/blazer90/...', '', Array, Array, Array)
#8 /home/blazer90/mysite.com/forums/library/XenGallery/Importer/PhotopostVb.php(620): XenGallery_Importer_PhotopostVb->_importMedia(Array, Array)
#9 /home/blazer90/mysite.com/forums/library/XenForo/Importer/Abstract.php(97): XenGallery_Importer_PhotopostVb->stepMedia(24029, Array)
#10 /home/blazer90/mysite.com/forums/library/XenForo/ControllerAdmin/Import.php(187): XenForo_Importer_Abstract->runStep(Object(XenForo_ControllerAdmin_Import), Object(XenForo_ImportSession), 'media', 24029, Array)
#11 /home/blazer90/mysite.com/forums/library/XenForo/ControllerAdmin/Import.php(135): XenForo_ControllerAdmin_Import->_runStep(Object(XenGallery_Importer_PhotopostVb), Object(XenForo_ImportSession), 'media', 24029, Array)
#12 /home/blazer90/mysite.com/forums/library/XenForo/FrontController.php(351): XenForo_ControllerAdmin_Import->actionImport()
#13 /home/blazer90/mysite.com/forums/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#14 /home/blazer90/mysite.com/forums/admin.php(13): XenForo_FrontController->run()
#15 {main}
Request State
array(3) {
["url"] => string(45) "http://mysite.com/forums/admin.php?import/import"
["_GET"] => array(1) {
["import/import"] => string(0) ""
}
["_POST"] => array(1) {
["_xfToken"] => string(8) "********"
}
}
 

Chris D

XenForo developer
Staff member
#15
We may need to have a closer look. Could you submit a ticket from your customer area with admin CP and FTP login details?

I'm not around today but if it's urgent someone else might be able to pick it up.