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

Server error upgrade account

Discussion in 'Troubleshooting and Problems' started by tommydamic68, Sep 22, 2015.

  1. tommydamic68

    tommydamic68 Well-Known Member

    I had a member upgrade their account and utilize Paypal and received this error, not sure if its a bug, I have never seen it before though.

    Code:
    Zend_Db_Statement_Mysqli_Exception: Mysqli statement execute error : Duplicate entry '2' for key 'PRIMARY' - library/Zend/Db/Statement/Mysqli.php:214
    Generated By: Unknown Account, Today at 4:45 PM
    Stack Trace
    #0 /home/admin/public_html/community/library/Zend/Db/Statement.php(297): Zend_Db_Statement_Mysqli->_execute(Array)
    #1 /home/admin/public_html/community/library/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
    #2 /home/admin/public_html/community/library/Zend/Db/Adapter/Abstract.php(574): Zend_Db_Adapter_Abstract->query('INSERT INTO `xf...', Array)
    #3 /home/admin/public_html/community/library/XenForo/Model/UserUpgrade.php(533): Zend_Db_Adapter_Abstract->insert('xf_user_upgrade...', Array)
    #4 /home/admin/public_html/community/library/XenForo/UserUpgradeProcessor/PayPal.php(297): XenForo_Model_UserUpgrade->upgradeUser(10753, Array, false)
    #5 /home/admin/public_html/community/payment_callback.php(37): XenForo_UserUpgradeProcessor_PayPal->processTransaction()
    #6 {main}
    Request State
    array(3) {
      ["url"] => string(53) "http://sphynxlair.com/community//payment_callback.php"
      ["_GET"] => array(0) {
      }
      ["_POST"] => array(33) {
        ["mc_gross"] => string(5) "25.00"
        ["protection_eligibility"] => string(10) "Ineligible"
        ["payer_id"] => string(13) "KM6NFSY2A"
        ["tax"] => string(4) "0.00"
        ["payment_date"] => string(25) "13:44:46 Sep 21, 2015 PDT"
        ["payment_status"] => string(9) "Completed"
        ["charset"] => string(12) "windows-1252"
        ["first_name"] => string(10) "Jacqyne"
        ["mc_fee"] => string(4) "1.03"
        ["notify_version"] => string(3) "3.8"
        ["custom"] => string(71) "10753,1,token,10753,14e444cb8"
        ["payer_status"] => string(8) "verified"
        ["business"] => string(22) "@yahoo.com"
        ["quantity"] => string(1) "1"
        ["verify_sign"] => string(56) "AKzaBp7FOkG.-3hfPY.uHM"
        ["payer_email"] => string(28) "@aol.com"
        ["txn_id"] => string(17) "29"
        ["payment_type"] => string(7) "instant"
        ["payer_business_name"] => string(27) "OrgC"
        ["last_name"] => string(7) "Carlson"
        ["receiver_email"] => string(22) "@yahoo.com"
        ["payment_fee"] => string(4) "1.03"
        ["receiver_id"] => string(13) "DA9NP8"
        ["txn_type"] => string(10) "web_accept"
        ["item_name"] => string(41) "Account Upgrade: Advertisement (erJa3)"
        ["mc_currency"] => string(3) "USD"
        ["item_number"] => string(0) ""
        ["residence_country"] => string(2) "US"
        ["handling_amount"] => string(4) "0.00"
        ["transaction_subject"] => string(71) "10753,1,token44cb8"
        ["payment_gross"] => string(5) "25.00"
        ["shipping"] => string(4) "0.00"
        ["ipn_track_id"] => string(13) "bb5c3"
      }
    }
    
     
  2. Mike

    Mike XenForo Developer Staff Member

    It looks to me like you have a corrupted table definition. This would only happen due to an add-on or a failed backup and restore. Can you show the full output from the following query?
    Code:
    SHOW CREATE TABLE xf_user_upgrade_active;
     
  3. tommydamic68

    tommydamic68 Well-Known Member

    Where would I find that Mike?
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    Use phpMyAdmin to run the query.
     
  5. tommydamic68

    tommydamic68 Well-Known Member

    Ok, as soon as I figure out how to do so.
     
  6. Tracy Perry

    Tracy Perry Well-Known Member

    It's easy.. just copy the string given, go to your hosting account phpmyadmin page, choose the SQL tab (after selecting the correct DB)
    Screen-Shot-2015-09-22-at-9.46.17-AM.jpg

    Then once you choose that, paste the text into the box
    Screen-Shot-2015-09-22-at-9.46.26-AM.jpg
     
  7. imthebest

    imthebest Formerly Super120

    You can also run the query by the terminal (SSH). Login to your server, then login to mysql, choose your DB and run the query!
     
  8. Tracy Perry

    Tracy Perry Well-Known Member

    Pretty sure if he's not comfortable/knows how to use PhpMyAdmin to run the query, instructing him to log into mysql as the user/root and running the query from the CLI would be even more uncomfortable for him. :whistle:
     
  9. tommydamic68

    tommydamic68 Well-Known Member

    Not sure if I did it right, here is what get.

    Screen Shot 2015-09-22 at 9.40.07 PM.png
     
  10. imthebest

    imthebest Formerly Super120

    You have to run the query provided by Mike:

    "SHOW CREATE TABLE xf_user_upgrade_active;"

    Copy/paste it without the quotes and with the ; at the end and run it.
     
  11. tommydamic68

    tommydamic68 Well-Known Member

    Ok - it says successful, now what do I do wit it?

    Screen Shot 2015-09-23 at 5.17.55 AM.png
     
  12. Brogan

    Brogan XenForo Moderator Staff Member

    Click on + Options and select 'Full texts'.

    Then paste the output here in code tags.
     
  13. tommydamic68

    tommydamic68 Well-Known Member

    Here is what I have:

    Code:
    CREATE TABLE `xf_user_upgrade_active` (
    `user_upgrade_record_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `user_id` int(10) unsigned NOT NULL,
    `user_upgrade_id` int(10) unsigned NOT NULL,
    `extra` mediumblob NOT NULL,
    `start_date` int(10) unsigned NOT NULL,
    `end_date` int(10) unsigned NOT NULL DEFAULT '0',
    PRIMARY KEY (`user_upgrade_record_id`),
    UNIQUE KEY `user_id_upgrade_id` (`user_id`,`user_upgrade_id`),
    KEY `end_date` (`end_date`),
    KEY `start_date` (`start_date`)
    ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8
    Not sure if it matters, originally she was signed up for an "automatic" upgrade and I removed that option so they just pay monthly on their own as apposed to it being taken from their Paypal account automatically.
     
  14. Brogan

    Brogan XenForo Moderator Staff Member

    The table looks OK.

    How did you remove the automatic upgrade and convert the subscribers to monthly payments?
     
  15. tommydamic68

    tommydamic68 Well-Known Member

    I just went into a preexisting upgrade and unchecked the recurring payments. Then she went in a paid for the following month without the recurring payment option a few weeks later.

    Screen Shot 2015-09-24 at 9.58.12 PM.png
     
  16. Mike

    Mike XenForo Developer Staff Member

    With that table definition, I don't see how the error is actually possible. MySQL internally is the one setting the primary key value and an important part of the job is choosing a unique value. Try to manually upgrade a user via the user upgrades section of the control panel (in the controls menu on the upgrade list). Did you get an error? You can downgrade the user immediately then (via the active upgrades list).
     

Share This Page