• 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
    • [4.1.2] SQL query error trying to convert vw_301 to utf8mb4 via XF cmd.php (command line): Specified key was too long

    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: [4.1.2] SQL query error trying to convert vw_301 to utf8mb4 via XF cmd.php (command line): Specified key was too long

    • Issue Tools
      • View Changes
    1. issueid=6223 July 2, 2021 4:06 PM
      ACL ACL is offline
      Regular Member
      [4.1.2] SQL query error trying to convert vw_301 to utf8mb4 via XF cmd.php (command line): Specified key was too long

      Not an VW install/upgrade issue per say, but it happens when attempting to convert pre-XF2.0 utf8 tables to utf8mb4 using the XenForo provided conversion script. An admin may intend on executing this as part of an XF2.x upgrade in order to enable emoji support. The line:
      Code:
      php cmd.php xf:convert-utf8mb4
      Ref: https://xenforo.com/docs/xf2/unicode...version-script

      The error returned:
      Code:
      xf_vw_301: MySQL query error [1071]: Specified key was too long; max key length is 1000 bytes
      Background: Even though my public facing site has been running off XF2.1 for sometime, the table conversion step was not performed during the last upgrade. I'm in the process of doing a test upgrade to 2.2 using a test copy of the public site.
    Issue Details
    Issue Number 6223
    Issue Type Bug
    Project VaultWiki 4.x Series
    Category Install / Upgrade
    Status Fixed
    Priority 2 - Fatal / Database Errors
    Affected Version 4.1.2
    Fixed Version (none)
    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. July 3, 2021 11:04 AM
      pegasus pegasus is offline
      VaultWiki Team
      This error suggests to me that your installation was historically upgraded from before 4.1.0 RC 1 and also that for some reason, some of the upgrade steps for that version were skipped. There were quite a lot of changes involving key lengths in that version. Hopefully this is the only one you missed.

      For table vw_301, there is an index called sourcecontent. It should be:
      Code:
      sourcecontent ( oldgroup, `value`(150) )
      The new length would be 616 bytes under utf8mb4.
      Reply Reply  
    2. July 3, 2021 12:09 PM
      ACL ACL is offline
      Regular Member
      Yes, if I recall correctly it was VW4.1.0 Beta 4 that was first installed from the 4.1 branch on my public site. This was done late October 2019 with the XF1.5 EOL date then nearing closer.

      Here is an SQL dump of how the indexes are currently defined for xf_vw_301 (at the point of running the utf8mb4 XF conversion script):

      Code:
      --
      -- Indexes for table `xf_vw_301`
      --
      ALTER TABLE `xf_vw_301`
        ADD PRIMARY KEY (`permanentid`),
        ADD UNIQUE KEY `oldgroup` (`oldgroup`,`value`),
        ADD KEY `target` (`itemtypeid`,`itemid`),
        ADD KEY `dateline` (`dateline`),
        ADD KEY `sourcecontent` (`oldgroup`,`value`(150));
      
      --
      -- AUTO_INCREMENT for table `xf_vw_301`
      --
      ALTER TABLE `xf_vw_301`
        MODIFY `permanentid` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
      COMMIT;
      xf_vw_301 was the only VaultWiki related table that failed during the utf8mb4 conversion.
      Reply Reply  
    3. July 4, 2021 11:22 AM
      pegasus pegasus is offline
      VaultWiki Team
      Code:
      ALTER TABLE xf_vw_301 DROP INDEX oldgroup
      Reply Reply  
    4. July 4, 2021 12:24 PM
      ACL ACL is offline
      Regular Member
      Conversion complete without errors after making that one change.
      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 2:38 PM.
    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.