XF 1.3 Import from vb3 problem (Mysqli statement execute error : Duplicate entry)

AndreaDB

Member
Hello everyone,
the import from VB3 to xF1.3.5 (virgin installation) crashes when I importing attachments.
This is the server error log. I analyzed the database, but I have not found problems.
How can I fix it?
Thanks

Code:
Error Info

Zend_Db_Statement_Mysqli_Exception: Mysqli statement execute error : Duplicate entry '752' for key 'PRIMARY' - library/Zend/Db/Statement/Mysqli.php:214
Generated By: admin, 3 minutes ago
Stack Trace
#0 /var/www/clients/client1/web1/web/xf/library/Zend/Db/Statement.php(297): Zend_Db_Statement_Mysqli->_execute(Array)
#1 /var/www/clients/client1/web1/web/xf/library/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#2 /var/www/clients/client1/web1/web/xf/library/Zend/Db/Adapter/Abstract.php(574): Zend_Db_Adapter_Abstract->query('INSERT INTO `xf...', Array)
#3 /var/www/clients/client1/web1/web/xf/library/XenForo/DataWriter.php(1624): Zend_Db_Adapter_Abstract->insert('xf_attachment', Array)
#4 /var/www/clients/client1/web1/web/xf/library/XenForo/DataWriter.php(1613): XenForo_DataWriter->_insert()
#5 /var/www/clients/client1/web1/web/xf/library/XenForo/DataWriter.php(1405): XenForo_DataWriter->_save()
#6 /var/www/clients/client1/web1/web/xf/library/XenForo/Model/Import.php(1890): XenForo_DataWriter->save()
#7 /var/www/clients/client1/web1/web/xf/library/XenForo/Model/Import.php(1936): XenForo_Model_Import->importAttachment(752, 'p1010017_221.jp...', '/var/www/client...', '15', 'post', '21963', 1194007210, Array, Array, 'e ancora....???...')
#8 /var/www/clients/client1/web1/web/xf/library/XenForo/Importer/vBulletin.php(3043): XenForo_Model_Import->importPostAttachment(752, 'p1010017_221.jp...', '/var/www/client...', '15', '21963', 1194007210, Array, Array, 'e ancora....???...')
#9 /var/www/clients/client1/web1/web/xf/library/XenForo/Importer/Abstract.php(97): XenForo_Importer_vBulletin->stepAttachments(751, Array)
#10 /var/www/clients/client1/web1/web/xf/library/XenForo/ControllerAdmin/Import.php(187): XenForo_Importer_Abstract->runStep(Object(Waindigo_ImportTools_Extend_XenForo_ControllerAdmin_Import), Object(XenForo_ImportSession), 'attachments', 751, Array)
#11 /var/www/clients/client1/web1/web/xf/library/XenForo/ControllerAdmin/Import.php(135): XenForo_ControllerAdmin_Import->_runStep(Object(XenForo_Importer_vBulletin), Object(XenForo_ImportSession), 'attachments', 751, Array)
#12 /var/www/clients/client1/web1/web/xf/library/Waindigo/ImportTools/Extend/XenForo/ControllerAdmin/Import.php(16): XenForo_ControllerAdmin_Import->actionImport()
#13 /var/www/clients/client1/web1/web/xf/library/XenForo/FrontController.php(347): Waindigo_ImportTools_Extend_XenForo_ControllerAdmin_Import->actionImport()
#14 /var/www/clients/client1/web1/web/xf/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#15 /var/www/clients/client1/web1/web/xf/admin.php(13): XenForo_FrontController->run()
#16 {main}


Request State

array(3) {
  ["url"] => string(57) "***/admin.php?import/import"
  ["_GET"] => array(1) {
    ["import/import"] => string(0) ""
  }
  ["_POST"] => array(1) {
    ["_xfToken"] => string(8) "********"
  }
}
 
This may indicate that the previous request failed and that there was an automatic re-submit or something similar. Assuming your XF is empty, there's no way this conflict should happen in normal circumstances.

Unfortunately, it can be a pain to workaround. You need to go into phpMyAdmin and go into the xf_attachment table. Look for any rows with an attachment_id of 752 or higher and remove them. Then refresh the import page. If it errors again, check if it's a lower number than 752. If so, go into the table and remove rows with attachment_id values of that number or higher and try again -- it should make it past then.
 
Thanks Mike,
but always appears the exact same error (same ID) when I delete the records and I refresh the import page.

There is an alternative solution?
 
Last edited:
That's a bit strange. Can you try with a different browser just in case? I've seen something like that happen once before and I couldn't reproduce it; it's possible there's a browser extension or quirk involved. (If you login and go to the import page, you can tell it to continue.)
 
I've tried using different browsers but there is always the same error.
During the import of attachments out error 500 Internal Server Error.

If I can not import the attachments I can not use XenForo.
Can you help me? I can give you the login information if you need.
 
If you're getting a 500 internal server error, that's the fundamental problem and is the cause of this error here (as it's erroring out when you refresh). Looking in your web server error log may give some more details. It's likely some sort of limit imposed on your server (time, memory, etc).

If you submit a ticket with ACP and FTP access details I can have a look.
 
Back
Top Bottom