MG 2.2 XFMG MySQL query error [1062]: Duplicate entry

chrisf

Member
Ran in an error today and I wanted to get folks opinion on it. In searching on this for past incidents it seems related to various plug-ins having the bug. This one looks like its related to MG while a user was adding a picture to the gallery. Any thoughts on where I should go with this one? So far its the first one we have had since we upgraded to XF2.2/MG2.2 from XF1.5 about 6 days ago. Thanks!!

----------

Server error log

XF\Db\DuplicateKeyException: MySQL query error [1062]: Duplicate entry '735c371fb5f807b1fbbfc010bdc1cadf' for key 'media_hash' src/XF/Db/AbstractStatement.php:228

Generated by: Rick Wilk Mar 19, 2021 at 12:29 PM

Stack trace

INSERT INTO xf_mg_media_item (media_hash, media_type, user_id, username, category_id, media_state, title, description, media_date, exif_data, rating_weighted, rating_avg, media_id, last_edit_date, album_id, ip_id, view_count, watermarked, custom_fields, warning_id, warning_message, position, imported, thumbnail_date, custom_thumbnail_date, poster_date, tags, last_comment_date, last_comment_id, last_comment_user_id, last_comment_username, rating_count, rating_sum, reaction_score, reactions, reaction_users) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
------------

#0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL query err...', 1062, '23000')
#1 src/XF/Db/Mysqli/Statement.php(77): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1062, '23000')
#2 src/XF/Db/AbstractAdapter.php(94): XF\Db\Mysqli\Statement->execute()
#3 src/XF/Db/AbstractAdapter.php(218): XF\Db\AbstractAdapter->query('INSERT INTO `x...', Array)
#4 src/XF/Mvc/Entity/Entity.php(1510): XF\Db\AbstractAdapter->insert('xf_mg_media_ite...', Array, false)
#5 src/XF/Mvc/Entity/Entity.php(1242): XF\Mvc\Entity\Entity->_saveToSource()
#6 src/addons/XFMG/Service/Media/Creator.php(233): XF\Mvc\Entity\Entity->save()
#7 src/XF/Service/ValidateAndSavableTrait.php(40): XFMG\Service\Media\Creator->_save()
#8 src/addons/XFMG/Pub/Controller/Media.php(882): XFMG\Service\Media\Creator->save()
#9 src/XF/Mvc/Dispatcher.php(350): XFMG\Pub\Controller\Media->actionSaveMedia(Object(XF\Mvc\ParameterBag))
#10 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('XFMG:Media', 'SaveMedia', Object(XF\Mvc\RouteMatch), Object(XFMG\Pub\Controller\Media), NULL)
#11 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(XFMG\Pub\Controller\Media), NULL)
#12 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#13 src/XF/App.php(2326): XF\Mvc\Dispatcher->run()
#14 src/XF.php(488): XF\App->run()
#15 index.php(20): XF::runApp('XF\\Pub\\App')
#16 {main}

array(4) {
["url"] => string(37) "/community/index.php?media/save-media"
["referrer"] => string(82) "https://aawforum.org/community/index.php?media/categories/member-galleries.500/add"
["_GET"] => array(1) {
["media/save-media"] => string(0) ""
}
["_POST"] => array(8) {
["attachment_hash"] => string(32) "9c791a68fedebd9791fd442012009b45"
["attachment_hash_combined"] => string(93) "{"type":"xfmg_media","context":{"category_id":500},"hash":"9c791a68fedebd9791fd442012009b45"}"
["media"] => array(1) {
[12] => array(7) {
["title"] => string(24) "Cypress bowl with inlays"
["description"] => string(58) "Resin inlays into Cypress bowl, about 8 inches diameter. "
["tags"] => string(0) ""
["temp_media_id"] => string(2) "12"
["media_hash"] => string(32) "735c371fb5f807b1fbbfc010bdc1cadf"
["media_type"] => string(5) "image"
["attachment_id"] => string(5) "37789"
}
}
["category_id"] => string(3) "500"
["_xfToken"] => string(8) "********"
["_xfRequestUri"] => string(62) "/community/index.php?media/categories/member-galleries.500/add"
["_xfWithData"] => string(1) "1"
["_xfResponseType"] => string(4) "json"
}
}
 
Top