• Register
    • Help

    striker  0 Items
    Currently Supporting
    • Home
    • News
    • Forum
    • Wiki
    • Support
      • Manage Subscriptions
      • FAQ
      • Support For
        • VaultWiki 4.x Series
        • VaultWiki.org Site
    • What's New?
    • Buy Now
    • Manual
    • 
    • Support
    • VaultWiki 4.x Series
    • Bug
    • XF2 upgrade fails

    1. Welcome to VaultWiki.org, home of the wiki add-on for vBulletin and XenForo!

      VaultWiki allows your existing forum users to collaborate on creating and managing a site's content pages. VaultWiki is a fully-featured and fully-supported wiki solution for vBulletin and XenForo.

      The VaultWiki Team encourages you to join our community of forum administrators and check out VaultWiki for yourself.

    Issue: XF2 upgrade fails

    • Issue Tools
      • View Changes
    1. issueid=5995 March 26, 2020 12:22 PM
      Alfa1 Alfa1 is offline
      Distinguished Member
      XF2 upgrade fails

      Server error log
      • XF\Db\DuplicateKeyException: Batch install error: MySQL query error [1062]: Duplicate entry 'vwpage-39' for key 'content_type_content_id'
      • src/XF/Db/AbstractStatement.php:228
      • Generated by: xxx
      • 26 Mar 2020 at 17:19
      Stack trace
      UPDATE `xf_report` SET `content_id` = CASE `report_id`
      WHEN 1 THEN 746
      WHEN 2 THEN 1003
      WHEN 3 THEN 993
      WHEN 4 THEN 724
      WHEN 5 THEN 184
      WHEN 6 THEN 962
      WHEN 7 THEN 1114
      WHEN 8 THEN 1122
      WHEN 9 THEN 1123
      WHEN 10 THEN 1124
      WHEN 11 THEN 1120
      WHEN 12 THEN 1121
      WHEN 13 THEN 1116
      WHEN 14 THEN 1115
      WHEN 15 THEN 1117
      WHEN 16 THEN 1368
      WHEN 17 THEN 606
      WHEN 18 THEN 817
      WHEN 19 THEN 801
      WHEN 20 THEN 1377
      WHEN 21 THEN 1379
      WHEN 22 THEN 825
      WHEN 23 THEN 672
      WHEN 24 THEN 1329
      WHEN 25 THEN 1330
      WHEN 26 THEN 96
      WHEN 27 THEN 39
      WHEN 28 THEN 822
      WHEN 29 THEN 686
      WHEN 30 THEN 227
      WHEN 31 THEN 1060
      WHEN 32 THEN 1059
      WHEN 33 THEN 732
      WHEN 34 THEN 369
      WHEN 35 THEN 1001
      WHEN 36 THEN 482
      WHEN 37 THEN 483
      WHEN 38 THEN 935
      WHEN 39 THEN 371
      WHEN 40 THEN 241
      WHEN 41 THEN 545
      WHEN 42 THEN 319
      WHEN 43 THEN 1349
      WHEN 44 THEN 1056
      WHEN 45 THEN 1008
      WHEN 46 THEN 318
      WHEN 47 THEN 136
      WHEN 48 THEN 109
      WHEN 49 THEN 172
      WHEN 50 THEN 303
      WHEN 51 THEN 304
      WHEN 52 THEN 938
      WHEN 53 THEN 933
      WHEN 54 THEN 937
      WHEN 55 THEN 932
      WHEN 56 THEN 934
      WHEN 57 THEN 188
      WHEN 58 THEN 193
      WHEN 59 THEN 194
      WHEN 60 THEN 197
      WHEN 61 THEN 198
      WHEN 62 THEN 790
      WHEN 63 THEN 835
      WHEN 64 THEN 292
      WHEN 65 THEN 568
      WHEN 66 THEN 1590
      WHEN 67 THEN 1805
      WHEN 68 THEN 1807
      WHEN 69 THEN 1808
      WHEN 70 THEN 1809
      WHEN 71 THEN 1817
      WHEN 72 THEN 1826
      WHEN 73 THEN 1768
      WHEN 74 THEN 1825
      WHEN 75 THEN 1835
      WHEN 76 THEN 1824
      WHEN 77 THEN 1821
      WHEN 78 THEN 2195
      WHEN 79 THEN 1
      END WHERE `report_id` IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22 ,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41 ,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60 ,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79 ) LIMIT 79
      ------------

      #0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL query err...', 1062, '23000')
      #1 src/XF/Db/Mysqli/Statement.php(78): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1062, '23000')
      #2 src/XF/Db/AbstractAdapter.php(94): XF\Db\Mysqli\Statement->execute()
      #3 src/addons/vw/vw/_core/controller/db/xf2.php(117): XF\Db\AbstractAdapter->query('UPDATE `xf_rep...')
      #4 src/addons/vw/vw/_core/model/db/mysql/vw.php(1339): vw_DB_Controller_XF2->query_write('UPDATE `xf_rep...')
      #5 src/addons/vw/vw/_core/model/db/mysql/vw.php(983): vw_DB_MySQL_Model->shutdown_or_run('UPDATE `xf_rep...', false)
      #6 src/addons/vw/vw/_install/lib/upgradepath/steps/4/1/0/alpha/1/C/xf0.php(304): vw_DB_MySQL_Model->update(Array)
      #7 src/addons/vw/vw/Setup.php(300): vw_Install_UpgradePath_Steps_410alpha1_C_Controller_XF0->{closure}(Object(vw\vw\Setup\Caller\Upgrade), false)
      #8 src/addons/vw/vw/Setup.php(967): vw\vw\Setup->vwRunStep('upgrade', Object(vw_Install_UpgradePath_Steps_410alpha1_C_Controlle r_XF2), Array, 70)
      #9 src/XF/Job/AddOnInstallBatch.php(297): vw\vw\Setup->upgrade(Array)
      #10 src/XF/Job/AddOnInstallBatch.php(90): XF\Job\AddOnInstallBatch->stepAction(Object(XF\Timer))
      #11 src/XF/Job/Manager.php(253): XF\Job\AddOnInstallBatch->run(G)
      #12 src/XF/Job/Manager.php(195): XF\Job\Manager->runJobInternal(Array, G)
      #13 src/XF/Job/Manager.php(111): XF\Job\Manager->runJobEntry(Array, G)
      #14 src/XF/Admin/Controller/Tools.php(120): XF\Job\Manager->runByIds(Array, 8)
      #15 src/XF/Mvc/Dispatcher.php(350): XF\Admin\Controller\Tools->actionRunJob(Object(XF\Mvc\ParameterBag))
      #16 src/XF/Mvc/Dispatcher.php(262): XF\Mvc\Dispatcher->dispatchClass('XF:Tools', 'run-job', Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\Tools), NULL)
      #17 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\Tools), NULL)
      #18 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
      #19 src/XF/App.php(2184): XF\Mvc\Dispatcher->run()
      #20 src/XF.php(391): XF\App->run()
      #21 admin.php(13): XF::runApp('XF\\Admin\\App')
      #22 {main}
      Request state
      array(4) {
      ["url"] => string(30) "/admin.php?tools/run-job"
      ["referrer"] => string(49) "admin.php?tools/run-job"
      ["_GET"] => array(1) {
      ["tools/run-job"] => string(0) ""
      }
      ["_POST"] => array(3) {
      ["_xfRedirect"] => string(84) " admin.php?add-ons/install-from-archive-complete&batch_id=6"
      ["_xfToken"] => string(8) "********"
      ["only_ids"] => string(2) "86"
      }
      }
    Issue Details
    Issue Number 5995
    Issue Type Bug
    Project VaultWiki 4.x Series
    Category Install / Upgrade
    Status Fixed
    Priority 2 - Fatal / Database Errors
    Affected Version 4.1.0 RC 2
    Fixed Version 4.1.0 RC 3
    Milestone (none)
    Software DependencyXenForo 2.x
    License TypePaid
    Users able to reproduce bug 0
    Users unable to reproduce bug 0
    Attachments 0
    Assigned Users (none)
    Tags (none)




    1. March 26, 2020 3:26 PM
      pegasus pegasus is offline
      VaultWiki Team
      Your database should not have had any entries in it already that could have been duplicates, since these entries are not created in earlier versions. Was this error already from a retry? In that case, the original error is probably different, and this error is from retrying over a failed state.

      If this was from a first attempt, then something is unusual about your database. You will first need to revert the successful queries from this step to avoid data loss:
      Code:
      UPDATE xf_report SET content_type = 'vw' WHERE report_id < 80 AND content_type IN ('vwpage', 'vwcomment', 'vwrevision')
      After that, search your database for xf_report.content_type records matching vwpage. If your database is normal, you should not have any.
      Code:
      SELECT * FROM xf_report WHERE content_type = 'vwpage'
      If there are records, they should probably be deleted. I don't know how they got there. Prior to VaultWiki 4.1, xf_report used 'vw' for wiki reports, not 'vwpage'.

      Already I think it's unusual that of the first 79 IDs in your xf_report table, all of them are wiki content. In addition to that, ALL wiki content ever reported was reported before even one forum post/content was ever reported.

      On a related note, this error message is possible due to a bug in earlier versions of VaultWiki (4.0.x). Due to a race condition (such as double-clicking submit in a report form), it was possible to generate two reports for the same wiki content without causing a duplicate key error. Upgrading to 4.1.x would finally cause that error here. However, based on the query in the error message, I see no evidence that this is what occurred on your installation. All existing wiki reports are visible in the query (you only have 79, all conveniently numbered), and there is no attempt to set 2 WHEN to the same THEN.
      Reply Reply  
    2. March 26, 2020 4:03 PM
      Alfa1 Alfa1 is offline
      Distinguished Member
      What may be considered different is that this xenforo install does not have a forum and a lot of VW functions are unused. The report system is solely used to report technical issues encountered in the wiki. Most likely there are just 79 reports. I don't need to keep those reports.

      This was indeed the first attempt.
      I don't know how to revert the queries. Nor how to find what queries need to be reverted.
      Reply Reply  
    3. March 26, 2020 5:07 PM
      Alfa1 Alfa1 is offline
      Distinguished Member
      There indeed are only 79 reports. All for VWPage. If needed I would be happy to delete the reports through phpmyadmin. Nothing lost there.
      Reply Reply  
    4. March 26, 2020 5:38 PM
      pegasus pegasus is offline
      VaultWiki Team
      In that case, if the reports are not needed, you can just truncate the xf_report table via phpmyadmin. It is likely the double-click report bug happened, even though I can't see the data in the error message.

      Marking this as fixed in the next build. There are changes to the upgrade step that will try to ignore duplicate entries.
      Reply Reply  
    + Reply

    Assigned Users
    Loading Please Wait
    Tags
    Loading Please Wait
    • Contact Us
    • License Agreement
    • Privacy
    • Terms
    • Top
    All times are GMT -4. The time now is 1:03 AM.
    This site uses cookies to help personalize content, to tailor your experience, and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Learn more… Accept Remind me later
  • striker
    Powered by vBulletin® Version 4.2.5 Beta 2
    Copyright © 2025 vBulletin Solutions Inc. All rights reserved.
    Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
    Copyright © 2008 - 2024 VaultWiki Team, Cracked Egg Studios, LLC.