What's new
Xen Factory

Register today to become a member! Once signed in, you'll be able to start purchasing our products, ask questions, request support and suggest new ideas!

  • This area is dedicated to the support of our xF1 add-ons. For xF2, please use the dedicated area: HERE.
  • We are aware that a no permission error was shown when you tried to purchase in the last 2 days, this is now fixed.

Bug MOTM 3.6 server error

Nik

Member
So my MOTM has been mostly running ok for a few months. This morning in mode 2 I this error. The member was not promoted to a special group though the media did show up as awarded in XFMG. Also the MOTM thread wasn't updated.

Code:
Zend_Db_Statement_Mysqli_Exception: Mysqli statement execute error : Duplicate entry '40' for key 'PRIMARY' - library/Zend/Db/Statement/Mysqli.php:214
Generated By: Unknown Account, Today at 1:01 AM
Stack Trace
#0 /var/www/canadiancorvetteforums.com/htdocs/library/Zend/Db/Statement.php(297): Zend_Db_Statement_Mysqli->_execute(Array)
#1 /var/www/canadiancorvetteforums.com/htdocs/library/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#2 /var/www/canadiancorvetteforums.com/htdocs/library/Zend/Db/Adapter/Abstract.php(574): Zend_Db_Adapter_Abstract->query('INSERT INTO `xf...', Array)
#3 /var/www/canadiancorvetteforums.com/htdocs/library/XenForo/Model/UserUpgrade.php(532): Zend_Db_Adapter_Abstract->insert('xf_user_upgrade...', Array)
#4 /var/www/canadiancorvetteforums.com/htdocs/library/XFA/XFMGMediaOfTheMonth/Model/Motm.php(1172): XenForo_Model_UserUpgrade->upgradeUser(2825, Array, true)
#5 /var/www/canadiancorvetteforums.com/htdocs/library/XFA/XFMGMediaOfTheMonth/CronEntry/XFMGMediaOfTheMonth.php(130): XFA_XFMGMediaOfTheMonth_Model_Motm->findAndAwardWinnerMode2(Array)
#6 /var/www/canadiancorvetteforums.com/htdocs/library/XFA/XFMGMediaOfTheMonth/CronEntry/XFMGMediaOfTheMonth.php(21): XFA_XFMGMediaOfTheMonth_CronEntry_XFMGMediaOfTheMonth::cronMode2()
#7 /var/www/canadiancorvetteforums.com/htdocs/library/XenForo/Model/Cron.php(356): XFA_XFMGMediaOfTheMonth_CronEntry_XFMGMediaOfTheMonth::cron(Array)
#8 /var/www/canadiancorvetteforums.com/htdocs/library/XenForo/Deferred/Cron.php(24): XenForo_Model_Cron->runEntry(Array)
#9 /var/www/canadiancorvetteforums.com/htdocs/library/XenForo/Model/Deferred.php(295): XenForo_Deferred_Cron->execute(Array, Array, 7.9999988079071, '')
#10 /var/www/canadiancorvetteforums.com/htdocs/library/XenForo/Model/Deferred.php(429): XenForo_Model_Deferred->runDeferred(Array, 7.9999988079071, '', false)
#11 /var/www/canadiancorvetteforums.com/htdocs/library/XenForo/Model/Deferred.php(374): XenForo_Model_Deferred->_runInternal(Array, 8, '', false)
#12 /var/www/canadiancorvetteforums.com/htdocs/deferred.php(23): XenForo_Model_Deferred->run(false)
#13 {main}
Request State
array(3) {
  ["url"] => string(47) "https://canadiancorvetteforums.com/deferred.php"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(3) {
   ["_xfRequestUri"] => string(91) "/threads/accident-arctic-white-corvette-z06-crash-lands-on-west-virginia-front-porch.17255/"
   ["_xfNoRedirect"] => string(1) "1"
   ["_xfResponseType"] => string(4) "json"
  }
}

@MtoR @Fredxd
 
Last edited:

Clement

Freaky Coder
Staff member
Hi,

The fact that the thread wasn't updated seems logical as the process most certainly failed in the middle.

Was this user already an awarded one ?

Clément
 

Nik

Member
Hi,

The fact that the thread wasn't updated seems logical as the process most certainly failed in the middle.

Was this user already an awarded one ?

Clément

Not recently awarded. Is there query I can run to find previous users with awards?

Anyway most certainly an issue. How can I recover this and make sure it doesn't happen in future ?
 

Clement

Freaky Coder
Staff member
It's not a question of recently but have they ever been ?
Not sure, I think you should see it on the membercard, there is a win counter.

Or you can check in the db in the xf_user_upgrade table, search for user_id 2825 and make an export of the data for me.

Recovering will be complicated but I may guide through a manual path to at least ensure the number of victories and the award is correct.
Avoiding it in the future is what I am trying to do through the questions.
 

Nik

Member
It's not a question of recently but have they ever been ?
Not sure, I think you should see it on the membercard, there is a win counter.

Or you can check in the db in the xf_user_upgrade table, search for user_id 2825 and make an export of the data for me.

Recovering will be complicated but I may guide through a manual path to at least ensure the number of victories and the award is correct.
Avoiding it in the future is what I am trying to do through the questions.

I think you're getting your tables mixed up. There's no relevant user data in xf_user_upgrade, just my 4 active payment type upgrades. Also there's no member card feature for this addon that shows if it was ever awarded.


This is the relevant row from xf_user_upgrade but there's no user data. The upgrade is inactive but has always been that way.

Code:
3    MOTM Winner Upgrade    MOTM Winner Upgrade    1    {binary}    0    1.00    cad    1    month    {binary}    0

I think you are asking for xf_user_upgrade_expired, which has this:

Code:
1 2168 3 {binary} 1440461440 1443149446 1443139840
2 2805 3 {binary} 1443139447 1445741478 1445731448
3 43 3 {binary} 1445817675 1448506246 1448496075
4 401 3 {binary} 1448496209 1451098274 1451088210
6 1852 3 {binary} 1451260915 1453949460 1453939316
7 2217 3 {binary} 1453852905 1456541493 1456531306
8 1 1 {binary} 1457837314 1457837521 0
9 1634 2 {binary} 1457837901 1457838047 0
10 2986 3 {binary} 1459296179 1461984664 1461974579
11 1852 3 {binary} 1462147329 1464835912 1464825729
12 2217 3 {binary} 1462147329 1464835912 1464825729
13 2 3 {binary} 1462147329 1464835912 1464825729
14 2895 3 {binary} 1464566500 1467255066 1467244900
15 401 3 {binary} 1464566500 1467255066 1467244901
17 2168 3 {binary} 1469059474 1471762364 1471737875
18 1046 3 {binary} 1470009730 1472712812 1472688130
19 858 3 {binary} 1470009730 1472712812 1472688130
21 43 3 {binary} 1472706099 1475322715 1475298099
23 2217 3 {binary} 1475298112 1480593183 1480568513
24 3043 3 {binary} 1477958489 1480575905 1480550489
25 2168 3 {binary} 1477958489 1480575905 1480550489
26 2292 3 {binary} 1480601980 1485982394 1485958780
27 3305 3 {binary} 1483228922 1485932076 1485907323
28 2557 3 {binary} 1485929487 1488372664 1488348688
29 1067 3 {binary} 1488348129 1491051033 1491026531
30 2012 3 {binary} 1491026518 1493643125 1493618520
31 3103 3 {binary} 1496296890 1498913496 1498888891
32 915 3 {binary} 1498889303 1501591859 1501567703
33 3504 3 {binary} 1498889303 1501591859 1501567705
34 3452 3 {binary} 1498889303 1501591859 1501567707
35 3537 3 {binary} 1501567409 1504270261 1504245809
36 3452 3 {binary} 1504245713 1506862208 1506837713
37 3252 3 {binary} 1506837925 1509540640 1509516327
38 915 3 {binary} 1506837925 1512132607 1512108328
39 2024 3 {binary} 1506837925 1509540640 1509516329
40 3252 3 {binary} 1512108268 1514811118 1514786669

Type (user_upgrade_id) 3 is my MOTM upgrade. There's no sign of user 2825 in there.
 
Last edited:

Nik

Member
Yeah I mixed up, what about the xf_user_upgrade_active table ?

Nothing interesting I think:

Code:
5    1046    4    {binary}    1449093804    0
16    3043    1    {binary}    1467546786    0
20    2292    4    {binary}    1471017918    0
22    1458    4    {binary}    1472840909    0
 

Clement

Freaky Coder
Staff member
Hum in fact no, I'll have to dig further, will do on friday when back from holidays.
 

Clement

Freaky Coder
Staff member
Hi,

I dug further in the code.

I think the issue is not coming from MOTM itself.
It seems there is an issue with the upgrade table in the database.

Can you look what is the max value of the user_upgrade_id column of the xf_user_upgrade table as well as the "Next autoindex" value.

Clément
 

Nik

Member
Hi,

I dug further in the code.

I think the issue is not coming from MOTM itself.
It seems there is an issue with the upgrade table in the database.

Can you look what is the max value of the user_upgrade_id column of the xf_user_upgrade table as well as the "Next autoindex" value.

Clément

Sorry for the delay, for some reason not getting email notifications from here. I've since uninstalled the MOTM addon and will be upgrading to XF2 shortly.

It's a great addon and hope you guys can migrate it to XF2 at some point soon, I have plenty of suggestions on improvements.
 
Top